Ext={version:"2.2.1"};window["undefined"]=window["undefined"];Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var idSeed=0;var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isChrome=ua.indexOf("chrome")>-1,isSafari=!isChrome&&(/webkit|khtml/).test(ua),isSafari3=isSafari&&ua.indexOf("webkit/5")!=-1,isIE=!isOpera&&ua.indexOf("msie")>-1,isIE7=!isOpera&&ua.indexOf("msie 7")>-1,isIE8=!isOpera&&ua.indexOf("msie 8")>-1,isGecko=!isSafari&&!isChrome&&ua.indexOf("gecko")>-1,isGecko3=isGecko&&ua.indexOf("rv:1.9")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isAir=(ua.indexOf("adobeair")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=window.location.href.toLowerCase().indexOf("https")===0;if(isIE&&!isIE7){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:isStrict,isSecure:isSecure,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http://extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return}var cache={};for(var b in o){var parts=b.split("@");if(parts[1]){var s=parts[0];if(!cache[s]){cache[s]=Ext.select(s)}cache[s].on(parts[1],o[b])}}cache=null},id:function(el,prefix){prefix=prefix||"ext-gen";el=Ext.getDom(el);var id=prefix+(++idSeed);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,overrides);sb.extend=function(o){Ext.extend(sb,o)};return sb}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method]}if(Ext.isIE&&overrides.toString!=origclass.toString){p.toString=overrides.toString}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+' == "undefined"){'+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},urlEncode:function(o){if(!o){return""}var buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=="undefined"){buf.push(k,"=&")}else{if(type!="function"&&type!="object"){buf.push(k,"=",encodeURIComponent(ov),"&")}else{if(Ext.isDate(ov)){var s=Ext.encode(ov).replace(/"/g,"");buf.push(k,"=",s,"&")}else{if(Ext.isArray(ov)){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&")}}else{buf.push(k,"=&")}}}}}}buf.pop();return buf.join("")},urlDecode:function(string,overwrite){if(!string||!string.length){return{}}var obj={};var pairs=string.split("&");var pair,name,value;for(var i=0,len=pairs.length;i<len;i++){pair=pairs[i].split("=");name=decodeURIComponent(pair[0]);value=decodeURIComponent(pair[1]);if(overwrite!==true){if(typeof obj[name]=="undefined"){obj[name]=value}else{if(typeof obj[name]=="string"){obj[name]=[obj[name]];obj[name].push(value)}else{obj[name].push(value)}}}else{obj[name]=value}}return obj},each:function(array,fn,scope){if(typeof array.length=="undefined"||typeof array=="string"){array=[array]}for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===false){return i}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(Ext.isArray(a)){r=r.concat(a)}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0))}else{r.push(a)}}}return r},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},callback:function(cb,scope,args,delay){if(typeof cb=="function"){if(delay){cb.defer(delay,scope,args||[])}else{cb.apply(scope,args||[])}}},getDom:function(el){if(!el||!document){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},getDoc:function(){return Ext.get(document)},getBody:function(){return Ext.get(document.body||document.documentElement)},getCmp:function(id){return Ext.ComponentMgr.get(id)},num:function(v,defaultValue){if(typeof v!="number"||isNaN(v)){return defaultValue}return v},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(typeof as.destroy=="function"){as.destroy()}else{if(as.dom){as.removeAllListeners();as.remove()}}}}},removeNode:isIE?function(){var d;return function(n){if(n&&n.tagName!="BODY"){d=d||document.createElement("div");d.appendChild(n);d.innerHTML=""}}}():function(n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}},type:function(o){if(o===undefined||o===null){return false}if(o.htmlElement){return"element"}var t=typeof o;if(t=="object"&&o.nodeName){switch(o.nodeType){case 1:return"element";case 3:return(/\S/).test(o.nodeValue)?"textnode":"whitespace"}}if(t=="object"||t=="function"){switch(o.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof o.length=="number"&&typeof o.item=="function"){return"nodelist"}}return t},isEmpty:function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==="":false)},value:function(v,defaultValue,allowBlank){return Ext.isEmpty(v,allowBlank)?defaultValue:v},isArray:function(v){return v&&typeof v.length=="number"&&typeof v.splice=="function"},isDate:function(v){return v&&typeof v.getFullYear=="function"},isOpera:isOpera,isChrome:isChrome,isSafari:isSafari,isSafari3:isSafari3,isSafari2:isSafari&&!isSafari3,isIE:isIE,isIE6:isIE&&!isIE7&&!isIE8,isIE7:isIE7,isIE8:isIE8,isGecko:isGecko,isGecko2:isGecko&&!isGecko3,isGecko3:isGecko3,isBorderBox:isBorderBox,isLinux:isLinux,isWindows:isWindows,isMac:isMac,isAir:isAir,useShims:((isIE&&!isIE7)||(isMac&&isGecko&&!isGecko3))});Ext.ns=Ext.namespace})();Ext.ns("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout","Ext.app","Ext.ux");Ext.apply(Function.prototype,{createCallback:function(){var a=arguments;var b=this;return function(){return b.apply(window,a)}},createDelegate:function(c,b,a){var d=this;return function(){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(typeof a=="number"){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return d.apply(c||window,f)}},defer:function(c,e,b,a){var d=this.createDelegate(e,b,a);if(c){return setTimeout(d,c)}d();return 0},createSequence:function(b,a){if(typeof b!="function"){return this}var c=this;return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}},createInterceptor:function(b,a){if(typeof b!="function"){return this}var c=this;return function(){b.target=this;b.method=c;if(b.apply(a||this||window,arguments)===false){return}return c.apply(this||window,arguments)}}});Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(d,b,c){var a=new String(d);if(!c){c=" "}while(a.length<b){a=c+a}return a.toString()},format:function(b){var a=Array.prototype.slice.call(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});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,"")}}();Ext.applyIf(Number.prototype,{constrain:function(b,a){return Math.min(Math.max(this,b),a)}});Ext.applyIf(Array.prototype,{indexOf:function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return-1},remove:function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this}});Date.prototype.getElapsed=function(a){return Math.abs((a||new Date()).getTime()-this.getTime())};(function(){var b;Ext.lib.Dom={getViewWidth:function(e){return e?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(e){return e?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var e=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(e,this.getViewportHeight())},getDocumentWidth:function(){var e=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(e,this.getViewportWidth())},getViewportHeight:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientHeight:document.body.clientHeight}else{return self.innerHeight}},getViewportWidth:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientWidth:document.body.clientWidth}else{return self.innerWidth}},isAncestor:function(f,g){f=Ext.getDom(f);g=Ext.getDom(g);if(!f||!g){return false}if(f.contains&&!Ext.isSafari){return f.contains(g)}else{if(f.compareDocumentPosition){return!!(f.compareDocumentPosition(g)&16)}else{var e=g.parentNode;while(e){if(e==f){return true}else{if(!e.tagName||e.tagName.toUpperCase()=="HTML"){return false}}e=e.parentNode}return false}}},getRegion:function(e){return Ext.lib.Region.getRegion(e)},getY:function(e){return this.getXY(e)[1]},getX:function(e){return this.getXY(e)[0]},getXY:function(g){var f,k,m,n,j=(document.body||document.documentElement);g=Ext.getDom(g);if(g==j){return[0,0]}if(g.getBoundingClientRect){m=g.getBoundingClientRect();n=c(document).getScroll();return[m.left+n.left,m.top+n.top]}var o=0,l=0;f=g;var e=c(g).getStyle("position")=="absolute";while(f){o+=f.offsetLeft;l+=f.offsetTop;if(!e&&c(f).getStyle("position")=="absolute"){e=true}if(Ext.isGecko){k=c(f);var q=parseInt(k.getStyle("borderTopWidth"),10)||0;var h=parseInt(k.getStyle("borderLeftWidth"),10)||0;o+=h;l+=q;if(f!=g&&k.getStyle("overflow")!="visible"){o+=h;l+=q}}f=f.offsetParent}if(Ext.isSafari&&e){o-=j.offsetLeft;l-=j.offsetTop}if(Ext.isGecko&&!e){var i=c(j);o+=parseInt(i.getStyle("borderLeftWidth"),10)||0;l+=parseInt(i.getStyle("borderTopWidth"),10)||0}f=g.parentNode;while(f&&f!=j){if(!Ext.isOpera||(f.tagName!="TR"&&c(f).getStyle("display")!="inline")){o-=f.scrollLeft;l-=f.scrollTop}f=f.parentNode}return[o,l]},setXY:function(e,f){e=Ext.fly(e,"_setXY");e.position();var g=e.translatePoints(f);if(f[0]!==false){e.dom.style.left=g.left+"px"}if(f[1]!==false){e.dom.style.top=g.top+"px"}},setX:function(f,e){this.setXY(f,[e,false])},setY:function(e,f){this.setXY(e,[false,f])}};Ext.lib.Event=function(){var f=false;var g=[];var k=[];var i=0;var h=[];var e=0;var j=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var l=this;var m=function(){l._tryPreloadAttach()};this._interval=setInterval(m,this.POLL_INTERVAL)}},onAvailable:function(n,l,o,m){h.push({id:n,fn:l,obj:o,override:m,checkReady:false});i=this.POLL_RETRYS;this.startInterval()},addListener:function(q,m,p){q=Ext.getDom(q);if(!q||!p){return false}if("unload"==m){k[k.length]=[q,m,p];return true}var o=function(r){return typeof Ext!="undefined"?p(Ext.lib.Event.getEvent(r)):false};var l=[q,m,p,o];var n=g.length;g[n]=l;this.doAdd(q,m,o,false);return true},removeListener:function(s,o,r){var q,n;s=Ext.getDom(s);if(!r){return this.purgeElement(s,false,o)}if("unload"==o){for(q=0,n=k.length;q<n;q++){var m=k[q];if(m&&m[0]==s&&m[1]==o&&m[2]==r){k.splice(q,1);return true}}return false}var l=null;var p=arguments[3];if("undefined"==typeof p){p=this._getCacheIndex(s,o,r)}if(p>=0){l=g[p]}if(!s||!l){return false}this.doRemove(s,o,l[this.WFN],false);delete g[p][this.WFN];delete g[p][this.FN];g.splice(p,1);return true},getTarget:function(n,m){n=n.browserEvent||n;var l=n.target||n.srcElement;return this.resolveTextNode(l)},resolveTextNode:function(l){if(Ext.isSafari&&l&&3==l.nodeType){return l.parentNode}else{return l}},getPageX:function(m){m=m.browserEvent||m;var l=m.pageX;if(!l&&0!==l){l=m.clientX||0;if(Ext.isIE){l+=this.getScroll()[1]}}return l},getPageY:function(l){l=l.browserEvent||l;var m=l.pageY;if(!m&&0!==m){m=l.clientY||0;if(Ext.isIE){m+=this.getScroll()[0]}}return m},getXY:function(l){l=l.browserEvent||l;return[this.getPageX(l),this.getPageY(l)]},getRelatedTarget:function(m){m=m.browserEvent||m;var l=m.relatedTarget;if(!l){if(m.type=="mouseout"){l=m.toElement}else{if(m.type=="mouseover"){l=m.fromElement}}}return this.resolveTextNode(l)},getTime:function(n){n=n.browserEvent||n;if(!n.time){var m=new Date().getTime();try{n.time=m}catch(l){this.lastError=l;return m}}return n.time},stopEvent:function(l){this.stopPropagation(l);this.preventDefault(l)},stopPropagation:function(l){l=l.browserEvent||l;if(l.stopPropagation){l.stopPropagation()}else{l.cancelBubble=true}},preventDefault:function(l){l=l.browserEvent||l;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}},getEvent:function(m){var l=m||window.event;if(!l){var n=this.getEvent.caller;while(n){l=n.arguments[0];if(l&&Event==l.constructor){break}n=n.caller}}return l},getCharCode:function(l){l=l.browserEvent||l;return l.charCode||l.keyCode||0},_getCacheIndex:function(q,n,p){for(var o=0,m=g.length;o<m;++o){var l=g[o];if(l&&l[this.FN]==p&&l[this.EL]==q&&l[this.TYPE]==n){return o}}return-1},elCache:{},getEl:function(l){return document.getElementById(l)},clearCache:function(){},_load:function(m){f=true;var l=Ext.lib.Event;if(Ext.isIE){l.doRemove(window,"load",l._load)}},_tryPreloadAttach:function(){if(this.locked){return false}this.locked=true;var r=!f;if(!r){r=(i>0)}var q=[];for(var m=0,l=h.length;m<l;++m){var p=h[m];if(p){var o=this.getEl(p.id);if(o){if(!p.checkReady||f||o.nextSibling||(document&&document.body)){var n=o;if(p.override){if(p.override===true){n=p.obj}else{n=p.override}}p.fn.call(n,p.obj);h[m]=null}}else{q.push(p)}}}i=(q.length===0)?0:i-1;if(r){this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false;return true},purgeElement:function(q,r,o){var s=this.getListeners(q,o);if(s){for(var p=0,m=s.length;p<m;++p){var n=s[p];this.removeListener(q,n.type,n.fn)}}if(r&&q&&q.childNodes){for(p=0,m=q.childNodes.length;p<m;++p){this.purgeElement(q.childNodes[p],r,o)}}},getListeners:function(n,s){var q=[],m;if(!s){m=[g,k]}else{if(s=="unload"){m=[k]}else{m=[g]}}for(var p=0;p<m.length;++p){var u=m[p];if(u&&u.length>0){for(var r=0,t=u.length;r<t;++r){var o=u[r];if(o&&o[this.EL]===n&&(!s||s===o[this.TYPE])){q.push({type:o[this.TYPE],fn:o[this.FN],obj:o[this.OBJ],adjust:o[this.ADJ_SCOPE],index:r})}}}}return(q.length)?q:null},_unload:function(t){var s=Ext.lib.Event,q,p,n,m,o;for(q=0,m=k.length;q<m;++q){n=k[q];if(n){var r=window;if(n[s.ADJ_SCOPE]){if(n[s.ADJ_SCOPE]===true){r=n[s.OBJ]}else{r=n[s.ADJ_SCOPE]}}n[s.FN].call(r,s.getEvent(t),n[s.OBJ]);k[q]=null;n=null;r=null}}k=null;if(g&&g.length>0){p=g.length;while(p){o=p-1;n=g[o];if(n){s.removeListener(n[s.EL],n[s.TYPE],n[s.FN],o)}p=p-1}n=null;s.clearCache()}s.doRemove(window,"unload",s._unload)},getScroll:function(){var l=document.documentElement,m=document.body;if(l&&(l.scrollTop||l.scrollLeft)){return[l.scrollTop,l.scrollLeft]}else{if(m){return[m.scrollTop,m.scrollLeft]}else{return[0,0]}}},doAdd:function(){if(window.addEventListener){return function(o,m,n,l){o.addEventListener(m,n,(l))}}else{if(window.attachEvent){return function(o,m,n,l){o.attachEvent("on"+m,n)}}else{return function(){}}}}(),doRemove:function(){if(window.removeEventListener){return function(o,m,n,l){o.removeEventListener(m,n,(l))}}else{if(window.detachEvent){return function(n,l,m){n.detachEvent("on"+l,m)}}else{return function(){}}}}()}}();var d=Ext.lib.Event;d.on=d.addListener;d.un=d.removeListener;if(document&&document.body){d._load()}else{d.doAdd(window,"load",d._load)}d.doAdd(window,"unload",d._unload);d._tryPreloadAttach();Ext.lib.Ajax={request:function(l,j,e,k,f){if(f){var g=f.headers;if(g){for(var i in g){if(g.hasOwnProperty(i)){this.initHeader(i,g[i],false)}}}if(f.xmlData){if(!g||!g["Content-Type"]){this.initHeader("Content-Type","text/xml",false)}l=(l?l:(f.method?f.method:"POST"));k=f.xmlData}else{if(f.jsonData){if(!g||!g["Content-Type"]){this.initHeader("Content-Type","application/json",false)}l=(l?l:(f.method?f.method:"POST"));k=typeof f.jsonData=="object"?Ext.encode(f.jsonData):f.jsonData}}}return this.asyncRequest(l,j,e,k)},serializeForm:function(f){if(typeof f=="string"){f=(document.getElementById(f)||document.forms[f])}var g,e,h,l,m="",o=false;for(var n=0;n<f.elements.length;n++){g=f.elements[n];l=f.elements[n].disabled;e=f.elements[n].name;h=f.elements[n].value;if(!l&&e){switch(g.type){case"select-one":case"select-multiple":for(var k=0;k<g.options.length;k++){if(g.options[k].selected){if(Ext.isIE){m+=encodeURIComponent(e)+"="+encodeURIComponent(g.options[k].attributes.value.specified?g.options[k].value:g.options[k].text)+"&"}else{m+=encodeURIComponent(e)+"="+encodeURIComponent(g.options[k].hasAttribute("value")?g.options[k].value:g.options[k].text)+"&"}}}break;case"radio":case"checkbox":if(g.checked){m+=encodeURIComponent(e)+"="+encodeURIComponent(h)+"&"}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(o==false){m+=encodeURIComponent(e)+"="+encodeURIComponent(h)+"&";o=true}break;default:m+=encodeURIComponent(e)+"="+encodeURIComponent(h)+"&";break}}}m=m.substr(0,m.length-1);return m},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",hasDefaultHeaders:true,defaultHeaders:{},poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(e){this.activeX.unshift(e)},setDefaultPostHeader:function(e){this.useDefaultHeader=e},setDefaultXhrHeader:function(e){this.useDefaultXhrHeader=e},setPollingInterval:function(e){if(typeof e=="number"&&isFinite(e)){this.pollInterval=e}},createXhrObject:function(k){var j,f;try{f=new XMLHttpRequest();j={conn:f,tId:k}}catch(h){for(var g=0;g<this.activeX.length;++g){try{f=new ActiveXObject(this.activeX[g]);j={conn:f,tId:k};break}catch(h){}}}finally{return j}},getConnectionObject:function(){var g;var h=this.transactionId;try{g=this.createXhrObject(h);if(g){this.transactionId++}}catch(f){}finally{return g}},asyncRequest:function(i,f,h,e){var g=this.getConnectionObject();if(!g){return null}else{g.conn.open(i,f,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders["X-Requested-With"]){this.initHeader("X-Requested-With",this.defaultXhrHeader,true)}}if(e&&this.useDefaultHeader&&(!this.hasHeaders||!this.headers["Content-Type"])){this.initHeader("Content-Type",this.defaultPostHeader)}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(g)}this.handleReadyState(g,h);g.conn.send(e||null);return g}},handleReadyState:function(f,g){var e=this;if(g&&g.timeout){this.timeout[f.tId]=window.setTimeout(function(){e.abort(f,g,true)},g.timeout)}this.poll[f.tId]=window.setInterval(function(){if(f.conn&&f.conn.readyState==4){window.clearInterval(e.poll[f.tId]);delete e.poll[f.tId];if(g&&g.timeout){window.clearTimeout(e.timeout[f.tId]);delete e.timeout[f.tId]}e.handleTransactionResponse(f,g)}},this.pollInterval)},handleTransactionResponse:function(j,k,f){if(!k){this.releaseObject(j);return}var h,g;try{if(j.conn.status!==undefined&&j.conn.status!=0){h=j.conn.status}else{h=13030}}catch(i){h=13030}if((h>=200&&h<300)||(Ext.isIE&&h==1223)){g=this.createResponseObject(j,k.argument);if(k.success){if(!k.scope){k.success(g)}else{k.success.apply(k.scope,[g])}}}else{switch(h){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:g=this.createExceptionObject(j.tId,k.argument,(f?f:false));if(k.failure){if(!k.scope){k.failure(g)}else{k.failure.apply(k.scope,[g])}}break;default:g=this.createResponseObject(j,k.argument);if(k.failure){if(!k.scope){k.failure(g)}else{k.failure.apply(k.scope,[g])}}}}this.releaseObject(j);g=null},createResponseObject:function(f,m){var j={};var p={};try{var h=f.conn.getAllResponseHeaders();var l=h.split("\n");for(var k=0;k<l.length;k++){var g=l[k].indexOf(":");if(g!=-1){p[l[k].substring(0,g)]=l[k].substring(g+2)}}}catch(n){}j.tId=f.tId;j.status=f.conn.status;j.statusText=f.conn.statusText;j.getResponseHeader=p;j.getAllResponseHeaders=h;j.responseText=f.conn.responseText;j.responseXML=f.conn.responseXML;if(typeof m!==undefined){j.argument=m}return j},createExceptionObject:function(l,h,e){var j=0;var k="communication failure";var g=-1;var f="transaction aborted";var i={};i.tId=l;if(e){i.status=g;i.statusText=f}else{i.status=j;i.statusText=k}if(h){i.argument=h}return i},initHeader:function(e,h,g){var f=(g)?this.defaultHeaders:this.headers;if(f[e]===undefined){f[e]=h}else{f[e]=h+","+f[e]}if(g){this.hasDefaultHeaders=true}else{this.hasHeaders=true}},setHeader:function(e){if(this.hasDefaultHeaders){for(var f in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(f)){e.conn.setRequestHeader(f,this.defaultHeaders[f])}}}if(this.hasHeaders){for(var f in this.headers){if(this.headers.hasOwnProperty(f)){e.conn.setRequestHeader(f,this.headers[f])}}this.headers={};this.hasHeaders=false}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false},abort:function(f,g,e){if(this.isCallInProgress(f)){f.conn.abort();window.clearInterval(this.poll[f.tId]);delete this.poll[f.tId];if(e){delete this.timeout[f.tId]}this.handleTransactionResponse(f,g,true);return true}else{return false}},isCallInProgress:function(e){if(e.conn){return e.conn.readyState!=4&&e.conn.readyState!=0}else{return false}},releaseObject:function(e){e.conn=null;e=null},activeX:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]};Ext.lib.Region=function(g,h,e,f){this.top=g;this[1]=g;this.right=h;this.bottom=e;this.left=f;this[0]=f};Ext.lib.Region.prototype={contains:function(e){return(e.left>=this.left&&e.right<=this.right&&e.top>=this.top&&e.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(i){var g=Math.max(this.top,i.top);var h=Math.min(this.right,i.right);var e=Math.min(this.bottom,i.bottom);var f=Math.max(this.left,i.left);if(e>=g&&h>=f){return new Ext.lib.Region(g,h,e,f)}else{return null}},union:function(i){var g=Math.min(this.top,i.top);var h=Math.max(this.right,i.right);var e=Math.max(this.bottom,i.bottom);var f=Math.min(this.left,i.left);return new Ext.lib.Region(g,h,e,f)},constrainTo:function(e){this.top=this.top.constrain(e.top,e.bottom);this.bottom=this.bottom.constrain(e.top,e.bottom);this.left=this.left.constrain(e.left,e.right);this.right=this.right.constrain(e.left,e.right);return this},adjust:function(g,f,e,h){this.top+=g;this.left+=f;this.right+=h;this.bottom+=e;return this}};Ext.lib.Region.getRegion=function(h){var j=Ext.lib.Dom.getXY(h);var g=j[1];var i=j[0]+h.offsetWidth;var e=j[1]+h.offsetHeight;var f=j[0];return new Ext.lib.Region(g,i,e,f)};Ext.lib.Point=function(e,f){if(Ext.isArray(e)){f=e[1];e=e[0]}this.x=this.right=this.left=this[0]=e;this.y=this.top=this.bottom=this[1]=f};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.lib.Anim={scroll:function(h,f,i,j,e,g){return this.run(h,f,i,j,e,g,Ext.lib.Scroll)},motion:function(h,f,i,j,e,g){return this.run(h,f,i,j,e,g,Ext.lib.Motion)},color:function(h,f,i,j,e,g){return this.run(h,f,i,j,e,g,Ext.lib.ColorAnim)},run:function(i,f,k,l,e,h,g){g=g||Ext.lib.AnimBase;if(typeof l=="string"){l=Ext.lib.Easing[l]}var j=new g(i,f,k,l);j.animateX(function(){Ext.callback(e,h)});return j}};function c(e){if(!b){b=new Ext.Element.Flyweight()}b.dom=e;return b}if(Ext.isIE){function a(){var e=Function.prototype;delete e.createSequence;delete e.defer;delete e.createDelegate;delete e.createCallback;delete e.createInterceptor;window.detachEvent("onunload",a)}window.attachEvent("onunload",a)}Ext.lib.AnimBase=function(f,e,g,h){if(f){this.init(f,e,g,h)}};Ext.lib.AnimBase.prototype={toString:function(){var e=this.getEl();var f=e.id||e.tagName;return("Anim "+f)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(e,g,f){return this.method(this.currentFrame,g,f-g,this.totalFrames)},setAttribute:function(e,g,f){if(this.patterns.noNegatives.test(e)){g=(g>0)?g:0}Ext.fly(this.getEl(),"_anim").setStyle(e,g+f)},getAttribute:function(e){var g=this.getEl();var i=c(g).getStyle(e);if(i!=="auto"&&!this.patterns.offsetUnit.test(i)){return parseFloat(i)}var f=this.patterns.offsetAttribute.exec(e)||[];var j=!!(f[3]);var h=!!(f[2]);if(h||(c(g).getStyle("position")=="absolute"&&j)){i=g["offset"+f[0].charAt(0).toUpperCase()+f[0].substr(1)]}else{i=0}return i},getDefaultUnit:function(e){if(this.patterns.defaultUnit.test(e)){return"px"}return""},animateX:function(h,e){var g=function(){this.onComplete.removeListener(g);if(typeof h=="function"){h.call(e||this,this)}};this.onComplete.addListener(g,this);this.animate()},setRuntimeAttribute:function(f){var l;var g;var h=this.attributes;this.runtimeAttributes[f]={};var k=function(i){return(typeof i!=="undefined")};if(!k(h[f]["to"])&&!k(h[f]["by"])){return false}l=(k(h[f]["from"]))?h[f]["from"]:this.getAttribute(f);if(k(h[f]["to"])){g=h[f]["to"]}else{if(k(h[f]["by"])){if(l.constructor==Array){g=[];for(var j=0,e=l.length;j<e;++j){g[j]=l[j]+h[f]["by"][j]}}else{g=l+h[f]["by"]}}}this.runtimeAttributes[f].start=l;this.runtimeAttributes[f].end=g;this.runtimeAttributes[f].unit=(k(h[f].unit))?h[f]["unit"]:this.getDefaultUnit(f)},init:function(g,l,k,e){var f=false;var h=null;var j=0;g=Ext.getDom(g);this.attributes=l||{};this.duration=k||1;this.method=e||Ext.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Ext.lib.AnimMgr.fps;this.getEl=function(){return g};this.isAnimated=function(){return f};this.getStartTime=function(){return h};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Ext.lib.AnimMgr.fps*this.duration):this.duration;Ext.lib.AnimMgr.registerElement(this)};this.stop=function(o){if(o){this.currentFrame=this.totalFrames;this._onTween.fire()}Ext.lib.AnimMgr.stop(this)};var n=function(){this.onStart.fire();this.runtimeAttributes={};for(var o in this.attributes){this.setRuntimeAttribute(o)}f=true;j=0;h=new Date()};var m=function(){var q={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};q.toString=function(){return("duration: "+q.duration+", currentFrame: "+q.currentFrame)};this.onTween.fire(q);var p=this.runtimeAttributes;for(var o in p){this.setAttribute(o,this.doMethod(o,p[o].start,p[o].end),p[o].unit)}j+=1};var i=function(){var o=(new Date()-h)/1000;var p={duration:o,frames:j,fps:j/o};p.toString=function(){return("duration: "+p.duration+", frames: "+p.frames+", fps: "+p.fps)};f=false;j=0;this.onComplete.fire(p)};this._onStart=new Ext.util.Event(this);this.onStart=new Ext.util.Event(this);this.onTween=new Ext.util.Event(this);this._onTween=new Ext.util.Event(this);this.onComplete=new Ext.util.Event(this);this._onComplete=new Ext.util.Event(this);this._onStart.addListener(n);this._onTween.addListener(m);this._onComplete.addListener(i)}};Ext.lib.AnimMgr=new function(){var g=null;var f=[];var e=0;this.fps=1000;this.delay=1;this.registerElement=function(j){f[f.length]=j;e+=1;j._onStart.fire();this.start()};this.unRegister=function(k,j){k._onComplete.fire();j=j||i(k);if(j!=-1){f.splice(j,1)}e-=1;if(e<=0){this.stop()}};this.start=function(){if(g===null){g=setInterval(this.run,this.delay)}};this.stop=function(l){if(!l){clearInterval(g);for(var k=0,j=f.length;k<j;++k){if(f[0].isAnimated()){this.unRegister(f[0],0)}}f=[];g=null;e=0}else{this.unRegister(l)}};this.run=function(){for(var l=0,j=f.length;l<j;++l){var k=f[l];if(!k||!k.isAnimated()){continue}if(k.currentFrame<k.totalFrames||k.totalFrames===null){k.currentFrame+=1;if(k.useSeconds){h(k)}k._onTween.fire()}else{Ext.lib.AnimMgr.stop(k,l)}}};var i=function(l){for(var k=0,j=f.length;k<j;++k){if(f[k]==l){return k}}return-1};var h=function(k){var n=k.totalFrames;var m=k.currentFrame;var l=(k.currentFrame*k.duration*1000/k.totalFrames);var j=(new Date()-k.getStartTime());var o=0;if(j<k.duration*1000){o=Math.round((j/l-1)*k.currentFrame)}else{o=n-(m+1)}if(o>0&&isFinite(o)){if(k.currentFrame+o>=n){o=n-(m+1)}k.currentFrame+=o}}};Ext.lib.Bezier=new function(){this.getPosition=function(k,h){var l=k.length;var g=[];for(var f=0;f<l;++f){g[f]=[k[f][0],k[f][1]]}for(var e=1;e<l;++e){for(f=0;f<l-e;++f){g[f][0]=(1-h)*g[f][0]+h*g[parseInt(f+1,10)][0];g[f][1]=(1-h)*g[f][1]+h*g[parseInt(f+1,10)][1]}}return[g[0][0],g[0][1]]}};(function(){Ext.lib.ColorAnim=function(i,h,j,k){Ext.lib.ColorAnim.superclass.constructor.call(this,i,h,j,k)};Ext.extend(Ext.lib.ColorAnim,Ext.lib.AnimBase);var f=Ext.lib;var g=f.ColorAnim.superclass;var e=f.ColorAnim.prototype;e.toString=function(){var h=this.getEl();var i=h.id||h.tagName;return("ColorAnim "+i)};e.patterns.color=/color$/i;e.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;e.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;e.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;e.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;e.parseColor=function(h){if(h.length==3){return h}var i=this.patterns.hex.exec(h);if(i&&i.length==4){return[parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16)]}i=this.patterns.rgb.exec(h);if(i&&i.length==4){return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)]}i=this.patterns.hex3.exec(h);if(i&&i.length==4){return[parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16)]}return null};e.getAttribute=function(h){var j=this.getEl();if(this.patterns.color.test(h)){var k=c(j).getStyle(h);if(this.patterns.transparent.test(k)){var i=j.parentNode;k=c(i).getStyle(h);while(i&&this.patterns.transparent.test(k)){i=i.parentNode;k=c(i).getStyle(h);if(i.tagName.toUpperCase()=="HTML"){k="#fff"}}}}else{k=g.getAttribute.call(this,h)}return k};e.doMethod=function(j,n,k){var m;if(this.patterns.color.test(j)){m=[];for(var l=0,h=n.length;l<h;++l){m[l]=g.doMethod.call(this,j,n[l],k[l])}m="rgb("+Math.floor(m[0])+","+Math.floor(m[1])+","+Math.floor(m[2])+")"}else{m=g.doMethod.call(this,j,n,k)}return m};e.setRuntimeAttribute=function(j){g.setRuntimeAttribute.call(this,j);if(this.patterns.color.test(j)){var l=this.attributes;var n=this.parseColor(this.runtimeAttributes[j].start);var k=this.parseColor(this.runtimeAttributes[j].end);if(typeof l[j]["to"]==="undefined"&&typeof l[j]["by"]!=="undefined"){k=this.parseColor(l[j].by);for(var m=0,h=n.length;m<h;++m){k[m]=n[m]+k[m]}}this.runtimeAttributes[j].start=n;this.runtimeAttributes[j].end=k}}})();Ext.lib.Easing={easeNone:function(f,e,h,g){return h*f/g+e},easeIn:function(f,e,h,g){return h*(f/=g)*f+e},easeOut:function(f,e,h,g){return-h*(f/=g)*(f-2)+e},easeBoth:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f+e}return-h/2*((--f)*(f-2)-1)+e},easeInStrong:function(f,e,h,g){return h*(f/=g)*f*f*f+e},easeOutStrong:function(f,e,h,g){return-h*((f=f/g-1)*f*f*f-1)+e},easeBothStrong:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+e}return-h/2*((f-=2)*f*f*f-2)+e},elasticIn:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j)==1){return e+k}if(!i){i=j*0.3}if(!f||f<Math.abs(k)){f=k;var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}return-(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e},elasticOut:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j)==1){return e+k}if(!i){i=j*0.3}if(!f||f<Math.abs(k)){f=k;var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}return f*Math.pow(2,-10*g)*Math.sin((g*j-h)*(2*Math.PI)/i)+k+e},elasticBoth:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j/2)==2){return e+k}if(!i){i=j*(0.3*1.5)}if(!f||f<Math.abs(k)){f=k;var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}if(g<1){return-0.5*(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e}return f*Math.pow(2,-10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i)*0.5+k+e},backIn:function(f,e,i,h,g){if(typeof g=="undefined"){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+e},backOut:function(f,e,i,h,g){if(typeof g=="undefined"){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+e},backBoth:function(f,e,i,h,g){if(typeof g=="undefined"){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+e}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+e},bounceIn:function(f,e,h,g){return h-Ext.lib.Easing.bounceOut(g-f,0,h,g)+e},bounceOut:function(f,e,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+e}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+e}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+e}}}return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+e},bounceBoth:function(f,e,h,g){if(f<g/2){return Ext.lib.Easing.bounceIn(f*2,0,h,g)*0.5+e}return Ext.lib.Easing.bounceOut(f*2-g,0,h,g)*0.5+h*0.5+e}};(function(){Ext.lib.Motion=function(k,j,l,m){if(k){Ext.lib.Motion.superclass.constructor.call(this,k,j,l,m)}};Ext.extend(Ext.lib.Motion,Ext.lib.ColorAnim);var h=Ext.lib;var i=h.Motion.superclass;var f=h.Motion.prototype;f.toString=function(){var j=this.getEl();var k=j.id||j.tagName;return("Motion "+k)};f.patterns.points=/^points$/i;f.setAttribute=function(j,l,k){if(this.patterns.points.test(j)){k=k||"px";i.setAttribute.call(this,"left",l[0],k);i.setAttribute.call(this,"top",l[1],k)}else{i.setAttribute.call(this,j,l,k)}};f.getAttribute=function(j){if(this.patterns.points.test(j)){var k=[i.getAttribute.call(this,"left"),i.getAttribute.call(this,"top")]}else{k=i.getAttribute.call(this,j)}return k};f.doMethod=function(j,n,k){var m=null;if(this.patterns.points.test(j)){var l=this.method(this.currentFrame,0,100,this.totalFrames)/100;m=h.Bezier.getPosition(this.runtimeAttributes[j],l)}else{m=i.doMethod.call(this,j,n,k)}return m};f.setRuntimeAttribute=function(s){if(this.patterns.points.test(s)){var k=this.getEl();var m=this.attributes;var j;var o=m.points["control"]||[];var l;var p,r;if(o.length>0&&!Ext.isArray(o[0])){o=[o]}else{var n=[];for(p=0,r=o.length;p<r;++p){n[p]=o[p]}o=n}Ext.fly(k,"_anim").position();if(g(m.points["from"])){Ext.lib.Dom.setXY(k,m.points["from"])}else{Ext.lib.Dom.setXY(k,Ext.lib.Dom.getXY(k))}j=this.getAttribute("points");if(g(m.points["to"])){l=e.call(this,m.points["to"],j);var q=Ext.lib.Dom.getXY(this.getEl());for(p=0,r=o.length;p<r;++p){o[p]=e.call(this,o[p],j)}}else{if(g(m.points["by"])){l=[j[0]+m.points["by"][0],j[1]+m.points["by"][1]];for(p=0,r=o.length;p<r;++p){o[p]=[j[0]+o[p][0],j[1]+o[p][1]]}}}this.runtimeAttributes[s]=[j];if(o.length>0){this.runtimeAttributes[s]=this.runtimeAttributes[s].concat(o)}this.runtimeAttributes[s][this.runtimeAttributes[s].length]=l}else{i.setRuntimeAttribute.call(this,s)}};var e=function(j,l){var k=Ext.lib.Dom.getXY(this.getEl());j=[j[0]-k[0]+l[0],j[1]-k[1]+l[1]];return j};var g=function(j){return(typeof j!=="undefined")}})();(function(){Ext.lib.Scroll=function(i,h,j,k){if(i){Ext.lib.Scroll.superclass.constructor.call(this,i,h,j,k)}};Ext.extend(Ext.lib.Scroll,Ext.lib.ColorAnim);var f=Ext.lib;var g=f.Scroll.superclass;var e=f.Scroll.prototype;e.toString=function(){var h=this.getEl();var i=h.id||h.tagName;return("Scroll "+i)};e.doMethod=function(h,k,i){var j=null;if(h=="scroll"){j=[this.method(this.currentFrame,k[0],i[0]-k[0],this.totalFrames),this.method(this.currentFrame,k[1],i[1]-k[1],this.totalFrames)]}else{j=g.doMethod.call(this,h,k,i)}return j};e.getAttribute=function(h){var j=null;var i=this.getEl();if(h=="scroll"){j=[i.scrollLeft,i.scrollTop]}else{j=g.getAttribute.call(this,h)}return j};e.setAttribute=function(h,k,j){var i=this.getEl();if(h=="scroll"){i.scrollLeft=k[0];i.scrollTop=k[1]}else{g.setAttribute.call(this,h,k,j)}}})()})();Ext.DomHelper=function(){var l=null;var f=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var b=/^table|tbody|tr|td$/i;var a=function(v){if(typeof v=="string"){return v}var p="";if(Ext.isArray(v)){for(var t=0,q=v.length;t<q;t++){p+=a(v[t])}return p}if(!v.tag){v.tag="div"}p+="<"+v.tag;for(var n in v){if(n=="tag"||n=="children"||n=="cn"||n=="html"||typeof v[n]=="function"){continue}if(n=="style"){var u=v.style;if(typeof u=="function"){u=u.call()}if(typeof u=="string"){p+=' style="'+u+'"'}else{if(typeof u=="object"){p+=' style="';for(var r in u){if(typeof u[r]!="function"){p+=r+":"+u[r]+";"}}p+='"'}}}else{if(n=="cls"){p+=' class="'+v.cls+'"'}else{if(n=="htmlFor"){p+=' for="'+v.htmlFor+'"'}else{p+=" "+n+'="'+v[n]+'"'}}}}if(f.test(v.tag)){p+="/>"}else{p+=">";var w=v.children||v.cn;if(w){p+=a(w)}else{if(v.html){p+=v.html}}p+="</"+v.tag+">"}return p};var m=function(u,p){var t;if(Ext.isArray(u)){t=document.createDocumentFragment();for(var s=0,q=u.length;s<q;s++){m(u[s],t)}}else{if(typeof u=="string"){t=document.createTextNode(u)}else{t=document.createElement(u.tag||"div");var r=!!t.setAttribute;for(var n in u){if(n=="tag"||n=="children"||n=="cn"||n=="html"||n=="style"||typeof u[n]=="function"){continue}if(n=="cls"){t.className=u.cls}else{if(r){t.setAttribute(n,u[n])}else{t[n]=u[n]}}}Ext.DomHelper.applyStyles(t,u.style);var v=u.children||u.cn;if(v){m(v,t)}else{if(u.html){t.innerHTML=u.html}}}}if(p){p.appendChild(t)}return t};var i=function(t,q,p,r){l.innerHTML=[q,p,r].join("");var n=-1,o=l;while(++n<t){o=o.firstChild}return o};var j="<table>",e="</table>",c=j+"<tbody>",k="</tbody>"+e,h=c+"<tr>",d="</tr>"+k;var g=function(n,o,q,p){if(!l){l=document.createElement("div")}var r;var s=null;if(n=="td"){if(o=="afterbegin"||o=="beforeend"){return}if(o=="beforebegin"){s=q;q=q.parentNode}else{s=q.nextSibling;q=q.parentNode}r=i(4,h,p,d)}else{if(n=="tr"){if(o=="beforebegin"){s=q;q=q.parentNode;r=i(3,c,p,k)}else{if(o=="afterend"){s=q.nextSibling;q=q.parentNode;r=i(3,c,p,k)}else{if(o=="afterbegin"){s=q.firstChild}r=i(4,h,p,d)}}}else{if(n=="tbody"){if(o=="beforebegin"){s=q;q=q.parentNode;r=i(2,j,p,e)}else{if(o=="afterend"){s=q.nextSibling;q=q.parentNode;r=i(2,j,p,e)}else{if(o=="afterbegin"){s=q.firstChild}r=i(3,c,p,k)}}}else{if(o=="beforebegin"||o=="afterend"){return}if(o=="afterbegin"){s=q.firstChild}r=i(2,j,p,e)}}}q.insertBefore(r,s);return r};return{useDom:false,markup:function(n){return a(n)},applyStyles:function(p,q){if(q){p=Ext.fly(p);if(typeof q=="string"){var o=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var r;while((r=o.exec(q))!=null){p.setStyle(r[1],r[2])}}else{if(typeof q=="object"){for(var n in q){p.setStyle(n,q[n])}}else{if(typeof q=="function"){Ext.DomHelper.applyStyles(p,q.call())}}}}},insertHtml:function(p,r,q){p=p.toLowerCase();if(r.insertAdjacentHTML){if(b.test(r.tagName)){var o;if(o=g(r.tagName.toLowerCase(),p,r,q)){return o}}switch(p){case"beforebegin":r.insertAdjacentHTML("BeforeBegin",q);return r.previousSibling;case"afterbegin":r.insertAdjacentHTML("AfterBegin",q);return r.firstChild;case"beforeend":r.insertAdjacentHTML("BeforeEnd",q);return r.lastChild;case"afterend":r.insertAdjacentHTML("AfterEnd",q);return r.nextSibling}throw'Illegal insertion point -> "'+p+'"'}var n=r.ownerDocument.createRange();var s;switch(p){case"beforebegin":n.setStartBefore(r);s=n.createContextualFragment(q);r.parentNode.insertBefore(s,r);return r.previousSibling;case"afterbegin":if(r.firstChild){n.setStartBefore(r.firstChild);s=n.createContextualFragment(q);r.insertBefore(s,r.firstChild);return r.firstChild}else{r.innerHTML=q;return r.firstChild}case"beforeend":if(r.lastChild){n.setStartAfter(r.lastChild);s=n.createContextualFragment(q);r.appendChild(s);return r.lastChild}else{r.innerHTML=q;return r.lastChild}case"afterend":n.setStartAfter(r);s=n.createContextualFragment(q);r.parentNode.insertBefore(s,r.nextSibling);return r.nextSibling}throw'Illegal insertion point -> "'+p+'"'},insertBefore:function(n,q,p){return this.doInsert(n,q,p,"beforeBegin")},insertAfter:function(n,q,p){return this.doInsert(n,q,p,"afterEnd","nextSibling")},insertFirst:function(n,q,p){return this.doInsert(n,q,p,"afterBegin","firstChild")},doInsert:function(r,t,s,u,q){r=Ext.getDom(r);var p;if(this.useDom){p=m(t,null);(q==="firstChild"?r:r.parentNode).insertBefore(p,q?r[q]:r)}else{var n=a(t);p=this.insertHtml(u,r,n)}return s?Ext.get(p,true):p},append:function(q,s,r){q=Ext.getDom(q);var p;if(this.useDom){p=m(s,null);q.appendChild(p)}else{var n=a(s);p=this.insertHtml("beforeEnd",q,n)}return r?Ext.get(p,true):p},overwrite:function(n,q,p){n=Ext.getDom(n);n.innerHTML=a(q);return p?Ext.get(n.firstChild,true):n.firstChild},createTemplate:function(p){var n=a(p);return new Ext.Template(n)}}}();Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={};var nonSpace=/\S/;var trimRe=/^\s+|\s+$/g;var tplRe=/\{(\d+)\}/g;var modeRe=/^(\s?[\/>+~]\s?|\s|$)/;var tagTokenRe=/^(#)?([\w-\*]+)/;var nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/;function child(p,index){var i=0;var n=p.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(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}return this}function byClassName(c,a,v){if(!v){return c}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((" "+ci.className+" ").indexOf(v)!=-1){r[++ri]=ci}}return r}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.children||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=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(tagName=="*"||n.tagName.toLowerCase()!=tagName))){}if(n){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 r=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){r[++ri]=ci}}return r}function byId(cs,attr,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r}}return r}function byAttribute(cs,attr,value,op,custom){var r=[],ri=-1,st=custom=="{";var f=Ext.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){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)}}}}if((f&&f(a,value))||(!f&&a)){r[++ri]=ci}}return r}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}var isIE=window.ActiveXObject?true:false;eval("var batch = 30803;");var key=30803;function nodupIEXml(cs){var d=++key;cs[0].setAttribute("_nodup",d);var 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;for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}var r=[];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;if(!len1){return c2}if(isIE&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2)}var d=++key;for(var i=0;i<len1;i++){c1[i]._qdiff=d}var r=[];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,null,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"];var q=path,mode,lq;var tk=Ext.DomQuery.matchers;var tklen=tk.length;var mm;var lmode=q.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';q=q.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(q&&lq!=q){lq=q;var tm=q.match(tagTokenRe);if(type=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");'}q=q.replace(tm[0],"")}else{if(q.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");'}q=q.replace(tm[0],"")}}while(!(mm=q.match(modeRe))){var matched=false;for(var j=0;j<tklen;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});q=q.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+q+'"'}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(trimRe,"")+'";';q=q.replace(mm[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},select:function(path,root,type){if(!root||root==document){root=document}if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(",");var results=[];for(var i=0,len=paths.length;i<len;i++){var p=paths[i].replace(trimRe,"");if(!cache[p]){cache[p]=Ext.DomQuery.compile(p);if(!cache[p]){throw p+" is not a valid selector"}}var result=cache[p](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){return nodup(results)}return results},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);n=n[0]?n[0]:n;var 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);var 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, null, " {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, null, "{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;var m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a);var 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("|");var 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;var 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;var 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;var 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.Observable=function(){if(this.listeners){this.on(this.listeners);delete this.listeners}};Ext.util.Observable.prototype={fireEvent:function(){if(this.eventsSuspended!==true){var a=this.events[arguments[0].toLowerCase()];if(typeof a=="object"){return a.fire.apply(a,Array.prototype.slice.call(arguments,1))}}return true},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(a,c,b,g){if(typeof a=="object"){g=a;for(var f in g){if(this.filterOptRe.test(f)){continue}if(typeof g[f]=="function"){this.addListener(f,g[f],g.scope,g)}else{this.addListener(f,g[f].fn,g[f].scope,g[f])}}return}g=(!g||typeof g=="boolean")?{}:g;a=a.toLowerCase();var d=this.events[a]||true;if(typeof d=="boolean"){d=new Ext.util.Event(this,a);this.events[a]=d}d.addListener(c,b,g)},removeListener:function(a,c,b){var d=this.events[a.toLowerCase()];if(typeof d=="object"){d.removeListener(c,b)}},purgeListeners:function(){for(var a in this.events){if(typeof this.events[a]=="object"){this.events[a].clearListeners()}}},relayEvents:function(f,d){var e=function(g){return function(){return this.fireEvent.apply(this,Ext.combine(g,Array.prototype.slice.call(arguments,0)))}};for(var c=0,a=d.length;c<a;c++){var b=d[c];if(!this.events[b]){this.events[b]=true}f.on(b,e(b),this)}},addEvents:function(e){if(!this.events){this.events={}}if(typeof e=="string"){for(var d=0,b=arguments,c;c=b[d];d++){if(!this.events[b[d]]){this.events[b[d]]=true}}}else{Ext.applyIf(this.events,e)}},hasListener:function(a){var b=this.events[a];return typeof b=="object"&&b.listeners.length>0},suspendEvents:function(){this.eventsSuspended=true},resumeEvents:function(){this.eventsSuspended=false},getMethodEvent:function(h){if(!this.methodEvents){this.methodEvents={}}var g=this.methodEvents[h];if(!g){g={};this.methodEvents[h]=g;g.originalFn=this[h];g.methodName=h;g.before=[];g.after=[];var c,b,d;var f=this;var a=function(j,i,e){if((b=j.apply(i||f,e))!==undefined){if(typeof b==="object"){if(b.returnValue!==undefined){c=b.returnValue}else{c=b}if(b.cancel===true){d=true}}else{if(b===false){d=true}else{c=b}}}};this[h]=function(){c=b=undefined;d=false;var j=Array.prototype.slice.call(arguments,0);for(var k=0,e=g.before.length;k<e;k++){a(g.before[k].fn,g.before[k].scope,j);if(d){return c}}if((b=g.originalFn.apply(f,j))!==undefined){c=b}for(var k=0,e=g.after.length;k<e;k++){a(g.after[k].fn,g.after[k].scope,j);if(d){return c}}return c}}return g},beforeMethod:function(d,b,a){var c=this.getMethodEvent(d);c.before.push({fn:b,scope:a})},afterMethod:function(d,b,a){var c=this.getMethodEvent(d);c.after.push({fn:b,scope:a})},removeMethodListener:function(g,d,c){var f=this.getMethodEvent(g);for(var b=0,a=f.before.length;b<a;b++){if(f.before[b].fn==d&&f.before[b].scope==c){f.before.splice(b,1);return}}for(var b=0,a=f.after.length;b<a;b++){if(f.after[b].fn==d&&f.after[b].scope==c){f.after.splice(b,1);return}}}};Ext.util.Observable.prototype.on=Ext.util.Observable.prototype.addListener;Ext.util.Observable.prototype.un=Ext.util.Observable.prototype.removeListener;Ext.util.Observable.capture=function(c,b,a){c.fireEvent=c.fireEvent.createInterceptor(b,a)};Ext.util.Observable.releaseCapture=function(a){a.fireEvent=Ext.util.Observable.prototype.fireEvent};(function(){var b=function(f,g,e){var d=new Ext.util.DelayedTask();return function(){d.delay(g.buffer,f,e,Array.prototype.slice.call(arguments,0))}};var c=function(g,i,f,d){return function(){i.removeListener(f,d);return g.apply(d,arguments)}};var a=function(e,f,d){return function(){var g=Array.prototype.slice.call(arguments,0);setTimeout(function(){e.apply(d,g)},f.delay||10)}};Ext.util.Event=function(e,d){this.name=d;this.obj=e;this.listeners=[]};Ext.util.Event.prototype={addListener:function(g,f,e){f=f||this.obj;if(!this.isListening(g,f)){var d=this.createListener(g,f,e);if(!this.firing){this.listeners.push(d)}else{this.listeners=this.listeners.slice(0);this.listeners.push(d)}}},createListener:function(g,f,i){i=i||{};f=f||this.obj;var d={fn:g,scope:f,options:i};var e=g;if(i.delay){e=a(e,i,f)}if(i.single){e=c(e,this,g,f)}if(i.buffer){e=b(e,i,f)}d.fireFn=e;return d},findListener:function(j,h){h=h||this.obj;var f=this.listeners;for(var g=0,d=f.length;g<d;g++){var e=f[g];if(e.fn==j&&e.scope==h){return g}}return-1},isListening:function(e,d){return this.findListener(e,d)!=-1},removeListener:function(f,e){var d;if((d=this.findListener(f,e))!=-1){if(!this.firing){this.listeners.splice(d,1)}else{this.listeners=this.listeners.slice(0);this.listeners.splice(d,1)}return true}return false},clearListeners:function(){this.listeners=[]},fire:function(){var f=this.listeners,j,d=f.length;if(d>0){this.firing=true;var g=Array.prototype.slice.call(arguments,0);for(var h=0;h<d;h++){var e=f[h];if(e.fireFn.apply(e.scope||this.obj||window,arguments)===false){this.firing=false;return false}}this.firing=false}return true}}})();Ext.EventManager=function(){var v,o,k=false;var l,u,f,q;var n=Ext.lib.Event;var p=Ext.lib.Dom;var a="Ext";var h={};var m=function(B,x,A,z,y){var D=Ext.id(B);if(!h[D]){h[D]={}}var C=h[D];if(!C[x]){C[x]=[]}var w=C[x];w.push({id:D,ename:x,fn:A,wrap:z,scope:y});n.on(B,x,z);if(x=="mousewheel"&&B.addEventListener){B.addEventListener("DOMMouseScroll",z,false);n.on(window,"unload",function(){B.removeEventListener("DOMMouseScroll",z,false)})}if(x=="mousedown"&&B==document){Ext.EventManager.stoppedMouseDownEvent.addListener(z)}};var g=function(y,A,E,G){y=Ext.getDom(y);var w=Ext.id(y),F=h[w],x;if(F){var C=F[A],z;if(C){for(var B=0,D=C.length;B<D;B++){z=C[B];if(z.fn==E&&(!G||z.scope==G)){x=z.wrap;n.un(y,A,x);C.splice(B,1);break}}}}if(A=="mousewheel"&&y.addEventListener&&x){y.removeEventListener("DOMMouseScroll",x,false)}if(A=="mousedown"&&y==document&&x){Ext.EventManager.stoppedMouseDownEvent.removeListener(x)}};var d=function(A){A=Ext.getDom(A);var C=Ext.id(A),B=h[C],x;if(B){for(var z in B){if(B.hasOwnProperty(z)){x=B[z];for(var y=0,w=x.length;y<w;y++){n.un(A,z,x[y].wrap);x[y]=null}}B[z]=null}delete h[C]}};var c=function(){if(!k){k=true;Ext.isReady=true;if(o){clearInterval(o)}if(Ext.isGecko||Ext.isOpera){document.removeEventListener("DOMContentLoaded",c,false)}if(Ext.isIE){var w=document.getElementById("ie-deferred-loader");if(w){w.onreadystatechange=null;w.parentNode.removeChild(w)}}if(v){v.fire();v.clearListeners()}}};var b=function(){v=new Ext.util.Event();if(Ext.isGecko||Ext.isOpera){document.addEventListener("DOMContentLoaded",c,false)}else{if(Ext.isIE){document.write('<script id="ie-deferred-loader" defer="defer" src="//:"><\/script>');var w=document.getElementById("ie-deferred-loader");w.onreadystatechange=function(){if(this.readyState=="complete"){c()}}}else{if(Ext.isSafari){o=setInterval(function(){var x=document.readyState;if(x=="complete"){c()}},10)}}}n.on(window,"load",c)};var t=function(x,y){var w=new Ext.util.DelayedTask(x);return function(z){z=new Ext.EventObjectImpl(z);w.delay(y.buffer,x,null,[z])}};var r=function(A,z,w,y,x){return function(B){Ext.EventManager.removeListener(z,w,y,x);A(B)}};var e=function(w,x){return function(y){y=new Ext.EventObjectImpl(y);setTimeout(function(){w(y)},x.delay||10)}};var j=function(y,x,w,C,B){var D=(!w||typeof w=="boolean")?{}:w;C=C||D.fn;B=B||D.scope;var A=Ext.getDom(y);if(!A){throw'Error listening for "'+x+'". Element "'+y+"\" doesn't exist."}var z=function(F){if(!window[a]){return}F=Ext.EventObject.setEvent(F);var E;if(D.delegate){E=F.getTarget(D.delegate,A);if(!E){return}}else{E=F.target}if(D.stopEvent===true){F.stopEvent()}if(D.preventDefault===true){F.preventDefault()}if(D.stopPropagation===true){F.stopPropagation()}if(D.normalized===false){F=F.browserEvent}C.call(B||A,F,E,D)};if(D.delay){z=e(z,D)}if(D.single){z=r(z,A,x,C,B)}if(D.buffer){z=t(z,D)}m(A,x,C,z,B);return z};var i=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var s={addListener:function(y,w,A,z,x){if(typeof w=="object"){var C=w;for(var B in C){if(i.test(B)){continue}if(typeof C[B]=="function"){j(y,B,C,C[B],C.scope)}else{j(y,B,C[B])}}return}return j(y,w,x,A,z)},removeListener:function(x,w,z,y){return g(x,w,z,y)},removeAll:function(w){return d(w)},onDocumentReady:function(y,x,w){if(k){v.addListener(y,x,w);v.fire();v.clearListeners();return}if(!v){b()}w=w||{};if(!w.delay){w.delay=1}v.addListener(y,x,w)},doResizeEvent:function(){l.fire(p.getViewWidth(),p.getViewHeight())},onWindowResize:function(y,x,w){if(!l){l=new Ext.util.Event();u=new Ext.util.DelayedTask(this.doResizeEvent);n.on(window,"resize",this.fireWindowResize,this)}l.addListener(y,x,w)},fireWindowResize:function(){if(l){if((Ext.isIE||Ext.isAir)&&u){u.delay(50)}else{l.fire(p.getViewWidth(),p.getViewHeight())}}},onTextResize:function(z,y,w){if(!f){f=new Ext.util.Event();var x=new Ext.Element(document.createElement("div"));x.dom.className="x-text-resize";x.dom.innerHTML="X";x.appendTo(document.body);q=x.dom.offsetHeight;setInterval(function(){if(x.dom.offsetHeight!=q){f.fire(q,q=x.dom.offsetHeight)}},this.textResizeInterval)}f.addListener(z,y,w)},removeResizeListener:function(x,w){if(l){l.removeListener(x,w)}},fireResize:function(){if(l){l.fire(p.getViewWidth(),p.getViewHeight())}},ieDeferSrc:false,textResizeInterval:50};s.on=s.addListener;s.un=s.removeListener;s.stoppedMouseDownEvent=new Ext.util.Event();return s}();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.isSafari?"ext-safari":Ext.isChrome?"ext-chrome":""];if(Ext.isMac){b.push("ext-mac")}if(Ext.isLinux){b.push("ext-linux")}if(Ext.isBorderBox){b.push("ext-border-box")}if(Ext.isStrict){var d=c.parentNode;if(d){d.className+=" ext-strict"}}c.className+=b.join(" ");return true};if(!a()){Ext.onReady(a)}})();Ext.EventObject=function(){var b=Ext.lib.Event;var a={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var c=Ext.isIE?{1:0,4:1,2:2}:(Ext.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Ext.EventObjectImpl=function(d){if(d){this.setEvent(d.browserEvent||d)}};Ext.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,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,setEvent:function(d){if(d==this||(d&&d.browserEvent)){return d}this.browserEvent=d;if(d){this.button=d.button?c[d.button]:(d.which?d.which-1:-1);if(d.type=="click"&&this.button==-1){this.button=0}this.type=d.type;this.shiftKey=d.shiftKey;this.ctrlKey=d.ctrlKey||d.metaKey;this.altKey=d.altKey;this.keyCode=d.keyCode;this.charCode=d.charCode;this.target=b.getTarget(d);this.xy=b.getXY(d)}else{this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0]}return this},stopEvent:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}b.stopEvent(this.browserEvent)}},preventDefault:function(){if(this.browserEvent){b.preventDefault(this.browserEvent)}},isNavKeyPress:function(){var d=this.keyCode;d=Ext.isSafari?(a[d]||d):d;return(d>=33&&d<=40)||d==this.RETURN||d==this.TAB||d==this.ESC},isSpecialKey:function(){var d=this.keyCode;return(this.type=="keypress"&&this.ctrlKey)||d==9||d==13||d==40||d==27||(d==16)||(d==17)||(d>=18&&d<=20)||(d>=33&&d<=35)||(d>=36&&d<=39)||(d>=44&&d<=45)},stopPropagation:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}b.stopPropagation(this.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){var d=this.keyCode||this.charCode;return Ext.isSafari?(a[d]||d):d},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getTime:function(){if(this.browserEvent){return b.getTime(this.browserEvent)}return null},getXY:function(){return this.xy},getTarget:function(e,f,d){return e?Ext.fly(this.target).findParent(e,f,d):(d?Ext.get(this.target):this.target)},getRelatedTarget:function(){if(this.browserEvent){return b.getRelatedTarget(this.browserEvent)}return null},getWheelDelta:function(){var d=this.browserEvent;var f=0;if(d.wheelDelta){f=d.wheelDelta/120}else{if(d.detail){f=-d.detail/3}}return f},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)?true:false},within:function(f,g,d){var e=this[g?"getRelatedTarget":"getTarget"]();return e&&((d?(e===Ext.getDom(f)):false)||Ext.fly(f).contains(e))},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])}};return new Ext.EventObjectImpl()}();(function(){var D=Ext.lib.Dom;var E=Ext.lib.Event;var A=Ext.lib.Anim;var propCache={};var camelRe=/(-[a-z])/gi;var camelFn=function(m,a){return a.charAt(1).toUpperCase()};var view=document.defaultView;Ext.Element=function(element,forceNew){var dom=typeof element=="string"?document.getElementById(element):element;if(!dom){return null}var id=dom.id;if(forceNew!==true&&id&&Ext.Element.cache[id]){return Ext.Element.cache[id]}this.dom=dom;this.id=id||Ext.id(dom)};var El=Ext.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(visMode){this.visibilityMode=visMode;return this},enableDisplayMode:function(display){this.setVisibilityMode(El.DISPLAY);if(typeof display!="undefined"){this.originalDisplay=display}return this},findParent:function(simpleSelector,maxDepth,returnEl){var p=this.dom,b=document.body,depth=0,dq=Ext.DomQuery,stopEl;maxDepth=maxDepth||50;if(typeof maxDepth!="number"){stopEl=Ext.getDom(maxDepth);maxDepth=10}while(p&&p.nodeType==1&&depth<maxDepth&&p!=b&&p!=stopEl){if(dq.is(p,simpleSelector)){return returnEl?Ext.get(p):p}depth++;p=p.parentNode}return null},findParentNode:function(simpleSelector,maxDepth,returnEl){var p=Ext.fly(this.dom.parentNode,"_internal");return p?p.findParent(simpleSelector,maxDepth,returnEl):null},up:function(simpleSelector,maxDepth){return this.findParentNode(simpleSelector,maxDepth,true)},is:function(simpleSelector){return Ext.DomQuery.is(this.dom,simpleSelector)},animate:function(args,duration,onComplete,easing,animType){this.anim(args,{duration:duration,callback:onComplete,easing:easing},animType);return this},anim:function(args,opt,animType,defaultDur,defaultEase,cb){animType=animType||"run";opt=opt||{};var anim=Ext.lib.Anim[animType](this.dom,args,(opt.duration||defaultDur)||0.35,(opt.easing||defaultEase)||"easeOut",function(){Ext.callback(cb,this);Ext.callback(opt.callback,opt.scope||this,[this,opt])},this);opt.anim=anim;return anim},preanim:function(a,i){return!a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]})},clean:function(forceReclean){if(this.isCleaned&&forceReclean!==true){return this}var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}this.isCleaned=true;return this},scrollIntoView:function(container,hscroll){var c=Ext.getDom(container)||Ext.getBody().dom;var el=this.dom;var o=this.getOffsetsTo(c),l=o[0]+c.scrollLeft,t=o[1]+c.scrollTop,b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(el.offsetHeight>ch||t<ct){c.scrollTop=t}else{if(b>cb){c.scrollTop=b-ch}}c.scrollTop=c.scrollTop;if(hscroll!==false){if(el.offsetWidth>c.clientWidth||l<cl){c.scrollLeft=l}else{if(r>cr){c.scrollLeft=r-c.clientWidth}}c.scrollLeft=c.scrollLeft}return this},scrollChildIntoView:function(child,hscroll){Ext.fly(child,"_scrollChildIntoView").scrollIntoView(this,hscroll)},autoHeight:function(animate,duration,onComplete,easing){var oldHeight=this.getHeight();this.clip();this.setHeight(1);setTimeout(function(){var height=parseInt(this.dom.scrollHeight,10);if(!animate){this.setHeight(height);this.unclip();if(typeof onComplete=="function"){onComplete()}}else{this.setHeight(oldHeight);this.setHeight(height,animate,duration,function(){this.unclip();if(typeof onComplete=="function"){onComplete()}}.createDelegate(this),easing)}}.createDelegate(this),0);return this},contains:function(el){if(!el){return false}return D.isAncestor(this.dom,el.dom?el.dom:el)},isVisible:function(deep){var vis=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(deep!==true||!vis){return vis}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,"_isVisible").isVisible()){return false}p=p.parentNode}return true},select:function(selector,unique){return El.select(selector,unique,this.dom)},query:function(selector){return Ext.DomQuery.select(selector,this.dom)},child:function(selector,returnDom){var n=Ext.DomQuery.selectNode(selector,this.dom);return returnDom?n:Ext.get(n)},down:function(selector,returnDom){var n=Ext.DomQuery.selectNode(" > "+selector,this.dom);return returnDom?n:Ext.get(n)},initDD:function(group,config,overrides){var dd=new Ext.dd.DD(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},initDDProxy:function(group,config,overrides){var dd=new Ext.dd.DDProxy(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},initDDTarget:function(group,config,overrides){var dd=new Ext.dd.DDTarget(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},setVisible:function(visible,animate){if(!animate||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(visible)}else{this.fixDisplay();this.dom.style.visibility=visible?"visible":"hidden"}}else{var dom=this.dom;var visMode=this.visibilityMode;if(visible){this.setOpacity(0.01);this.setVisible(true)}this.anim({opacity:{to:(visible?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!visible){if(visMode==El.DISPLAY){dom.style.display="none"}else{dom.style.visibility="hidden"}Ext.get(dom).setOpacity(1)}})}return this},isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(animate){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this},setDisplayed:function(value){if(typeof value=="boolean"){value=value?this.originalDisplay:"none"}this.setStyle("display",value);return this},focus:function(){try{this.dom.focus()}catch(e){}return this},blur:function(){try{this.dom.blur()}catch(e){}return this},addClass:function(className){if(Ext.isArray(className)){for(var i=0,len=className.length;i<len;i++){this.addClass(className[i])}}else{if(className&&!this.hasClass(className)){this.dom.className=this.dom.className+" "+className}}return this},radioClass:function(className){var siblings=this.dom.parentNode.childNodes;for(var i=0;i<siblings.length;i++){var s=siblings[i];if(s.nodeType==1){Ext.get(s).removeClass(className)}}this.addClass(className);return this},removeClass:function(className){if(!className||!this.dom.className){return this}if(Ext.isArray(className)){for(var i=0,len=className.length;i<len;i++){this.removeClass(className[i])}}else{if(this.hasClass(className)){var re=this.classReCache[className];if(!re){re=new RegExp("(?:^|\\s+)"+className+"(?:\\s+|$)","g");this.classReCache[className]=re}this.dom.className=this.dom.className.replace(re," ")}}return this},classReCache:{},toggleClass:function(className){if(this.hasClass(className)){this.removeClass(className)}else{this.addClass(className)}return this},hasClass:function(className){return className&&(" "+this.dom.className+" ").indexOf(" "+className+" ")!=-1},replaceClass:function(oldClassName,newClassName){this.removeClass(oldClassName);this.addClass(newClassName);return this},getStyles:function(){var a=arguments,len=a.length,r={};for(var i=0;i<len;i++){r[a[i]]=this.getStyle(a[i])}return r},getStyle:function(){return view&&view.getComputedStyle?function(prop){var el=this.dom,v,cs,camel;if(prop=="float"){prop="cssFloat"}if(v=el.style[prop]){return v}if(cs=view.getComputedStyle(el,"")){if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}return cs[camel]}return null}:function(prop){var el=this.dom,v,cs,camel;if(prop=="opacity"){if(typeof el.style.filter=="string"){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0}}}return 1}else{if(prop=="float"){prop="styleFloat"}}if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}if(v=el.style[camel]){return v}if(cs=el.currentStyle){return cs[camel]}return null}}(),setStyle:function(prop,value){if(typeof prop=="string"){var camel;if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}if(camel=="opacity"){this.setOpacity(value)}else{this.dom.style[camel]=value}}else{for(var style in prop){if(typeof prop[style]!="function"){this.setStyle(style,prop[style])}}}return this},applyStyles:function(style){Ext.DomHelper.applyStyles(this.dom,style);return this},getX:function(){return D.getX(this.dom)},getY:function(){return D.getY(this.dom)},getXY:function(){return D.getXY(this.dom)},getOffsetsTo:function(el){var o=this.getXY();var e=Ext.fly(el,"_internal").getXY();return[o[0]-e[0],o[1]-e[1]]},setX:function(x,animate){if(!animate||!A){D.setX(this.dom,x)}else{this.setXY([x,this.getY()],this.preanim(arguments,1))}return this},setY:function(y,animate){if(!animate||!A){D.setY(this.dom,y)}else{this.setXY([this.getX(),y],this.preanim(arguments,1))}return this},setLeft:function(left){this.setStyle("left",this.addUnits(left));return this},setTop:function(top){this.setStyle("top",this.addUnits(top));return this},setRight:function(right){this.setStyle("right",this.addUnits(right));return this},setBottom:function(bottom){this.setStyle("bottom",this.addUnits(bottom));return this},setXY:function(pos,animate){if(!animate||!A){D.setXY(this.dom,pos)}else{this.anim({points:{to:pos}},this.preanim(arguments,1),"motion")}return this},setLocation:function(x,y,animate){this.setXY([x,y],this.preanim(arguments,2));return this},moveTo:function(x,y,animate){this.setXY([x,y],this.preanim(arguments,2));return this},getRegion:function(){return D.getRegion(this.dom)},getHeight:function(contentHeight){var h=this.dom.offsetHeight||0;h=contentHeight!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");return h<0?0:h},getWidth:function(contentWidth){var w=this.dom.offsetWidth||0;w=contentWidth!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");return w<0?0:w},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle("height"),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth("tb")}}return h},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle("width"),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth("lr")}}return w},getSize:function(contentSize){return{width:this.getWidth(contentSize),height:this.getHeight(contentSize)}},getStyleSize:function(){var w,h,d=this.dom,s=d.style;if(s.width&&s.width!="auto"){w=parseInt(s.width,10);if(Ext.isBorderBox){w-=this.getFrameWidth("lr")}}if(s.height&&s.height!="auto"){h=parseInt(s.height,10);if(Ext.isBorderBox){h-=this.getFrameWidth("tb")}}return{width:w||this.getWidth(true),height:h||this.getHeight(true)}},getViewSize:function(){var d=this.dom,doc=document,aw=0,ah=0;if(d==doc||d==doc.body){return{width:D.getViewWidth(),height:D.getViewHeight()}}else{return{width:d.clientWidth,height:d.clientHeight}}},getValue:function(asNumber){return asNumber?parseInt(this.dom.value,10):this.dom.value},adjustWidth:function(width){if(typeof width=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){width-=(this.getBorderWidth("lr")+this.getPadding("lr"))}if(width<0){width=0}}return width},adjustHeight:function(height){if(typeof height=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){height-=(this.getBorderWidth("tb")+this.getPadding("tb"))}if(height<0){height=0}}return height},setWidth:function(width,animate){width=this.adjustWidth(width);if(!animate||!A){this.dom.style.width=this.addUnits(width)}else{this.anim({width:{to:width}},this.preanim(arguments,1))}return this},setHeight:function(height,animate){height=this.adjustHeight(height);if(!animate||!A){this.dom.style.height=this.addUnits(height)}else{this.anim({height:{to:height}},this.preanim(arguments,1))}return this},setSize:function(width,height,animate){if(typeof width=="object"){height=width.height;width=width.width}width=this.adjustWidth(width);height=this.adjustHeight(height);if(!animate||!A){this.dom.style.width=this.addUnits(width);this.dom.style.height=this.addUnits(height)}else{this.anim({width:{to:width},height:{to:height}},this.preanim(arguments,2))}return this},setBounds:function(x,y,width,height,animate){if(!animate||!A){this.setSize(width,height);this.setLocation(x,y)}else{width=this.adjustWidth(width);height=this.adjustHeight(height);this.anim({points:{to:[x,y]},width:{to:width},height:{to:height}},this.preanim(arguments,4),"motion")}return this},setRegion:function(region,animate){this.setBounds(region.left,region.top,region.right-region.left,region.bottom-region.top,this.preanim(arguments,1));return this},addListener:function(eventName,fn,scope,options){Ext.EventManager.on(this.dom,eventName,fn,scope||this,options)},removeListener:function(eventName,fn,scope){Ext.EventManager.removeListener(this.dom,eventName,fn,scope||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},relayEvent:function(eventName,observable){this.on(eventName,function(e){observable.fireEvent(eventName,e)})},setOpacity:function(opacity,animate){if(!animate||!A){var s=this.dom.style;if(Ext.isIE){s.zoom=1;s.filter=(s.filter||"").replace(/alpha\([^\)]*\)/gi,"")+(opacity==1?"":" alpha(opacity="+opacity*100+")")}else{s.opacity=opacity}}else{this.anim({opacity:{to:opacity}},this.preanim(arguments,1),null,0.35,"easeIn")}return this},getLeft:function(local){if(!local){return this.getX()}else{return parseInt(this.getStyle("left"),10)||0}},getRight:function(local){if(!local){return this.getX()+this.getWidth()}else{return(this.getLeft(true)+this.getWidth())||0}},getTop:function(local){if(!local){return this.getY()}else{return parseInt(this.getStyle("top"),10)||0}},getBottom:function(local){if(!local){return this.getY()+this.getHeight()}else{return(this.getTop(true)+this.getHeight())||0}},position:function(pos,zIndex,x,y){if(!pos){if(this.getStyle("position")=="static"){this.setStyle("position","relative")}}else{this.setStyle("position",pos)}if(zIndex){this.setStyle("z-index",zIndex)}if(x!==undefined&&y!==undefined){this.setXY([x,y])}else{if(x!==undefined){this.setX(x)}else{if(y!==undefined){this.setY(y)}}}},clearPositioning:function(value){value=value||"";this.setStyle({left:value,right:value,top:value,bottom:value,"z-index":"",position:"static"});return this},getPositioning:function(){var l=this.getStyle("left");var t=this.getStyle("top");return{position:this.getStyle("position"),left:l,right:l?"":this.getStyle("right"),top:t,bottom:t?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")}},getBorderWidth:function(side){return this.addStyles(side,El.borders)},getPadding:function(side){return this.addStyles(side,El.paddings)},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right=""}if(pc.bottom=="auto"){this.dom.style.bottom=""}return this},fixDisplay:function(){if(this.getStyle("display")=="none"){this.setStyle("visibility","hidden");this.setStyle("display",this.originalDisplay);if(this.getStyle("display")=="none"){this.setStyle("display","block")}}},setOverflow:function(v){if(v=="auto"&&Ext.isMac&&Ext.isGecko2){this.dom.style.overflow="hidden";(function(){this.dom.style.overflow="auto"}).defer(1,this)}else{this.dom.style.overflow=v}},setLeftTop:function(left,top){this.dom.style.left=this.addUnits(left);this.dom.style.top=this.addUnits(top);return this},move:function(direction,distance,animate){var xy=this.getXY();direction=direction.toLowerCase();switch(direction){case"l":case"left":this.moveTo(xy[0]-distance,xy[1],this.preanim(arguments,2));break;case"r":case"right":this.moveTo(xy[0]+distance,xy[1],this.preanim(arguments,2));break;case"t":case"top":case"up":this.moveTo(xy[0],xy[1]-distance,this.preanim(arguments,2));break;case"b":case"bottom":case"down":this.moveTo(xy[0],xy[1]+distance,this.preanim(arguments,2));break}return this},clip:function(){if(!this.isClipped){this.isClipped=true;this.originalClip={o:this.getStyle("overflow"),x:this.getStyle("overflow-x"),y:this.getStyle("overflow-y")};this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden")}return this},unclip:function(){if(this.isClipped){this.isClipped=false;var o=this.originalClip;if(o.o){this.setStyle("overflow",o.o)}if(o.x){this.setStyle("overflow-x",o.x)}if(o.y){this.setStyle("overflow-y",o.y)}}return this},getAnchorXY:function(anchor,local,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;w=D.getViewWidth();h=D.getViewHeight()}else{w=this.getWidth();h=this.getHeight()}}else{w=s.width;h=s.height}var x=0,y=0,r=Math.round;switch((anchor||"tl").toLowerCase()){case"c":x=r(w*0.5);y=r(h*0.5);break;case"t":x=r(w*0.5);y=0;break;case"l":x=0;y=r(h*0.5);break;case"r":x=w;y=r(h*0.5);break;case"b":x=r(w*0.5);y=h;break;case"tl":x=0;y=0;break;case"bl":x=0;y=h;break;case"br":x=w;y=h;break;case"tr":x=w;y=0;break}if(local===true){return[x,y]}if(vp){var sc=this.getScroll();return[x+sc.left,y+sc.top]}var o=this.getXY();return[x+o[0],y+o[1]]},getAlignToXY:function(el,p,o){el=Ext.get(el);if(!el||!el.dom){throw"Element.alignToXY with an element that doesn't exist"}var d=this.dom;var c=false;var p1="",p2="";o=o||[0,0];if(!p){p="tl-bl"}else{if(p=="?"){p="tl-bl?"}else{if(p.indexOf("-")==-1){p="tl-"+p}}}p=p.toLowerCase();var m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw"Element.alignTo with an invalid alignment "+p}p1=m[1];p2=m[2];c=!!m[3];var a1=this.getAnchorXY(p1,true);var a2=el.getAnchorXY(p2,false);var x=a2[0]-a1[0]+o[0];var y=a2[1]-a1[1]+o[1];if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var p1y=p1.charAt(0),p1x=p1.charAt(p1.length-1);var p2y=p2.charAt(0),p2x=p2.charAt(p2.length-1);var swapY=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));var swapX=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));var doc=document;var scrollX=(doc.documentElement.scrollLeft||doc.body.scrollLeft||0)+5;var scrollY=(doc.documentElement.scrollTop||doc.body.scrollTop||0)+5;if((x+w)>dw+scrollX){x=swapX?r.left-w:dw+scrollX-w}if(x<scrollX){x=swapX?r.right:scrollX}if((y+h)>dh+scrollY){y=swapY?r.top-h:dh+scrollY-h}if(y<scrollY){y=swapY?r.bottom:scrollY}}return[x,y]},getConstrainToXY:function(){var os={top:0,left:0,bottom:0,right:0};return function(el,local,offsets,proposedXY){el=Ext.get(el);offsets=offsets?Ext.applyIf(offsets,os):os;var vw,vh,vx=0,vy=0;if(el.dom==document.body||el.dom==document){vw=Ext.lib.Dom.getViewWidth();vh=Ext.lib.Dom.getViewHeight()}else{vw=el.dom.clientWidth;vh=el.dom.clientHeight;if(!local){var vxy=el.getXY();vx=vxy[0];vy=vxy[1]}}var s=el.getScroll();vx+=offsets.left+s.left;vy+=offsets.top+s.top;vw-=offsets.right;vh-=offsets.bottom;var vr=vx+vw;var vb=vy+vh;var xy=proposedXY||(!local?this.getXY():[this.getLeft(true),this.getTop(true)]);var x=xy[0],y=xy[1];var w=this.dom.offsetWidth,h=this.dom.offsetHeight;var moved=false;if((x+w)>vr){x=vr-w;moved=true}if((y+h)>vb){y=vb-h;moved=true}if(x<vx){x=vx;moved=true}if(y<vy){y=vy;moved=true}return moved?[x,y]:false}}(),adjustForConstraints:function(xy,parent,offsets){return this.getConstrainToXY(parent||document,false,offsets,xy)||xy},alignTo:function(element,position,offsets,animate){var xy=this.getAlignToXY(element,position,offsets);this.setXY(xy,this.preanim(arguments,3));return this},anchorTo:function(el,alignment,offsets,animate,monitorScroll,callback){var action=function(){this.alignTo(el,alignment,offsets,animate);Ext.callback(callback,this)};Ext.EventManager.onWindowResize(action,this);var tm=typeof monitorScroll;if(tm!="undefined"){Ext.EventManager.on(window,"scroll",action,this,{buffer:tm=="number"?monitorScroll:50})}action.call(this);return this},clearOpacity:function(){if(window.ActiveXObject){if(typeof this.dom.style.filter=="string"&&(/alpha/i).test(this.dom.style.filter)){this.dom.style.filter=""}}else{this.dom.style.opacity="";this.dom.style["-moz-opacity"]="";this.dom.style["-khtml-opacity"]=""}return this},hide:function(animate){this.setVisible(false,this.preanim(arguments,0));return this},show:function(animate){this.setVisible(true,this.preanim(arguments,0));return this},addUnits:function(size){return Ext.Element.addUnits(size,this.defaultUnit)},update:function(html,loadScripts,callback){if(typeof html=="undefined"){html=""}if(loadScripts!==true){this.dom.innerHTML=html;if(typeof callback=="function"){callback()}return this}var id=Ext.id();var dom=this.dom;html+='<span id="'+id+'"></span>';E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var srcRe=/\ssrc=([\'\"])(.*?)\1/i;var typeRe=/\stype=([\'\"])(.*?)\1/i;var match;while(match=re.exec(html)){var attrs=match[1];var srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){var s=document.createElement("script");s.src=srcMatch[2];var 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])}}}}var el=document.getElementById(id);if(el){Ext.removeNode(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},load:function(){var um=this.getUpdater();um.update.apply(um,arguments);return this},getUpdater:function(){if(!this.updateManager){this.updateManager=new Ext.Updater(this)}return this.updateManager},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(centerIn){this.alignTo(centerIn||document,"c-c");return this},isBorderBox:function(){return noBoxAdjust[this.dom.tagName.toLowerCase()]||Ext.isBorderBox},getBox:function(contentBox,local){var xy;if(!local){xy=this.getXY()}else{var left=parseInt(this.getStyle("left"),10)||0;var top=parseInt(this.getStyle("top"),10)||0;xy=[left,top]}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!contentBox){bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h}}else{var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)}}bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx},getFrameWidth:function(sides,onlyContentBox){return onlyContentBox&&Ext.isBorderBox?0:(this.getPadding(sides)+this.getBorderWidth(sides))},setBox:function(box,adjust,animate){var w=box.width,h=box.height;if((adjust&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));h-=(this.getBorderWidth("tb")+this.getPadding("tb"))}this.setBounds(box.x,box.y,w,h,this.preanim(arguments,2));return this},repaint:function(){var dom=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.get(dom).removeClass("x-repaint")},1);return this},getMargins:function(side){if(!side){return{top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0}}else{return this.addStyles(side,El.margins)}},addStyles:function(sides,styles){var val=0,v,w;for(var i=0,len=sides.length;i<len;i++){v=this.getStyle(styles[sides.charAt(i)]);if(v){w=parseInt(v,10);if(w){val+=(w>=0?w:-1*w)}}}return val},createProxy:function(config,renderTo,matchBox){config=typeof config=="object"?config:{tag:"div",cls:config};var proxy;if(renderTo){proxy=Ext.DomHelper.append(renderTo,config,true)}else{proxy=Ext.DomHelper.insertBefore(this.dom,config,true)}if(matchBox){proxy.setBox(this.getBox())}return proxy},mask:function(msg,msgCls){if(this.getStyle("position")=="static"){this.addClass("x-masked-relative")}if(this._maskMsg){this._maskMsg.remove()}if(this._mask){this._mask.remove()}this._mask=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask"},true);this.addClass("x-masked");this._mask.setDisplayed(true);if(typeof msg=="string"){this._maskMsg=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask-msg",cn:{tag:"div"}},true);var mm=this._maskMsg;mm.dom.className=msgCls?"ext-el-mask-msg "+msgCls:"ext-el-mask-msg";mm.dom.firstChild.innerHTML=msg;mm.setDisplayed(true);mm.center(this)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle("height")=="auto"){this._mask.setSize(this.getWidth(),this.getHeight())}return this._mask},unmask:function(){if(this._mask){if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg}this._mask.remove();delete this._mask}this.removeClass(["x-masked","x-masked-relative"])},isMasked:function(){return this._mask&&this._mask.isVisible()},createShim:function(){var el=document.createElement("iframe");el.frameBorder="0";el.className="ext-shim";if(Ext.isIE&&Ext.isSecure){el.src=Ext.SSL_SECURE_URL}var shim=Ext.get(this.dom.parentNode.insertBefore(el,this.dom));shim.autoBoxAdjust=false;return shim},remove:function(){Ext.removeNode(this.dom);delete El.cache[this.dom.id]},hover:function(overFn,outFn,scope){var preOverFn=function(e){if(!e.within(this,true)){overFn.apply(scope||this,arguments)}};var preOutFn=function(e){if(!e.within(this,true)){outFn.apply(scope||this,arguments)}};this.on("mouseover",preOverFn,this.dom);this.on("mouseout",preOutFn,this.dom);return this},addClassOnOver:function(className){this.hover(function(){Ext.fly(this,"_internal").addClass(className)},function(){Ext.fly(this,"_internal").removeClass(className)});return this},addClassOnFocus:function(className){this.on("focus",function(){Ext.fly(this,"_internal").addClass(className)},this.dom);this.on("blur",function(){Ext.fly(this,"_internal").removeClass(className)},this.dom);return this},addClassOnClick:function(className){var dom=this.dom;this.on("mousedown",function(){Ext.fly(dom,"_internal").addClass(className);var d=Ext.getDoc();var fn=function(){Ext.fly(dom,"_internal").removeClass(className);d.removeListener("mouseup",fn)};d.on("mouseup",fn)});return this},swallowEvent:function(eventName,preventDefault){var fn=function(e){e.stopPropagation();if(preventDefault){e.preventDefault()}};if(Ext.isArray(eventName)){for(var i=0,len=eventName.length;i<len;i++){this.on(eventName[i],fn)}return this}this.on(eventName,fn);return this},parent:function(selector,returnDom){return this.matchNode("parentNode","parentNode",selector,returnDom)},next:function(selector,returnDom){return this.matchNode("nextSibling","nextSibling",selector,returnDom)},prev:function(selector,returnDom){return this.matchNode("previousSibling","previousSibling",selector,returnDom)},first:function(selector,returnDom){return this.matchNode("nextSibling","firstChild",selector,returnDom)},last:function(selector,returnDom){return this.matchNode("previousSibling","lastChild",selector,returnDom)},matchNode:function(dir,start,selector,returnDom){var n=this.dom[start];while(n){if(n.nodeType==1&&(!selector||Ext.DomQuery.is(n,selector))){return!returnDom?Ext.get(n):n}n=n[dir]}return null},appendChild:function(el){el=Ext.get(el);el.appendTo(this);return this},createChild:function(config,insertBefore,returnDom){config=config||{tag:"div"};if(insertBefore){return Ext.DomHelper.insertBefore(insertBefore,config,returnDom!==true)}return Ext.DomHelper[!this.dom.firstChild?"overwrite":"append"](this.dom,config,returnDom!==true)},appendTo:function(el){el=Ext.getDom(el);el.appendChild(this.dom);return this},insertBefore:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el);return this},insertAfter:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this},insertFirst:function(el,returnDom){el=el||{};if(typeof el=="object"&&!el.nodeType&&!el.dom){return this.createChild(el,this.dom.firstChild,returnDom)}else{el=Ext.getDom(el);this.dom.insertBefore(el,this.dom.firstChild);return!returnDom?Ext.get(el):el}},insertSibling:function(el,where,returnDom){var rt;if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){rt=this.insertSibling(el[i],where,returnDom)}return rt}where=where?where.toLowerCase():"before";el=el||{};var refNode=where=="before"?this.dom:this.dom.nextSibling;if(typeof el=="object"&&!el.nodeType&&!el.dom){if(where=="after"&&!this.dom.nextSibling){rt=Ext.DomHelper.append(this.dom.parentNode,el,!returnDom)}else{rt=Ext.DomHelper[where=="after"?"insertAfter":"insertBefore"](this.dom,el,!returnDom)}}else{rt=this.dom.parentNode.insertBefore(Ext.getDom(el),refNode);if(!returnDom){rt=Ext.get(rt)}}return rt},wrap:function(config,returnDom){if(!config){config={tag:"div"}}var newEl=Ext.DomHelper.insertBefore(this.dom,config,!returnDom);newEl.dom?newEl.dom.appendChild(this.dom):newEl.appendChild(this.dom);return newEl},replace:function(el){el=Ext.get(el);this.insertBefore(el);el.remove();return this},replaceWith:function(el){if(typeof el=="object"&&!el.nodeType&&!el.dom){el=this.insertSibling(el,"before")}else{el=Ext.getDom(el);this.dom.parentNode.insertBefore(el,this.dom)}El.uncache(this.id);Ext.removeNode(this.dom);this.dom=el;this.id=Ext.id(el);El.cache[this.id]=this;return this},insertHtml:function(where,html,returnEl){var el=Ext.DomHelper.insertHtml(where,this.dom,html);return returnEl?Ext.get(el):el},set:function(o,useSet){var el=this.dom;useSet=typeof useSet=="undefined"?(el.setAttribute?true:false):useSet;for(var attr in o){if(attr=="style"||typeof o[attr]=="function"){continue}if(attr=="cls"){el.className=o.cls}else{if(o.hasOwnProperty(attr)){if(useSet){el.setAttribute(attr,o[attr])}else{el[attr]=o[attr]}}}}if(o.style){Ext.DomHelper.applyStyles(el,o.style)}return this},addKeyListener:function(key,fn,scope){var config;if(typeof key!="object"||Ext.isArray(key)){config={key:key,fn:fn,scope:scope}}else{config={key:key.key,shift:key.shift,ctrl:key.ctrl,alt:key.alt,fn:fn,scope:scope}}return new Ext.KeyMap(this,config)},addKeyMap:function(config){return new Ext.KeyMap(this,config)},isScrollable:function(){var dom=this.dom;return dom.scrollHeight>dom.clientHeight||dom.scrollWidth>dom.clientWidth},scrollTo:function(side,value,animate){var prop=side.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!animate||!A){this.dom[prop]=value}else{var to=prop=="scrollLeft"?[value,this.dom.scrollTop]:[this.dom.scrollLeft,value];this.anim({scroll:{to:to}},this.preanim(arguments,2),"scroll")}return this},scroll:function(direction,distance,animate){if(!this.isScrollable()){return}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;direction=direction.toLowerCase();var scrolled=false;var a=this.preanim(arguments,2);switch(direction){case"l":case"left":if(w-l>cw){var v=Math.min(l+distance,w-cw);this.scrollTo("left",v,a);scrolled=true}break;case"r":case"right":if(l>0){var v=Math.max(l-distance,0);this.scrollTo("left",v,a);scrolled=true}break;case"t":case"top":case"up":if(t>0){var v=Math.max(t-distance,0);this.scrollTo("top",v,a);scrolled=true}break;case"b":case"bottom":case"down":if(h-t>ch){var v=Math.min(t+distance,h-ch);this.scrollTo("top",v,a);scrolled=true}break}return scrolled},translatePoints:function(x,y){if(typeof x=="object"||Ext.isArray(x)){y=x[1];x=x[0]}var p=this.getStyle("position");var o=this.getXY();var l=parseInt(this.getStyle("left"),10);var t=parseInt(this.getStyle("top"),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop}return{left:(x-o[0]+l),top:(y-o[1]+t)}},getScroll:function(){var d=this.dom,doc=document;if(d==doc||d==doc.body){var l,t;if(Ext.isIE&&Ext.isStrict){l=doc.documentElement.scrollLeft||(doc.body.scrollLeft||0);t=doc.documentElement.scrollTop||(doc.body.scrollTop||0)}else{l=window.pageXOffset||(doc.body.scrollLeft||0);t=window.pageYOffset||(doc.body.scrollTop||0)}return{left:l,top:t}}else{return{left:d.scrollLeft,top:d.scrollTop}}},getColor:function(attr,defaultValue,prefix){var v=this.getStyle(attr);if(!v||v=="transparent"||v=="inherit"){return defaultValue}var color=typeof prefix=="undefined"?"#":prefix;if(v.substr(0,4)=="rgb("){var rvs=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(rvs[i]);var s=h.toString(16);if(h<16){s="0"+s}color+=s}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);color+=c+c}}else{if(v.length==7){color+=v.substr(1)}}}}return(color.length>5?color.toLowerCase():defaultValue)},boxWrap:function(cls){cls=cls||"x-box";var el=Ext.get(this.insertHtml("beforeBegin",String.format('<div class="{0}">'+El.boxMarkup+"</div>",cls)));el.child("."+cls+"-mc").dom.appendChild(this.dom);return el},getAttributeNS:Ext.isIE?function(ns,name){var d=this.dom;var type=typeof d[ns+":"+name];if(type!="undefined"&&type!="unknown"){return d[ns+":"+name]}return d[name]}:function(ns,name){var d=this.dom;return d.getAttributeNS(ns,name)||d.getAttribute(ns+":"+name)||d.getAttribute(name)||d[name]},getTextWidth:function(text,min,max){return(Ext.util.TextMetrics.measure(this.dom,Ext.value(text,this.dom.innerHTML,true)).width).constrain(min||0,max||1000000)}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.getUpdateManager=ep.getUpdater;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.addUnits=function(v,defaultUnit){if(v===""||v=="auto"){return v}if(v===undefined){return""}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(defaultUnit||"px")}return v};El.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>';El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};El.cache={};var docEl;El.get=function(el){var ex,elm,id;if(!el){return null}if(typeof el=="string"){if(!(elm=document.getElementById(el))){return null}if(ex=El.cache[el]){ex.dom=elm}else{ex=El.cache[el]=new El(elm)}return ex}else{if(el.tagName){if(!(id=el.id)){id=Ext.id(el)}if(ex=El.cache[id]){ex.dom=el}else{ex=El.cache[id]=new El(el)}return ex}else{if(el instanceof El){if(el!=docEl){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el}return el}else{if(el.isComposite){return el}else{if(Ext.isArray(el)){return El.select(el)}else{if(el==document){if(!docEl){var f=function(){};f.prototype=El.prototype;docEl=new f();docEl.dom=document}return docEl}}}}}}return null};El.uncache=function(el){for(var i=0,a=arguments,len=a.length;i<len;i++){if(a[i]){delete El.cache[a[i].id||a[i]]}}};El.garbageCollect=function(){if(!Ext.enableGarbageCollector){clearInterval(El.collectorThread);return}for(var eid in El.cache){var el=El.cache[eid],d=el.dom;if(!d||!d.parentNode||(!d.offsetParent&&!document.getElementById(eid))){delete El.cache[eid];if(d&&Ext.enableListenerCollection){Ext.EventManager.removeAll(d)}}}};El.collectorThreadId=setInterval(El.garbageCollect,30000);var flyFn=function(){};flyFn.prototype=El.prototype;var _cls=new flyFn();El.Flyweight=function(dom){this.dom=dom};El.Flyweight.prototype=_cls;El.Flyweight.prototype.isFlyweight=true;El._flyweights={};El.fly=function(el,named){named=named||"_global";el=Ext.getDom(el);if(!el){return null}if(!El._flyweights[named]){El._flyweights[named]=new El.Flyweight()}El._flyweights[named].dom=el;return El._flyweights[named]};Ext.get=El.get;Ext.fly=El.fly;var noBoxAdjust=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){noBoxAdjust.button=1}Ext.EventManager.on(window,"unload",function(){delete El.cache;delete El._flyweights})})();Ext.enableFx=true;Ext.Fx={slideIn:function(a,c){var b=this.getFxEl();c=c||{};b.queueFx(c,function(){a=a||"t";this.fixDisplay();var d=this.getFxRestore();var i=this.getBox();this.setSize(i);var f=this.fxWrap(d.pos,c,"hidden");var k=this.dom.style;k.visibility="visible";k.position="absolute";var e=function(){b.fxUnwrap(f,d.pos,c);k.width=d.width;k.height=d.height;b.afterFx(c)};var j,l={to:[i.x,i.y]},h={to:i.width},g={to:i.height};switch(a.toLowerCase()){case"t":f.setSize(i.width,0);k.left=k.bottom="0";j={height:g};break;case"l":f.setSize(0,i.height);k.right=k.top="0";j={width:h};break;case"r":f.setSize(0,i.height);f.setX(i.right);k.left=k.top="0";j={width:h,points:l};break;case"b":f.setSize(i.width,0);f.setY(i.bottom);k.left=k.top="0";j={height:g,points:l};break;case"tl":f.setSize(0,0);k.right=k.bottom="0";j={width:h,height:g};break;case"bl":f.setSize(0,0);f.setY(i.y+i.height);k.right=k.top="0";j={width:h,height:g,points:l};break;case"br":f.setSize(0,0);f.setXY([i.right,i.bottom]);k.left=k.top="0";j={width:h,height:g,points:l};break;case"tr":f.setSize(0,0);f.setX(i.x+i.width);k.left=k.bottom="0";j={width:h,height:g,points:l};break}this.dom.style.visibility="visible";f.show();arguments.callee.anim=f.fxanim(j,c,"motion",0.5,"easeOut",e)});return this},slideOut:function(a,c){var b=this.getFxEl();c=c||{};b.queueFx(c,function(){a=a||"t";var i=this.getFxRestore();var d=this.getBox();this.setSize(d);var g=this.fxWrap(i.pos,c,"visible");var f=this.dom.style;f.visibility="visible";f.position="absolute";g.setSize(d);var j=function(){if(c.useDisplay){b.setDisplayed(false)}else{b.hide()}b.fxUnwrap(g,i.pos,c);f.width=i.width;f.height=i.height;b.afterFx(c)};var e,h={to:0};switch(a.toLowerCase()){case"t":f.left=f.bottom="0";e={height:h};break;case"l":f.right=f.top="0";e={width:h};break;case"r":f.left=f.top="0";e={width:h,points:{to:[d.right,d.y]}};break;case"b":f.left=f.top="0";e={height:h,points:{to:[d.x,d.bottom]}};break;case"tl":f.right=f.bottom="0";e={width:h,height:h};break;case"bl":f.right=f.top="0";e={width:h,height:h,points:{to:[d.x,d.bottom]}};break;case"br":f.left=f.top="0";e={width:h,height:h,points:{to:[d.x+d.width,d.bottom]}};break;case"tr":f.left=f.bottom="0";e={width:h,height:h,points:{to:[d.right,d.y]}};break}arguments.callee.anim=g.fxanim(e,c,"motion",0.5,"easeOut",j)});return this},puff:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){this.clearOpacity();this.show();var f=this.getFxRestore();var d=this.dom.style;var g=function(){if(b.useDisplay){a.setDisplayed(false)}else{a.hide()}a.clearOpacity();a.setPositioning(f.pos);d.width=f.width;d.height=f.height;d.fontSize="";a.afterFx(b)};var e=this.getWidth();var c=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(e*2)},height:{to:this.adjustHeight(c*2)},points:{by:[-(e*0.5),-(c*0.5)]},opacity:{to:0},fontSize:{to:200,unit:"%"}},b,"motion",0.5,"easeOut",g)});return this},switchOff:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){this.clearOpacity();this.clip();var d=this.getFxRestore();var c=this.dom.style;var e=function(){if(b.useDisplay){a.setDisplayed(false)}else{a.hide()}a.clearOpacity();a.setPositioning(d.pos);c.width=d.width;c.height=d.height;a.afterFx(b)};this.fxanim({opacity:{to:0.3}},null,null,0.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*0.5]}},b,"motion",0.3,"easeIn",e)}).defer(100,this)})});return this},highlight:function(a,c){var b=this.getFxEl();c=c||{};b.queueFx(c,function(){a=a||"ffff9c";var d=c.attr||"backgroundColor";this.clearOpacity();this.show();var g=this.getColor(d);var h=this.dom.style[d];var f=(c.endColor||g)||"ffffff";var i=function(){b.dom.style[d]=h;b.afterFx(c)};var e={};e[d]={from:a,to:f};arguments.callee.anim=this.fxanim(e,c,"color",1,"easeIn",i)});return this},frame:function(a,c,d){var b=this.getFxEl();d=d||{};b.queueFx(d,function(){a=a||"#C3DAF9";if(a.length==6){a="#"+a}c=c||1;var g=d.duration||1;this.show();var e=this.getBox();var f=function(){var h=Ext.getBody().createChild({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+a}});var i=Ext.isBorderBox?2:1;h.animate({top:{from:e.y,to:e.y-20},left:{from:e.x,to:e.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:e.height,to:(e.height+(20*i))},width:{from:e.width,to:(e.width+(20*i))}},g,function(){h.remove();if(--c>0){f()}else{b.afterFx(d)}})};f.call(this)});return this},pause:function(c){var a=this.getFxEl();var b={};a.queueFx(b,function(){setTimeout(function(){a.afterFx(b)},c*1000)});return this},fadeIn:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility="visible";var c=b.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:c}},b,null,0.5,"easeOut",function(){if(c==1){this.clearOpacity()}a.afterFx(b)})});return this},fadeOut:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){var c=b.endOpacity||0;arguments.callee.anim=this.fxanim({opacity:{to:c}},b,null,0.5,"easeOut",function(){if(c===0){if(this.visibilityMode==Ext.Element.DISPLAY||b.useDisplay){this.dom.style.display="none"}else{this.dom.style.visibility="hidden"}this.clearOpacity()}a.afterFx(b)})});return this},scale:function(a,b,c){this.shift(Ext.apply({},c,{width:a,height:b}));return this},shift:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){var e={},d=b.width,f=b.height,c=b.x,i=b.y,g=b.opacity;if(d!==undefined){e.width={to:this.adjustWidth(d)}}if(f!==undefined){e.height={to:this.adjustHeight(f)}}if(b.left!==undefined){e.left={to:b.left}}if(b.top!==undefined){e.top={to:b.top}}if(b.right!==undefined){e.right={to:b.right}}if(b.bottom!==undefined){e.bottom={to:b.bottom}}if(c!==undefined||i!==undefined){e.points={to:[c!==undefined?c:this.getX(),i!==undefined?i:this.getY()]}}if(g!==undefined){e.opacity={to:g}}if(b.xy!==undefined){e.points={to:b.xy}}arguments.callee.anim=this.fxanim(e,b,"motion",0.35,"easeOut",function(){a.afterFx(b)})});return this},ghost:function(a,c){var b=this.getFxEl();c=c||{};b.queueFx(c,function(){a=a||"b";var i=this.getFxRestore();var e=this.getWidth(),g=this.getHeight();var f=this.dom.style;var k=function(){if(c.useDisplay){b.setDisplayed(false)}else{b.hide()}b.clearOpacity();b.setPositioning(i.pos);f.width=i.width;f.height=i.height;b.afterFx(c)};var d={opacity:{to:0},points:{}},j=d.points;switch(a.toLowerCase()){case"t":j.by=[0,-g];break;case"l":j.by=[-e,0];break;case"r":j.by=[e,0];break;case"b":j.by=[0,g];break;case"tl":j.by=[-e,-g];break;case"bl":j.by=[-e,g];break;case"br":j.by=[e,g];break;case"tr":j.by=[e,-g];break}arguments.callee.anim=this.fxanim(d,c,"motion",0.5,"easeOut",k)});return this},syncFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this},sequenceFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:false,stopFx:false});return this},nextFx:function(){var a=this.fxQueue[0];if(a){a.call(this)}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0]},stopFx:function(){if(this.hasActiveFx()){var a=this.fxQueue[0];if(a&&a.anim&&a.anim.isAnimated()){this.fxQueue=[a];a.anim.stop(true)}}return this},beforeFx:function(a){if(this.hasActiveFx()&&!a.concurrent){if(a.stopFx){this.stopFx();return true}return false}return true},hasFxBlock:function(){var a=this.fxQueue;return a&&a[0]&&a[0].block},queueFx:function(c,a){if(!this.fxQueue){this.fxQueue=[]}if(!this.hasFxBlock()){Ext.applyIf(c,this.fxDefaults);if(!c.concurrent){var b=this.beforeFx(c);a.block=c.block;this.fxQueue.push(a);if(b){this.nextFx()}}else{a.call(this)}}return this},fxWrap:function(f,d,c){var b;if(!d.wrap||!(b=Ext.get(d.wrap))){var a;if(d.fixPosition){a=this.getXY()}var e=document.createElement("div");e.style.visibility=c;b=Ext.get(this.dom.parentNode.insertBefore(e,this.dom));b.setPositioning(f);if(b.getStyle("position")=="static"){b.position("relative")}this.clearPositioning("auto");b.clip();b.dom.appendChild(this.dom);if(a){b.setXY(a)}}return b},fxUnwrap:function(a,c,b){this.clearPositioning();this.setPositioning(c);if(!b.wrap){a.dom.parentNode.insertBefore(this.dom,a.dom);a.remove()}},getFxRestore:function(){var a=this.dom.style;return{pos:this.getPositioning(),width:a.width,height:a.height}},afterFx:function(a){if(a.afterStyle){this.applyStyles(a.afterStyle)}if(a.afterCls){this.addClass(a.afterCls)}if(a.remove===true){this.remove()}Ext.callback(a.callback,a.scope,[this]);if(!a.concurrent){this.fxQueue.shift();this.nextFx()}},getFxEl:function(){return Ext.get(this.dom)},fxanim:function(d,e,b,f,c,a){b=b||"run";e=e||{};var g=Ext.lib.Anim[b](this.dom,d,(e.duration||f)||0.35,(e.easing||c)||"easeOut",function(){Ext.callback(a,this)},this);e.anim=g;return g}};Ext.Fx.resize=Ext.Fx.scale;Ext.apply(Ext.Element.prototype,Ext.Fx);Ext.CompositeElement=function(a){this.elements=[];this.addElements(a)};Ext.CompositeElement.prototype={isComposite:true,addElements:function(e){if(!e){return this}if(typeof e=="string"){e=Ext.Element.selectorFunction(e)}var d=this.elements;var b=d.length-1;for(var c=0,a=e.length;c<a;c++){d[++b]=Ext.get(e[c])}return this},fill:function(a){this.elements=[];this.add(a);return this},filter:function(a){var b=[];this.each(function(c){if(c.is(a)){b[b.length]=c.dom}});this.fill(b);return this},invoke:function(e,b){var d=this.elements;for(var c=0,a=d.length;c<a;c++){Ext.Element.prototype[e].apply(d[c],b)}return this},add:function(a){if(typeof a=="string"){this.addElements(Ext.Element.selectorFunction(a))}else{if(a.length!==undefined){this.addElements(a)}else{this.addElements([a])}}return this},each:function(e,d){var c=this.elements;for(var b=0,a=c.length;b<a;b++){if(e.call(d||c[b],c[b],this,b)===false){break}}return this},item:function(a){return this.elements[a]||null},first:function(){return this.item(0)},last:function(){return this.item(this.elements.length-1)},getCount:function(){return this.elements.length},contains:function(a){return this.indexOf(a)!==-1},indexOf:function(a){return this.elements.indexOf(Ext.get(a))},removeElement:function(e,g){if(Ext.isArray(e)){for(var c=0,a=e.length;c<a;c++){this.removeElement(e[c])}return this}var b=typeof e=="number"?e:this.indexOf(e);if(b!==-1&&this.elements[b]){if(g){var f=this.elements[b];if(f.dom){f.remove()}else{Ext.removeNode(f)}}this.elements.splice(b,1)}return this},replaceElement:function(d,c,a){var b=typeof d=="number"?d:this.indexOf(d);if(b!==-1){if(a){this.elements[b].replaceWith(c)}else{this.elements.splice(b,1,Ext.get(c))}}return this},clear:function(){this.elements=[]}};(function(){Ext.CompositeElement.createCall=function(b,c){if(!b[c]){b[c]=function(){return this.invoke(c,arguments)}}};for(var a in Ext.Element.prototype){if(typeof Ext.Element.prototype[a]=="function"){Ext.CompositeElement.createCall(Ext.CompositeElement.prototype,a)}}})();Ext.CompositeElementLite=function(a){Ext.CompositeElementLite.superclass.constructor.call(this,a);this.el=new Ext.Element.Flyweight()};Ext.extend(Ext.CompositeElementLite,Ext.CompositeElement,{addElements:function(e){if(e){if(Ext.isArray(e)){this.elements=this.elements.concat(e)}else{var d=this.elements;var b=d.length-1;for(var c=0,a=e.length;c<a;c++){d[++b]=e[c]}}}return this},invoke:function(f,b){var d=this.elements;var e=this.el;for(var c=0,a=d.length;c<a;c++){e.dom=d[c];Ext.Element.prototype[f].apply(e,b)}return this},item:function(a){if(!this.elements[a]){return null}this.el.dom=this.elements[a];return this.el},addListener:function(b,g,f,e){var d=this.elements;for(var c=0,a=d.length;c<a;c++){Ext.EventManager.on(d[c],b,g,f||d[c],e)}return this},each:function(f,e){var c=this.elements;var d=this.el;for(var b=0,a=c.length;b<a;b++){d.dom=c[b];if(f.call(e||d,d,this,b)===false){break}}return this},indexOf:function(a){return this.elements.indexOf(Ext.getDom(a))},replaceElement:function(e,c,a){var b=typeof e=="number"?e:this.indexOf(e);if(b!==-1){c=Ext.getDom(c);if(a){var f=this.elements[b];f.parentNode.insertBefore(c,f);Ext.removeNode(f)}this.elements.splice(b,1,c)}return this}});Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}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"}}if(d===true){return new Ext.CompositeElement(c)}else{return new Ext.CompositeElementLite(c)}};Ext.select=Ext.Element.select;Ext.Updater=Ext.extend(Ext.util.Observable,{constructor:function(b,a){b=Ext.get(b);if(!a&&b.updateManager){return b.updateManager}this.el=b;this.defaultUrl=null;this.addEvents("beforeupdate","update","failure");var c=Ext.Updater.defaults;this.sslBlankUrl=c.sslBlankUrl;this.disableCaching=c.disableCaching;this.indicatorText=c.indicatorText;this.showLoadIndicator=c.showLoadIndicator;this.timeout=c.timeout;this.loadScripts=c.loadScripts;this.transaction=null;this.refreshDelegate=this.refresh.createDelegate(this);this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=this.formUpdate.createDelegate(this);if(!this.renderer){this.renderer=this.getDefaultRenderer()}Ext.Updater.superclass.constructor.call(this)},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},getEl:function(){return this.el},update:function(b,f,g,d){if(this.fireEvent("beforeupdate",this.el,b,f)!==false){var a,c;if(typeof b=="object"){a=b;b=a.url;f=f||a.params;g=g||a.callback;d=d||a.discardUrl;c=a.scope;if(typeof a.nocache!="undefined"){this.disableCaching=a.nocache}if(typeof a.text!="undefined"){this.indicatorText='<div class="loading-indicator">'+a.text+"</div>"}if(typeof a.scripts!="undefined"){this.loadScripts=a.scripts}if(typeof a.timeout!="undefined"){this.timeout=a.timeout}}this.showLoading();if(!d){this.defaultUrl=b}if(typeof b=="function"){b=b.call(this)}var e=Ext.apply({},{url:b,params:(typeof f=="function"&&c)?f.createDelegate(c):f,success:this.processSuccess,failure:this.processFailure,scope:this,callback:undefined,timeout:(this.timeout*1000),disableCaching:this.disableCaching,argument:{options:a,url:b,form:null,callback:g,scope:c||window,params:f}},a);this.transaction=Ext.Ajax.request(e)}},formUpdate:function(c,a,b,d){if(this.fireEvent("beforeupdate",this.el,c,a)!==false){if(typeof a=="function"){a=a.call(this)}c=Ext.getDom(c);this.transaction=Ext.Ajax.request({form:c,url:a,success:this.processSuccess,failure:this.processFailure,scope:this,timeout:(this.timeout*1000),argument:{url:a,form:c,callback:d,reset:b}});this.showLoading.defer(1,this)}},refresh:function(a){if(this.defaultUrl==null){return}this.update(this.defaultUrl,null,a,true)},startAutoRefresh:function(b,c,d,e,a){if(a){this.update(c||this.defaultUrl,d,e,true)}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId)}this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[c||this.defaultUrl,d,e,true]),b*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false},showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText)}},processSuccess:function(a){this.transaction=null;if(a.argument.form&&a.argument.reset){try{a.argument.form.reset()}catch(b){}}if(this.loadScripts){this.renderer.render(this.el,a,this,this.updateComplete.createDelegate(this,[a]))}else{this.renderer.render(this.el,a,this);this.updateComplete(a)}},updateComplete:function(a){this.fireEvent("update",this.el,a);if(typeof a.argument.callback=="function"){a.argument.callback.call(a.argument.scope,this.el,true,a,a.argument.options)}},processFailure:function(a){this.transaction=null;this.fireEvent("failure",this.el,a);if(typeof a.argument.callback=="function"){a.argument.callback.call(a.argument.scope,this.el,false,a,a.argument.options)}},setRenderer:function(a){this.renderer=a},getRenderer:function(){return this.renderer},setDefaultUrl:function(a){this.defaultUrl=a},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){if(this.transaction){return Ext.Ajax.isLoading(this.transaction)}return false}});Ext.Updater.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Ext.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:'<div class="loading-indicator">Loading...</div>'};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)}};Ext.UpdateManager=Ext.Updater;Ext.util.DelayedTask=function(f,e,a){var h=null,g,b;var c=function(){var d=new Date().getTime();if(d-b>=g){clearInterval(h);h=null;f.apply(e,a||[])}};this.delay=function(i,k,j,d){if(h&&i!=g){this.cancel()}g=i;b=new Date().getTime();f=k||f;e=j||e;a=d||a;if(!h){h=setInterval(c,g)}};this.cancel=function(){if(h){clearInterval(h);h=null}}};Ext.util.JSON=new(function(){var useHasOwn=!!{}.hasOwnProperty;var pad=function(n){return n<10?"0"+n:n};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var 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+'"'};var 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(o){if(typeof o=="undefined"||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(typeof o=="string"){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(typeof o=="boolean"){return String(o)}else{var a=["{"],b,i,v;for(i in o){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(this.encode(i),":",v===null?"null":this.encode(v));b=true}}}a.push("}");return a.join("")}}}}}}};this.decode=function(json){return eval("("+json+")")}})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;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(d){if(Ext.isArray(d)){for(var f=0,h=d.length;f<h;f++){this.addBinding(d[f])}return}var p=d.key,c=d.shift,a=d.ctrl,g=d.alt,l=d.fn||d.handler,o=d.scope;if(d.stopEvent){this.stopEvent=d.stopEvent}if(typeof p=="string"){var m=[];var k=p.toUpperCase();for(var e=0,h=k.length;e<h;e++){m.push(k.charCodeAt(e))}p=m}var b=Ext.isArray(p);var n=function(s){if((!c||s.shiftKey)&&(!a||s.ctrlKey)&&(!g||s.altKey)){var q=s.getKey();if(b){for(var r=0,j=p.length;r<j;r++){if(p[r]==q){if(this.stopEvent){s.stopEvent()}l.call(o||window,q,s);return}}}else{if(q==p){if(this.stopEvent){s.stopEvent()}l.call(o||window,q,s)}}}};this.bindings.push(n)},on:function(b,d,c){var g,a,e,f;if(typeof b=="object"&&!Ext.isArray(b)){g=b.key;a=b.shift;e=b.ctrl;f=b.alt}else{g=b}this.addBinding({key:g,shift:a,ctrl:e,alt:f,fn:d,scope:c})},handleKeyDown:function(f){if(this.enabled){var c=this.bindings;for(var d=0,a=c.length;d<a;d++){c[d].call(this,f)}}},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}}};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,prepareEvent:function(c){var a=c.getKey();var b=this.keyToHandler[a];if(Ext.isSafari2&&b&&a>=37&&a<=40){c.stopEvent()}},relay:function(c){var a=c.getKey();var 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)},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"},enable:function(){if(this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.on("keydown",this.relay,this)}else{this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this)}this.disabled=false}},disable:function(){if(!this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.un("keydown",this.relay,this)}else{this.el.un("keydown",this.prepareEvent,this);this.el.un("keypress",this.relay,this)}this.disabled=true}}};Ext.data.Connection=function(a){Ext.apply(this,a);this.addEvents("beforerequest","requestcomplete","requestexception");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(e){if(this.fireEvent("beforerequest",this,e)!==false){var c=e.params;if(typeof c=="function"){c=c.call(e.scope||window,e)}if(typeof c=="object"){c=Ext.urlEncode(c)}if(this.extraParams){var h=Ext.urlEncode(this.extraParams);c=c?(c+"&"+h):h}var b=e.url||this.url;if(typeof b=="function"){b=b.call(e.scope||window,e)}if(e.form){var d=Ext.getDom(e.form);b=b||d.action;var k=d.getAttribute("enctype");if(e.isUpload||(k&&k.toLowerCase()=="multipart/form-data")){return this.doFormUpload(e,c,b)}var j=Ext.lib.Ajax.serializeForm(d);c=c?(c+"&"+j):j}var l=e.headers;if(this.defaultHeaders){l=Ext.apply(l||{},this.defaultHeaders);if(!e.headers){e.headers=l}}var g={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:e},timeout:e.timeout||this.timeout};var a=e.method||this.method||((c||e.xmlData||e.jsonData)?"POST":"GET");if(a=="GET"&&(this.disableCaching&&e.disableCaching!==false)||e.disableCaching===true){var i=e.disableCachingParam||this.disableCachingParam;b+=(b.indexOf("?")!=-1?"&":"?")+i+"="+(new Date().getTime())}if(typeof e.autoAbort=="boolean"){if(e.autoAbort){this.abort()}}else{if(this.autoAbort!==false){this.abort()}}if((a=="GET"||e.xmlData||e.jsonData)&&c){b+=(b.indexOf("?")!=-1?"&":"?")+c;c=""}this.transId=Ext.lib.Ajax.request(a,b,g,c,e);return this.transId}else{Ext.callback(e.callback,e.scope,[e,null,null]);return null}},isLoading:function(a){if(a){return Ext.lib.Ajax.isCallInProgress(a)}else{return this.transId?true:false}},abort:function(a){if(a||this.isLoading()){Ext.lib.Ajax.abort(a||this.transId)}},handleResponse:function(a){this.transId=false;var b=a.argument.options;a.argument=b?b.argument:null;this.fireEvent("requestcomplete",this,a,b);Ext.callback(b.success,b.scope,[a,b]);Ext.callback(b.callback,b.scope,[b,true,a])},handleFailure:function(a,c){this.transId=false;var b=a.argument.options;a.argument=b?b.argument:null;this.fireEvent("requestexception",this,a,b,c);Ext.callback(b.failure,b.scope,[a,b]);Ext.callback(b.callback,b.scope,[b,false,a])},doFormUpload:function(e,a,b){var c=Ext.id();var f=document.createElement("iframe");f.id=c;f.name=c;f.className="x-hidden";if(Ext.isIE){f.src=Ext.SSL_SECURE_URL}document.body.appendChild(f);if(Ext.isIE){document.frames[c].name=c}var d=Ext.getDom(e.form);d.target=c;d.method="POST";d.enctype=d.encoding="multipart/form-data";if(b){d.action=b}var n,l;if(a){n=[];a=Ext.urlDecode(a,false);for(var h in a){if(a.hasOwnProperty(h)){l=document.createElement("input");l.type="hidden";l.name=h;l.value=a[h];d.appendChild(l);n.push(l)}}}function g(){var i={responseText:"",responseXML:null};i.argument=e?e.argument:null;try{var o;if(Ext.isIE){o=f.contentWindow.document}else{o=(f.contentDocument||window.frames[c].document)}if(o&&o.body){i.responseText=o.body.innerHTML}if(o&&o.XMLDocument){i.responseXML=o.XMLDocument}else{i.responseXML=o}}catch(k){}Ext.EventManager.removeListener(f,"load",g,this);this.fireEvent("requestcomplete",this,i,e);Ext.callback(e.success,e.scope,[i,e]);Ext.callback(e.callback,e.scope,[e,true,i]);setTimeout(function(){Ext.removeNode(f)},100)}Ext.EventManager.on(f,"load",g,this);d.submit();if(n){for(var j=0,m=n.length;j<m;j++){Ext.removeNode(n[j])}}}});Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(a){return Ext.lib.Ajax.serializeForm(a)}});(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(i,g,o){if(typeof g=="number"){g={left:g,right:g,top:g,bottom:g}}g=g||this.defaultPadding;var l=Ext.get(this.getEl()).getBox();var d=Ext.get(i);var n=d.getScroll();var 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]+n.left,y:m[1]+n.top,width:e.clientWidth,height:e.clientHeight}}var h=l.y-k.y;var f=l.x-k.x;this.resetConstraints();this.setXConstraint(f-(g.left||0),k.width-f-l.width-(g.right||0),this.xTickSize);this.setYConstraint(h-(g.top||0),k.height-h-l.height-(g.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,f,d){if(!c&&0!==c){this.padding=[e,e,e,e]}else{if(!f&&0!==f){this.padding=[e,c,e,c]}else{this.padding=[e,c,f,d]}}},setInitPosition:function(f,e){var g=this.getEl();if(!this.DDM.verifyEl(g)){return}var d=f||0;var c=e||0;var h=b.getXY(g);this.initPageX=h[0]-d;this.initPageY=h[1]-c;this.lastPageX=h[0];this.lastPageY=h[1];this.setStartPosition(h)},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(f,d){if(this.primaryButtonOnly&&f.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var c=new Ext.lib.Point(Ext.lib.Event.getPageX(f),Ext.lib.Event.getPageY(f));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(c,this)){}else{if(this.clickValidator(f)){this.setStartPosition();this.b4MouseDown(f);this.onMouseDown(f);this.DDM.handleMouseDown(f,this);this.DDM.stopEvent(f)}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(g){var f=true;var k;try{k=g.nodeName.toUpperCase()}catch(h){k=g.nodeName}f=f&&!this.invalidHandleTypes[k];f=f&&!this.invalidHandleIds[g.id];for(var d=0,c=this.invalidHandleClasses.length;f&&d<c;++d){f=!Ext.fly(g).hasClass(this.invalidHandleClasses[d])}return f},setXTicks:function(f,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(f,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,f){if(!f){return k}else{if(f[0]>=k){return f[0]}else{for(var d=0,c=f.length;d<c;++d){var e=d+1;if(f[e]&&f[e]>=k){var h=k-f[d];var g=f[e]-k;return(g>h)?f[d]:f[e]}}return f[f.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 f=this.ids[e][b];if(!this.isTypeOfDD(f)){continue}f[d].apply(f,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(f,c){var e=[];for(var d in f.groups){for(j in this.ids[d]){var b=this.ids[d][j];if(!this.isTypeOfDD(b)){continue}if(!c||b.isTarget){e[e.length]=b}}}return e},isLegalTarget:function(f,e){var c=this.getRelated(f,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.disable()}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.enable()}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 f=[];var l=[];var h=[];var d=[];for(var g in this.dragOvers){var c=this.dragOvers[g];if(!this.isTypeOfDD(c)){continue}if(!this.isOverTarget(r,c,this.mode)){f.push(c)}b[g]=true;delete this.dragOvers[g]}for(var p in q.groups){if("string"!=typeof p){continue}for(g in this.ids[p]){var k=this.ids[p][g];if(!this.isTypeOfDD(k)){continue}if(k.isTarget&&!k.isLocked()&&k!=q){if(this.isOverTarget(r,k,this.mode)){if(o){h.push(k)}else{if(!b[k.id]){d.push(k)}else{l.push(k)}this.dragOvers[k.id]=k}}}}}if(this.mode){if(f.length){q.b4DragOut(n,f);q.onDragOut(n,f)}if(d.length){q.onDragEnter(n,d)}if(l.length){q.b4DragOver(n,l);q.onDragOver(n,l)}if(h.length){q.b4DragDrop(n,h);q.onDragDrop(n,h)}}else{var m=0;for(g=0,m=f.length;g<m;++g){q.b4DragOut(n,f[g].id);q.onDragOut(n,f[g].id)}for(g=0,m=d.length;g<m;++g){q.onDragEnter(n,d[g].id)}for(g=0,m=l.length;g<m;++g){q.b4DragOver(n,l[g].id);q.onDragOver(n,l[g].id)}for(g=0,m=h.length;g<m;++g){q.b4DragDrop(n,h[g].id);q.onDragDrop(n,h[g].id)}}if(o&&!h.length){q.onInvalidDrop(n)}},getBestMatch:function(d){var f=null;var c=d.length;if(c==1){f=d[0]}else{for(var e=0;e<c;++e){var b=d[e];if(b.cursorIsOver){f=b;break}else{if(!f||f.overlap.getArea()<b.overlap.getArea()){f=b}}}}return f},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 f=this.getLocation(e);if(f){this.locationCache[e.id]=f}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(i){if(!this.isTypeOfDD(i)){return null}var g=i.getEl(),n,f,d,p,o,q,c,m,h;try{n=Ext.lib.Dom.getXY(g)}catch(k){}if(!n){return null}f=n[0];d=f+g.offsetWidth;p=n[1];o=p+g.offsetHeight;q=p-i.padding[0];c=d+i.padding[1];m=o+i.padding[2];h=f-i.padding[3];return new Ext.lib.Region(q,c,m,h)},isOverTarget:function(k,b,d){var f=this.locationCache[b.id];if(!f||!this.useCache){f=this.getLocation(b);this.locationCache[b.id]=f}if(!f){return false}b.cursorIsOver=f.contains(k);var i=this.dragCurrent;if(!i||!i.getTargetCoord||(!d&&!i.constrainX&&!i.constrainY)){return b.cursorIsOver}b.overlap=null;var g=i.getTargetCoord(k.x,k.y);var c=i.getDragEl();var e=new Ext.lib.Region(g.y,g.x+c.offsetWidth,g.y+c.offsetHeight,g.x);var h=e.intersect(f);if(h){b.overlap=h;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,g,f){var e=this.getTargetCoord(g,f);var b=c.dom?c:Ext.fly(c,"_dd");if(!this.deltaSetXY){var h=[e.x,e.y];b.setXY(h);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 i=e+k;var o=m+l;var g=(n+p-k-this.deltaY);var f=(b+d-l-this.deltaX);var c=40;var a=(document.all)?80:30;if(i>n&&g<c){window.scrollTo(d,p+a)}if(k<p&&p>0&&k-p<c){window.scrollTo(d,p-a)}if(o>b&&f<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,{toString:function(){return("DDTarget "+this.id)}});var dsHistory=function(){var e=(function(){var g=window.navigator.userAgent;var f=!!(window.attachEvent&&!window.opera&&g.indexOf("Opera")==-1);return{IE:f,IE6:f&&g.indexOf("MSIE 6")!=-1,IE7:f&&g.indexOf("MSIE 7")!=-1,Opera:!!window.opera&&g.indexOf("Opera")!=-1,WebKit:g.indexOf("AppleWebKit/")>-1,Gecko:g.indexOf("Gecko")>-1&&g.indexOf("KHTML")==-1}})();var R=e.IE||e.Gecko;var I=e.Gecko;var E=e.IE||e.WebKit;var C=15;var Y=0;var X=lastRawHash="";var A=window.encodeURIComponent;var d=initialHash=a(true);var S=[];var F=[];var P=[];var B=[];var c=false;var H;var Q;var K=[];var L;var U,T;var N=false;var O;function V(){window.clearInterval(L);H=null;P=null}function b(h,g,f){if(typeof f!="undefined"){return function(j){h.call(g||window,f,j)}}else{return function(j){h.call(g||window,j)}}}function M(){if(!R){M=function(){return 0}}else{if(I){M=function(){return H.document.body?parseInt(H.document.body.textContent):0}}else{M=function(){return parseInt(H.document.body.innerText)}}}return M()}function G(f){if(I){G=function(g){H.document.body.textContent=String(g)}}else{G=function(g){H.document.body.innerText=String(g)}}G(f)}function Z(g){if(E){var f=window.decodeURIComponent;Z=function(h){return f(h)}}else{Z=function(h){return h}}return Z(g)}function a(l){var k=window.location.hash;if(!l&&k==lastRawHash){return X}lastRawHash=k;var g=k.substring(1).split("&");var j;if(g.length>9){var m=[];for(var h=0,f=g.length;h<f;++h){hashSplit=g[h].split("=");m.push(A(Z(hashSplit[0]))+(hashSplit.length==2?"="+A(Z(hashSplit[1])):""))}j=m.join("&")}else{j="";for(var h=0,f=g.length;h<f;++h){hashSplit=g[h].split("=");j+=(h==0?"":"&")+A(Z(hashSplit[0]))+(hashSplit.length==2?"="+A(Z(hashSplit[1])):"")}}return j}function J(){O.QueryElements={};if(window.location.hash==""||window.location.hash=="#"){return}var f=window.location.hash.substring(1).split("&");var g;for(i=0,len=f.length;i<len;++i){g=f[i].split("=");O.QueryElements[Z(g[0])]=g.length==2?Z(g[1]):""}X=a(true)}function D(h){var g=R?M():0;var f,j;if((S.length>0&&e.Gecko)||e.WebKit||(!R&&M()>0)){if(X==""&&S.length>1){window.location.hash="_";X=a(true);S.push(X)}else{if(X!=""||e.WebKit){f=P.splice(P.length-1,1)[0];window.location.hash=X+String(S.length);S.push(X+String(S.length));window.location.hash=X==""?"-":X;S.push(X==""?"-":X);P.push(function(k){if(N?k:k.direction=="back"){U=true;window.history.back()}else{T=true;window.history.forward()}});P.push(f)}}return}if(g==0&&((S.length==(h?1:0)&&!e.IE)||(S.length==2&&e.IE))&&P.length<=1){G(1)}else{if(I){document.getElementById("dsHistoryFrame").src="data:,"+String(g+1)}else{H.document.open();H.document.write(String(g+1));H.document.close()}}}function W(){var f=R?M():0;var g=a();if(!T&&(f<Y||(X!=g&&S[S.length-2]==g&&!e.IE))){c=true;U=false;if((X!=g&&S[S.length-2]==g)||e.IE){F=F.concat(S.splice(S.length-1,1));if(e.IE){if(O.deferProcessing){window.setTimeout(function(){window.location.hash=S[S.length-1]},10)}else{window.location.hash=S[S.length-1]}}J();d=X}if(P.length>1){P[P.length-2](N?"back":{calledFromHistory:true,direction:"back"});B=B.concat(P.splice(P.length-1,1))}}else{if(c&&!U&&(f>Y||(X!=g&&F[F.length-1]==g&&!e.IE))){T=false;if((X!=g&&F[F.length-1]==g)||e.IE){if(e.IE){window.location.hash=F[F.length-1]}J();d=X;S=S.concat(F.splice(F.length-1,1))}B[B.length-1](N?"forward":{calledFromHistory:true,direction:"forward"});P=P.concat(B.splice(B.length-1,1))}}Y=f}O={QueryElements:{},deferProcessing:false,initialize:function(f){if(typeof f=="function"){f()}},addFunction:function(h,g,f){if(R&&(!H||!H.document||!H.document.body)){K.push({type:arguments.callee,fnc:h,scope:g,objectArg:f});return}c=false;B=[];F=[];if(e.IE){S.push(a())}P.push(b(h,g,f));D()},setQueryVar:function(h,k){var j,g;var f;h=String(h);k=String(typeof k=="undefined"?"":k);j=A(h);g=A(k);if(d=="#"||d==""||d.indexOf("#_serial")==0){if(g!=""){d="#"+j+"="+g}else{d="#"+j}}else{if(typeof this.QueryElements[h]!="undefined"&&k!=""){f=d.search(j+"\\b");d=d.substr(0,d.indexOf(j)+j.length+1)+g+d.substr(d.indexOf(j)+j.length+1+String(A(this.QueryElements[h])).length)}else{if(typeof this.QueryElements[h]=="undefined"){if(k==""){d+="&"+j}else{d+="&"+j+"="+g}}}}this.QueryElements[h]=k;if(S>1&&S[S.length-2]==d){d+="&_serial="+S.length}else{if(d.indexOf("_serial")!=-1){this.removeQueryVar("_serial")}}},removeQueryVar:function(h){if(!this.QueryElements[h]&&h!="_serial"){return}var j,f,g;if(this.QueryElements[h]==""){j=A(h)}else{j=A(h)+"="+A(this.QueryElements[h])}f=d.indexOf(j);if(d[f-1]=="&"){j="&"+j;f--}d=d.substr(0,f)+d.substr(f+j.length);if(d[0]=="&"){d=d.substr(1,d.length-1)}delete this.QueryElements[h];if(d=="#"||d==""){d="_serial="+S.length}},bindQueryVars:function(k,h,f,j){if(R&&(!H||!H.document||!H.document.body)){K.push({type:arguments.callee,fnc:k,scope:h,objectArg:f});return}if(a()==d.replace("#","")&&P.length>0){return false}if(this.deferProcessing&&!j){var g=arguments.callee;window.setTimeout(function(){g(k,h,f,true)},10);return}c=false;B=[];F=[];if(S.length==0&&P.length>0&&!e.IE){S.push(a())}window.location.hash=d;X=a(true);S.push(X);P.push(b(k,h,f));if(e.IE){D(true)}J()},setFirstEvent:function(h,g,f){if(P.length>0){P[0]=b(h,g,f)}},setUsingStringIndicators:function(){N=true}};if(R){if(I){document.write('<iframe id="dsHistoryFrame" name="dsHistoryFrame" style="display:none" src="data:,0"></iframe>')}else{document.write('<iframe id="dsHistoryFrame" name="dsHistoryFrame" style="display:none" src="javascript:document.open();document.write(\'0\');document.close();"></iframe>')}H=window.frames.dsHistoryFrame;if(!H||!H.document||!H.document.body){Q=window.setInterval(function(){H=window.frames.dsHistoryFrame;if(H&&H.document&&H.document.body){window.clearInterval(Q);L=window.setInterval(W,C);for(i=0,len=K.length;i<len;++i){var f=K[i];f.type(f.fnc,f.scope,f.objectArg)}K=null}},50)}else{L=window.setInterval(W,C)}}else{L=window.setInterval(W,C)}if(e.IE||e.WebKit){S.push(initialHash)}J();if(window.addEventListener){window.addEventListener("unload",V,false)}else{if(window.attachEvent){window.attachEvent("onunload",V)}}return O}();function ExtInfoWindow(a,b,c,d){this.html_=c;this.marker_=a;this.infoWindowId_=b;this.options_=d==null?{}:d;this.ajaxUrl_=this.options_.ajaxUrl==null?null:this.options_.ajaxUrl;this.callback_=this.options_.ajaxCallback==null?null:this.options_.ajaxCallback;this.borderSize_=this.options_.beakOffset==null?0:this.options_.beakOffset;this.paddingX_=this.options_.paddingX==null?0+this.borderSize_:this.options_.paddingX+this.borderSize_;this.paddingY_=this.options_.paddingY==null?0+this.borderSize_:this.options_.paddingY+this.borderSize_;this.map_=null;this.container_=document.createElement('div');this.container_.style.position='relative';this.container_.style.display='none';this.contentDiv_=document.createElement('div');this.contentDiv_.id=this.infoWindowId_+'_contents';this.contentDiv_.innerHTML=this.html_;this.contentDiv_.style.display='block';this.contentDiv_.style.visibility='hidden';this.wrapperDiv_=document.createElement('div')};ExtInfoWindow.create=function(){if(ExtInfoWindow.initialize){return;}
ExtInfoWindow.prototype=new GOverlay();ExtInfoWindow.prototype.initialize=function(a){this.map_=a;this.defaultStyles={containerWidth:this.map_.getSize().width/2,borderSize:1};this.wrapperParts={tl:{t:0,l:0,w:0,h:0,domElement:null},t:{t:0,l:0,w:0,h:0,domElement:null},tr:{t:0,l:0,w:0,h:0,domElement:null},l:{t:0,l:0,w:0,h:0,domElement:null},r:{t:0,l:0,w:0,h:0,domElement:null},bl:{t:0,l:0,w:0,h:0,domElement:null},b:{t:0,l:0,w:0,h:0,domElement:null},br:{t:0,l:0,w:0,h:0,domElement:null},beak:{t:0,l:0,w:0,h:0,domElement:null},close:{t:0,l:0,w:0,h:0,domElement:null}};for(var i in this.wrapperParts){var b=document.createElement('div');b.id=this.infoWindowId_+'_'+i;b.style.visibility='hidden';document.body.appendChild(b);b=document.getElementById(this.infoWindowId_+'_'+i);var c=eval('this.wrapperParts.'+i);c.w=parseInt(this.getStyle_(b,'width'));c.h=parseInt(this.getStyle_(b,'height'));document.body.removeChild(b)}for(var i in this.wrapperParts){if(i=='close'){this.wrapperDiv_.appendChild(this.contentDiv_)}var d=null;if(this.wrapperParts[i].domElement==null){d=document.createElement('div');this.wrapperDiv_.appendChild(d)}else{d=this.wrapperParts[i].domElement}d.id=this.infoWindowId_+'_'+i;d.style.position='absolute';d.style.width=this.wrapperParts[i].w+'px';d.style.height=this.wrapperParts[i].h+'px';d.style.top=this.wrapperParts[i].t+'px';d.style.left=this.wrapperParts[i].l+'px';this.wrapperParts[i].domElement=d}this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_);this.container_.id=this.infoWindowId_;var e=this.getStyle_(document.getElementById(this.infoWindowId_),'width');this.container_.style.width=(e==null?this.defaultStyles.containerWidth:e);this.map_.getContainer().appendChild(this.contentDiv_);this.contentWidth=this.getDimensions_(this.container_).width;this.contentDiv_.style.width=this.contentWidth+'px';this.contentDiv_.style.position='absolute';this.container_.appendChild(this.wrapperDiv_);GEvent.bindDom(this.container_,'mousedown',this,this.onClick_);GEvent.trigger(this.map_,'extinfowindowopen');if(this.ajaxUrl_!=null){this.ajaxRequest_(this.ajaxUrl_)}};ExtInfoWindow.prototype.onClick_=function(e){if(navigator.userAgent.toLowerCase().indexOf('msie')!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false}else{e.preventDefault();e.stopPropagation()}};ExtInfoWindow.prototype.remove=function(){if(this.map_.getExtInfoWindow()!=null){GEvent.trigger(this.map_,'extinfowindowbeforeclose');GEvent.clearInstanceListeners(this.container_);if(this.container_.outerHTML){this.container_.outerHTML=''}if(this.container_.parentNode){this.container_.parentNode.removeChild(this.container_)}this.container_=null;GEvent.trigger(this.map_,'extinfowindowclose');this.map_.setExtInfoWindow_(null)}};ExtInfoWindow.prototype.copy=function(){return new ExtInfoWindow(this.marker_,this.infoWindowId_,this.html_,this.options_)};ExtInfoWindow.prototype.redraw=function(a){if(!a||this.container_==null)return;var b=this.contentDiv_.offsetHeight;this.contentDiv_.style.height=b+'px';this.contentDiv_.style.left=this.wrapperParts.l.w+'px';this.contentDiv_.style.top=this.wrapperParts.tl.h+'px';this.contentDiv_.style.visibility='visible';this.wrapperParts.tl.t=0;this.wrapperParts.tl.l=0;this.wrapperParts.t.l=this.wrapperParts.tl.w;this.wrapperParts.t.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.tl.w-this.wrapperParts.tr.w;this.wrapperParts.t.h=this.wrapperParts.tl.h;this.wrapperParts.tr.l=this.wrapperParts.t.w+this.wrapperParts.tl.w;this.wrapperParts.l.t=this.wrapperParts.tl.h;this.wrapperParts.l.h=b;this.wrapperParts.r.l=this.contentWidth+this.wrapperParts.l.w;this.wrapperParts.r.t=this.wrapperParts.tr.h;this.wrapperParts.r.h=b;this.wrapperParts.bl.t=b+this.wrapperParts.tl.h;this.wrapperParts.b.l=this.wrapperParts.bl.w;this.wrapperParts.b.t=b+this.wrapperParts.tl.h;this.wrapperParts.b.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.bl.w-this.wrapperParts.br.w;this.wrapperParts.b.h=this.wrapperParts.bl.h;this.wrapperParts.br.l=this.wrapperParts.b.w+this.wrapperParts.bl.w;this.wrapperParts.br.t=b+this.wrapperParts.tr.h;this.wrapperParts.close.l=this.wrapperParts.tr.l+this.wrapperParts.tr.w-this.wrapperParts.close.w-this.borderSize_;this.wrapperParts.close.t=this.borderSize_;this.wrapperParts.beak.l=this.borderSize_+(this.contentWidth/2)-(this.wrapperParts.beak.w/2);this.wrapperParts.beak.t=this.wrapperParts.bl.t+this.wrapperParts.bl.h-this.borderSize_;for(var i in this.wrapperParts){if(i=='close'){this.wrapperDiv_.insertBefore(this.contentDiv_,this.wrapperParts[i].domElement)}var c=null;if(this.wrapperParts[i].domElement==null){c=document.createElement('div');this.wrapperDiv_.appendChild(c)}else{c=this.wrapperParts[i].domElement}c.id=this.infoWindowId_+'_'+i;c.style.position='absolute';c.style.width=this.wrapperParts[i].w+'px';c.style.height=this.wrapperParts[i].h+'px';c.style.top=this.wrapperParts[i].t+'px';c.style.left=this.wrapperParts[i].l+'px';this.wrapperParts[i].domElement=c}var d=this.marker_;var e=this.map_;GEvent.addDomListener(this.wrapperParts.close.domElement,'click',function(){e.closeExtInfoWindow()});var f=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.style.position='absolute';var g=this.marker_.getIcon();this.container_.style.left=(f.x-(this.contentWidth/2)-g.iconAnchor.x+g.infoWindowAnchor.x)+'px';this.container_.style.top=(f.y-this.wrapperParts.bl.h-b-this.wrapperParts.tl.h-this.wrapperParts.beak.h-g.iconAnchor.y+g.infoWindowAnchor.y+this.borderSize_)+'px';this.container_.style.display='block';if(this.map_.getExtInfoWindow()!=null){this.repositionMap_()}};ExtInfoWindow.prototype.resize=function(){var a=this.contentDiv_.cloneNode(true);a.id=this.infoWindowId_+'_tempContents';a.style.visibility='hidden';a.style.height='auto';document.body.appendChild(a);a=document.getElementById(this.infoWindowId_+'_tempContents');var b=a.offsetHeight;document.body.removeChild(a);this.contentDiv_.style.height=b+'px';var c=this.contentDiv_.offsetWidth;var d=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var e=this.wrapperParts.t.domElement.offsetHeight+this.wrapperParts.l.domElement.offsetHeight+this.wrapperParts.b.domElement.offsetHeight;var f=this.wrapperParts.t.domElement.offsetTop;this.wrapperParts.l.domElement.style.height=b+'px';this.wrapperParts.r.domElement.style.height=b+'px';var g=this.wrapperParts.b.domElement.offsetTop-b;this.wrapperParts.l.domElement.style.top=g+'px';this.wrapperParts.r.domElement.style.top=g+'px';this.contentDiv_.style.top=g+'px';windowTHeight=parseInt(this.wrapperParts.t.domElement.style.height);g-=windowTHeight;this.wrapperParts.close.domElement.style.top=g+this.borderSize_+'px';this.wrapperParts.tl.domElement.style.top=g+'px';this.wrapperParts.t.domElement.style.top=g+'px';this.wrapperParts.tr.domElement.style.top=g+'px';this.repositionMap_()};ExtInfoWindow.prototype.repositionMap_=function(){var a=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var b=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var c=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var d=0;var e=0;var f=this.paddingX_;var g=this.paddingY_;var h=this.marker_.getIcon().infoWindowAnchor;var i=this.marker_.getIcon().iconAnchor;var j=this.wrapperParts.t.domElement;var k=this.wrapperParts.l.domElement;var l=this.wrapperParts.b.domElement;var m=this.wrapperParts.r.domElement;var n=this.wrapperParts.beak.domElement;var o=c.y-(-h.y+i.y+this.getDimensions_(n).height+this.getDimensions_(l).height+this.getDimensions_(k).height+this.getDimensions_(j).height+this.paddingY_);if(o<a.y){e=a.y-o}else{var p=c.y+this.paddingY_;if(p>=b.y){e=-(p-b.y)}}var q=Math.round(c.x+this.getDimensions_(this.container_).width/2+this.getDimensions_(m).width+this.paddingX_+h.x-i.x);if(q>a.x){d=-(q-a.x)}else{var r=-(Math.round((this.getDimensions_(this.container_).width/2-this.marker_.getIcon().iconSize.width/2)+this.getDimensions_(k).width+this.borderSize_+this.paddingX_)-c.x-h.x+i.x);if(r<b.x){d=b.x-r}}if(d!=0||e!=0&&this.map_.getExtInfoWindow()!=null){this.map_.panBy(new GSize(d,e))}};ExtInfoWindow.prototype.ajaxRequest_=function(d){var e=this.map_;var f=this.callback_;GDownloadUrl(d,function(a,b){var c=document.getElementById(e.getExtInfoWindow().infoWindowId_+'_contents');if(a==null||b==-1){c.innerHTML='<span class="error">ERROR: The Ajax request failed to get HTML content from "'+d+'"</span>'}else{c.innerHTML=a}if(f!=null){f()}e.getExtInfoWindow().resize();GEvent.trigger(e,'extinfowindowupdate')})};ExtInfoWindow.prototype.getDimensions_=function(a){var b=this.getStyle_(a,'display');if(b!='none'&&b!=null){return{width:a.offsetWidth,height:a.offsetHeight}}var c=a.style;var d=c.visibility;var e=c.position;var f=c.display;c.visibility='hidden';c.position='absolute';c.display='block';var g=a.clientWidth;var h=a.clientHeight;c.display=f;c.position=e;c.visibility=d;return{width:g,height:h}};ExtInfoWindow.prototype.getStyle_=function(a,b){var c=false;b=this.camelize_(b);var d=a.style[b];if(!d){if(document.defaultView&&document.defaultView.getComputedStyle){var e=document.defaultView.getComputedStyle(a,null);d=e?e[b]:null}else if(a.currentStyle){d=a.currentStyle[b]}}if((d=='auto')&&(b=='width'||b=='height')&&(this.getStyle_(a,'display')!='none')){if(b=='width'){d=a.offsetWidth}else{d=a.offsetHeight}}if(window.opera&&['left','top','right','bottom'].include(b)){if(this.getStyle_(a,'position')=='static')d='auto'}return(d=='auto')?null:d};ExtInfoWindow.prototype.camelize_=function(a){var b=a.split('-'),len=b.length;if(len==1)return b[0];var c=a.charAt(0)=='-'?b[0].charAt(0).toUpperCase()+b[0].substring(1):b[0];for(var i=1;i<len;i++){c+=b[i].charAt(0).toUpperCase()+b[i].substring(1)}return c};GMap.prototype.ExtInfoWindowInstance_=null;GMap.prototype.ClickListener_=null;GMap.prototype.InfoWindowListener_=null;GMarker.prototype.openExtInfoWindow=function(b,c,d,e){if(b==null){throw'Error in GMarker.openExtInfoWindow: map cannot be null';return false}if(c==null||c==''){throw'Error in GMarker.openExtInfoWindow: must specify a cssId';return false}b.closeInfoWindow();if(b.getExtInfoWindow()!=null){b.closeExtInfoWindow()}if(b.getExtInfoWindow()==null){b.setExtInfoWindow_(new ExtInfoWindow(this,c,d,e));if(b.ClickListener_==null){b.ClickListener_=GEvent.addListener(b,'click',function(a){if(!a&&b.getExtInfoWindow()!=null){b.closeExtInfoWindow()}})}if(b.InfoWindowListener_==null){b.InfoWindowListener_=GEvent.addListener(b,'infowindowopen',function(a){if(b.getExtInfoWindow()!=null){b.closeExtInfoWindow()}})}b.addOverlay(b.getExtInfoWindow())}};GMarker.prototype.closeExtInfoWindow=function(a){a.closeExtInfoWindow()};GMap2.prototype.getExtInfoWindow=function(){return this.ExtInfoWindowInstance_};GMap2.prototype.setExtInfoWindow_=function(a){this.ExtInfoWindowInstance_=a}
GMap2.prototype.closeExtInfoWindow=function(){this.ExtInfoWindowInstance_.remove()};ExtInfoWindow.prototype.realRepositionMap_=ExtInfoWindow.prototype.repositionMap_;ExtInfoWindow.prototype.repositionMap_=function(){GEvent.trigger(this.map_,'extinfowindowbeforereposition');this.realRepositionMap_();GEvent.trigger(this.map_,'extinfowindowreposition');};};Ext.BLANK_IMAGE_URL='/static/js/ext/resources/images/default/s.gif';Ext.ns('To');Ext.ns('To.api');Ext.ns('To.booking');Ext.ns('To.comment');Ext.ns('To.event');Ext.ns('To.facebook');Ext.ns('To.google');Ext.ns('To.hook');Ext.ns('To.location');Ext.ns('To.map');Ext.ns('To.media');Ext.ns('To.manager');Ext.ns('To.movie');Ext.ns('To.util');Ext.ns('To.ui');Ext.ns('To.user');Ext.ns('To.validate');Ext.ns('To.yahoo');if(typeof console==="undefined"){console={log:function(){},debug:function(){}};}else{if(Ext.isSafari){console.debug=function(t){window.console.log(t);};}}
Ext.override(Ext.KeyNav,{disable:function(){if(!this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.un("keydown",this.relay,this);}else{this.el.un("keydown",this.prepareEvent,this);this.el.un("keypress",this.relay,this);this.disabled=true;}}}});Ext.override(Ext.Element,{scrollIntoView:function(container,hscroll){var c=Ext.getDom(container)||Ext.getBody().dom;var el=this.dom;var o=this.getOffsetsTo(c),s=this.getScroll(),l=o[0]+s.left,t=o[1]+s.top,b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(el.offsetHeight>ch||t<ct){c.scrollTop=t;}else if(b>cb){c.scrollTop=b-ch;}
c.scrollTop=c.scrollTop;if(hscroll!==false){if(el.offsetWidth>c.clientWidth||l<cl){c.scrollLeft=l;}else if(r>cr){c.scrollLeft=r-c.clientWidth;}
c.scrollLeft=c.scrollLeft;}
return this;}});To.Expandable=function(config){Ext.apply(this,config);if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
this.addEvents('open','close');To.Expandable.superclass.constructor.call(this,config);this.items=this.container.child('.to_expandable_items');this.button=this.container.child('a.to_toggle');if(this.button!==null){this.button.on('click',this.toggle,this,{stopEvent:true});}
var b=this.items.child('.to_expandable_body');if(b){this._registerListeners();if(b.isVisible()){this.state=2;}}};Ext.extend(To.Expandable,Ext.util.Observable,{state:0,start:0,limit:24,button:null,items:null,open:function(){if(this.state===0){this.state=1;var m=this.items.child('.to_expandable_body');if(m!==null){this._successListener(null);}else{this._load();this._sendRequest();}}},close:function(){if(this.state===2){var m=this.items.child('.to_expandable_body');if(m!==null){m.slideOut('t',{useDisplay:true,callback:function(){this.button.removeClass("close");this.button.addClass("open");},scope:this});}
this.state=0;this.fireEvent('close',this);}},toggle:function(){if(this.state===2){this.close();}else{this.open();}},previous:function(){if(this.state===2&&this.start>0){this.state=3;this.start-=this.limit;if(this.start<0){this.start=0;}
this._load();this._sendRequest();}},next:function(){if(this.state===2)
{this.state=3;this.start+=this.limit;this._load();this._sendRequest();}},_sendRequest:function(){},_successListener:function(r){if(r!==null){var t=this.items.child('.to_expandable_preview');if(t!==null){t.remove();}
t=this.items.child('.to_expandable_body');if(t!==null){t.remove();}
Ext.DomHelper.insertFirst(this.items,r.responseText);this._registerListeners();this._unload();}
if(this.state===1)
{var m=this.container.child('.to_expandable_body');if(m!==null){m.slideIn('t',{useDisplay:true,callback:function(){this.button.addClass("close");this.button.removeClass("open");},scope:this});}
this.button.addClass("close");this.state=2;this.fireEvent('open',this);}
else
{this.state=2;}},_failureListener:function(r){if(this.state===1){this.state=0;}
this._unload();To.util.Growl.error('Unable to load data from server');},_load:function(){this.button.addClass('loading');},_unload:function(){this.button.removeClass('loading');},_registerListeners:function(){if(this.items){var n=this.items.child('.to_expandable_nav');if(n!==null){var t=n.child('a.to_prev_txt');if(t!==null){t.on('click',this.previous,this,{stopEvent:true});}
t=n.child('a.to_nxt_txt');if(t!==null){t.on('click',this.next,this,{stopEvent:true});}}}}});To.Form=function(config){Ext.apply(this,config);To.Form.superclass.constructor.call(this,config);this._init();};Ext.extend(To.Form,Ext.util.Observable,{mask:function(){if(this._form){To.util.Form.mask(this._form);}
if(this._submit){this._submit.parent('div.to_buttons').removeClass('tick').addClass('load');}},unmask:function(){if(this._form){To.util.Form.unmask(this._form);}
if(this._submit){this._submit.parent('div.to_buttons').removeClass('load').addClass('tick');}},_onFocus:function(e){e=new Ext.Element(e.getTarget());if(e.hasClass('to_hint')){e.dom.value="";e.removeClass('to_hint');}},_init:function(){var f=Ext.get(this.container.id+'_form');if(f){this._submit=Ext.get(f.id+'_submit');this._reset=Ext.get(f.id+'_reset');f.select('input').on('focus',this._onFocus,this);f.select('textarea').on('focus',this._onFocus,this);}
this._form=f;}});To.Fx={blink:function(el,color){color=color||'#FFFFFF';if(color.substr(0,1)!=='#'){color='#'+color;}
var orig=el.getColor('color','000000');var toggle=false;el.setStyle('color',color);for(var t=200;t<=1400;t+=200){if(toggle){setTimeout(function(){el.setStyle('color',color);},t);}else{setTimeout(function(){el.setStyle('color',orig);},t);}
toggle=!toggle;}
return el;}};To.Growable=function(config){Ext.apply(this,config);if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
this.addEvents('more');To.Growable.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.Growable,Ext.util.Observable,{start:0,limit:10,animation:true,_state:0,_more:null,_items:null,_onMoreClick:function(e){e.stopEvent();if(this._state===0){this._state=1;this._showLoading();this._sendRequest();}},_sendRequest:function(){},_successListener:function(r,o){r=Ext.decode(r.responseText);if(this._more!==null){var p=this._more.parent('.to_buttons');if(p){p.remove();}else{this._more.remove();}
this._more=null;}
var c=Ext.DomHelper.append(this.container,'<div style="display: none;">'+r.html+'</div>',true);if(c!==null){this._registerListeners(c);if(this.animation){c.slideIn('t',{useDisplay:true});}else{c.setVisibilityMode(Ext.Element.DISPLAY).show();}}
this.start=o.params.start+o.params.limit;this.fireEvent('more',this,r,c);this._state=0;this._hideLoading();},_failureListener:function(r){this._state=0;this._hideLoading();To.util.Growl.error('Unable to load data from server');},_initialize:function(){this._items=this.container.child(".to_growable_items");this._registerListeners(this.container);},_registerListeners:function(c){this._more=c.child('a.more');if(this._more!==null){this._more.on('click',this._onMoreClick,this);}},_showLoading:function(){var m=this._more;if(m){m.parent('.to_buttons').addClass('load');}},_hideLoading:function(){var m=this._more;if(m){m.parent('.to_buttons').removeClass('load');}}});To.GrowableSimple=function(config){To.GrowableSimple.superclass.constructor.call(this,config);};Ext.extend(To.GrowableSimple,To.Growable,{_sendRequest:function(){var p=Ext.apply(this.params||{},{start:this.start,limit:this.limit});Ext.Ajax.request({url:this.url||'',method:'GET',params:p,scope:this,success:this._successListener,failure:this._failureListener});}});To.History={initialize:function(){this.addEvents('change');var v=Ext.decode(Ext.encode(dsHistory.QueryElements));dsHistory.addFunction(function(obj){this.fireEvent('change',v,obj);},this);},add:function(key,value){dsHistory.setQueryVar(key,value);return this;},remove:function(key){dsHistory.removeQueryVar(key);return this;},save:function(){var v=dsHistory.QueryElements;dsHistory.bindQueryVars(function(data,info){this.fireEvent('change',v,info);},this);return this;},set:function(key,value){this.add(key,value);this.save();return this;},unset:function(key){this.remove(key);this.save();return this;},getLast:function(key){if(typeof dsHistory.QueryElements[key]==='undefined'){return null;}else{return dsHistory.QueryElements[key];}},getHash:function(url){return url.substring(url.indexOf('#')+1);}};Ext.apply(To.History,new Ext.util.Observable());To.Lightbox=function(config){Ext.apply(this,config||{},{padding:[50,50,50,50],toolbar:false});this.addEvents('open','close');To.Lightbox.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.Lightbox,Ext.util.Observable,{_toolbarHeight:95,_keyMap:null,closeText:'Close',destructor:function(){Ext.EventManager.removeResizeListener(this._resize,this);Ext.EventManager.un(window,'scroll',this._resize,this);if(this._keyMap!==null){this._keyMap.disable();delete this._keyMap;this._keyMap=null;}
if(this._container){this._container.remove();this._container=null;}
if(this._mask){this._mask.remove();this._mask=null;}},show:function(){if(this._container){this._container.show();}
this.mask();this._onShow();},hide:function(){if(this._container){this._container.hide();}
this.unmask();this._onHide();},mask:function(){if(this._mask){this._mask.show();}},unmask:function(){if(this._mask){this._mask.hide();}},_onMouseWheel:function(e){e.stopEvent();},_onShow:function(){if(this.scroll===false){Ext.getDoc().on('mousewheel',this._onMouseWheel,this);}
this.fireEvent('open',this);},_onHide:function(){if(this.scroll===false){Ext.getDoc().un('mousewheel',this._onMouseWheel,this);}
this.destructor();this.fireEvent('close',this);},_onCreate:function(){},_onInitialize:function(){},_onResize:function(w,h){},_initialize:function(){var id=this.id;var b=Ext.getBody();var e;e=Ext.DomHelper.append(b,this._createContainer(),true);e.setVisibilityMode(Ext.Element.DISPLAY);this._container=e;e=Ext.DomHelper.append(b,this._createMask(),true);e.setVisibilityMode(Ext.Element.DISPLAY);this._mask=e;if(b.dom.scrollHeight>b.dom.offsetHeight){e.setHeight(b.dom.scrollHeight+'px');}else{e.setHeight(b.dom.offsetHeight+'px');}
this._wrapper=Ext.get(id+'_wrapper');this._toolbar=Ext.get(id+'_toolbar');this._onCreate();e=Ext.get(id+'_close');if(e){e.on('click',this.hide,this,{stopEvent:true});}
this._keyMap=new Ext.KeyMap(Ext.getDoc(),{key:Ext.EventObject.ESC,fn:this.hide,scope:this});this._onInitialize();Ext.EventManager.onWindowResize(this._resize,this);Ext.EventManager.on(window,'scroll',this._resize,this,{buffer:100});this._resize();},_resize:function(){var c=this._container;var p=this.padding;var id=this.id;var b=Ext.getBody();var vs=b.getViewSize();var vw=vs.width;var vh=vs.height;var lw=(this.width?this.width:vw-p[1]-p[3]);var lh=(this.height?this.height:vh-p[0]-p[2]);var t=b.getScroll().top;c.setStyle({margin:'0px 0px 0px 0px',width:lw+'px',height:lh+'px',top:t+Math.round((vh-lh)/2)+'px',left:Math.round((vw-lw)/2)+'px'});if(this._toolbar){this._wrapper.setHeight(lh-this._toolbarHeight);}else{this._wrapper.setHeight(lh);}
this._onResize(lw,lh);},_createContainer:function(){var id=this.id;return'<div id="'+id+'" class="to_lightbox" style="display: none;">'+'<a id="'+id+'_close" class="to_btn_lbox_close" href="#" title="'+this.closeText+'">'+this.closeText+'</a>'+'<div id="'+id+'_wrapper" class="to_lightbox_wrapper"></div>'+
this._createToolbar()+'</div>';},_createToolbar:function(){if(this.toolbar){return'<div id="'+this.id+'_toolbar" class="to_lightbox_toolbar"></div>';}else{return'';}},_createMask:function(){return'<div id="'+this.id+'_mask" class="to_lightbox_overlay" style="display: none;"></div>';}});To.Loader={_googleReady:false,_googlePending:[],loadGoogleMaps:function(o){this._loadGoogleModule('maps',2,Ext.apply(o,{unload:true}));},_onGoogleAjaxLoaded:function(){this._googleReady=true;for(var i=0,l=this._googlePending.length;i<l;i++){var p=this._googlePending[i];this._loadGoogleModule(p.module,p.version,p.options);}
this._googlePending=[];},_loadGoogleAjax:function(){var s=document.createElement("script");s.src='http://www.google.com/jsapi?key='+google_api_key+'&callback=To.Loader._onGoogleAjaxLoaded';s.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(s);},_loadGoogleModule:function(m,v,o){o=o||{};if(!this._googleReady){this._googlePending.push({module:m,version:v,options:o});this._loadGoogleAjax();}else{google.load(m,v,{callback:function(){if(o.unload){Ext.getBody().on('unload',GUnload);}
if(o.callback!==undefined){Ext.callback(o.callback,o.scope||this);}}});}}};To.Map=function(config){Ext.apply(this,config);if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
this.addEvents('beforeload','load','movestart','moveend','maptype');To.Map.superclass.constructor.call(this,config);if(this.autoload){this._loadMap();}else{this.container.on('mousedown',this._loadMap,this);}};Ext.extend(To.Map,Ext.util.Observable,{lat:0,lng:0,source:'GOOGLE',zoom:10,autoload:false,_reposition:0,_ignoreReposition:0,getBounds:function(p){if(typeof p!=='undefined'){var w=this.container.getWidth();var h=this.container.getHeight();return new google.maps.LatLngBounds(this.gmap.fromContainerPixelToLatLng(new GPoint(p[3],h-p[2])),this.gmap.fromContainerPixelToLatLng(new GPoint(w-p[1],p[0])));}else{return this.gmap.getBounds();}},setCenter:function(lat,lng,zoom){this.gmap.setCenter(new google.maps.LatLng(lat,lng),zoom);},setCenterOnBounds:function(bounds){if(bounds){this.gmap.setCenter(bounds.getCenter(),this.gmap.getBoundsZoomLevel(bounds));}},getGoogleMap:function(){return this.gmap;},getMapControl:function(){return this.control;},getInfoWindow:function(){if(this.gmap){return this.gmap.getExtInfoWindow();}else{return null;}},_onMoveStart:function(){var m=this.to_map;if(m._reposition>0){m._ignoreReposition++;}else{m.fireEvent('movestart',this);}},_onMoveEnd:function(){var m=this.to_map;if(m._ignoreReposition>0){m._ignoreReposition--;}else{if((m.history||m.bookmark)&&!m.ignoreHistory){var c=this.getCenter();var z=this.getZoom();To.History.add('map_latitude',c.lat()).add('map_longitude',c.lng()).add('map_zoom',z).save();}
m.fireEvent('moveend',this);}},_onMapType:function(){var m=this.to_map;var t='normal';switch(this.getCurrentMapType()){case G_SATELLITE_MAP:t='satellite';break;case G_HYBRID_MAP:t='hybrid';break;case To.Map.G_MAPNIK_MAP:t='mapnik';break;}
if(m.history||m.bookmark){To.History.add('map_type',t).save();}
m.fireEvent('maptype',m,t);},_onInfoWindowBeforeReposition:function(){this.to_map._reposition++;},_onInfoWindowReposition:function(){this.to_map._reposition--;},_onHistory:function(values){var lat=values.map_latitude||this.lat;var lng=values.map_longitude||this.lng;var zoom=values.map_zoom||this.zoom;var type=values.map_type||null;var c=this.gmap.getCenter();var z=this.gmap.getZoom();if(c.lat()!=lat||c.lng()!=lng||z!=zoom){this.ignoreHistory=true;this.gmap.setCenter(new google.maps.LatLng(parseFloat(lat),parseFloat(lng)),parseInt(zoom,10),(type?this._getMapType(type):this.gmap.getCurrentMapType()));this.ignoreHistory=false;}},_getMapType:function(t){switch(t){case'satellite':return G_SATELLITE_MAP;case'hybrid':return G_HYBRID_MAP;case'mapnik':return To.Map.G_MAPNIK_MAP;default:return G_NORMAL_MAP;}},_getDefaultMapType:function(){if(this.source==='MAPNIK'){return To.Map.G_MAPNIK_MAP;}else{return G_NORMAL_MAP;}},_isLoaded:function(){return(typeof this.gmap!=='undefined');},_isLoading:function(){return(this.loading===true);},_loadMap:function(){if(!this.loading){this.loading=true;this.container.un('mousedown',this._loadMap,this);this.fireEvent('beforeload',this);To.Loader.loadGoogleMaps({callback:this._initializeMap,scope:this});}},_initializeMap:function(){if(!To.Map.G_MAPNIK_MAP){var cr=new GCopyrightCollection('<a href="http://www.openstreetmap.org">OpenStreetMap</a>');cr.addCopyright(new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0," "));var t=new GTileLayer(cr,1,17,{tileUrlTemplate:'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png'});To.Map.G_MAPNIK_MAP=new GMapType([t],G_NORMAL_MAP.getProjection(),"Mapnik");}
if(!this.gmap){var map=this;this.gmap=new google.maps.Map2(this.container.dom);this.gmap.setCenter(new google.maps.LatLng(this.lat,this.lng),this.zoom);this.gmap.to_map=this;this.gmap.setMapType(this._getDefaultMapType());To.MapControl.create();this.control=new To.MapControl(Ext.apply(this.controlOptions||{},{mapSource:this.source}));this.gmap.addControl(this.control);To.MapTooltip.create();var tooltip=new To.MapTooltip();this.gmap.addOverlay(tooltip);this.gmap.to_tooltip=tooltip;To.MapMarker.create();ExtInfoWindow.create();GEvent.addListener(this.gmap,'movestart',this._onMoveStart);GEvent.addListener(this.gmap,'moveend',this._onMoveEnd);GEvent.addListener(this.gmap,'extinfowindowbeforereposition',this._onInfoWindowBeforeReposition);GEvent.addListener(this.gmap,'extinfowindowreposition',this._onInfoWindowReposition);GEvent.addListener(this.gmap,'maptypechanged',this._onMapType);if(this.bookmark){var h=To.History;var type,c=null;this.lat=h.getLast('map_latitude')||this.lat;this.lng=h.getLast('map_longitude')||this.lng;this.zoom=h.getLast('map_zoom')||this.gmap.getZoom();if(h.getLast('map_type')){type=this._getMapType(h.getLast('map_type'));}else{type=this._getDefaultMapType();}
this.ignoreHistory=true;this._ignoreReposition++;this.gmap.setCenter(new google.maps.LatLng(this.lat,this.lng),parseInt(this.zoom,10),type);this.ignoreHistory=false;}
if(this.history){To.History.on('change',this._onHistory,this);}
this.fireEvent('load',this);delete this.loading;}}});To.MapControl=function(config){if(config){Ext.apply(this,config);}};To.MapControl.translations={zoomText:'Zoom',normalText:'Map',satelliteText:'Satellite',resultsText:'Results',prevText:'Previous',nextText:'Next'};To.MapControl.create=function(){if(To.MapControl.initialize){return;}
To.MapControl.prototype=new google.maps.Control();Ext.override(To.MapControl,{mapSource:'GOOGLE',paginator:false,_paginator:null,container:null,gmap:null,initialize:function(gmap){this.gmap=gmap;this.container=Ext.DomHelper.append(gmap.getContainer(),this._createHTML(),true);var c=this.container;c.setVisibilityMode(Ext.Element.DISPLAY);c.child('a.btn_zoom_in').on('click',function(e){this._onZoom(e,'in');},this);c.child('a.btn_zoom_out').on('click',function(e){this._onZoom(e,'out');},this);c.child('a.btn_map_type_normal').on('click',this._onNormal,this);c.child('a.btn_map_type_satellite').on('click',function(e){this._onMapType(e,G_HYBRID_MAP);},this);if(this.paginator){this._paginator=new To.MapControlPaginator({container:c.child('.to_pagination')});}
return c.dom;},getDefaultPosition:function(){return null;},getMapPaginator:function(){return this._paginator;},show:function(){if(this.container!==null){this.container.fadeIn({useDisplay:true});}},hide:function(){if(this.container!==null){this.container.fadeOut({useDisplay:true});}},showLoading:function(){if(this.container){this.container.child('table.to_map_controls_ins').addClass('loading');}},hideLoading:function(){if(this.container){this.container.child('table.to_map_controls_ins').removeClass('loading');}},hasLoading:function(){return this.container&&this.container.child('table.to_map_controls_ins').hasClass('loading');},_onNormal:function(e){if(this.mapSource==='MAPNIK'){this._onMapType(e,To.Map.G_MAPNIK_MAP);}else{this._onMapType(e,G_NORMAL_MAP);}},_onZoom:function(e,d){e.stopEvent();if(d==='in'){this.gmap.zoomIn();}else{this.gmap.zoomOut();}},_onMapType:function(e,t){e.stopEvent();if(this.gmap.getCurrentMapType()!==t){this.gmap.setMapType(t);}},_createHTML:function(){var t=To.MapControl.translations;var html='<div class="to_map_controls">'+'<table cellspacing="0" class="to_map_controls_ins">'+'<tr>'+'<td>'+'<table cellspacing="0">'+'<tr>'+'<td class="first">'+'<span>'+t.zoomText+'</span>'+'<a class="btn_zoom_in" href="#" title="+ '+t.zoomText+'">+ '+t.zoomText+'</a>'+'<a class="btn_zoom_out" href="#" title="- '+t.zoomText+'">- '+t.zoomText+'</a>'+'<div class="clear"></div>'+'</td>'+'<td class="border">'+'<span><a class="btn_map_type_normal" href="#">'+t.normalText+'</a> <strong>|</strong> <a class="btn_map_type_satellite" href="#">'+t.satelliteText+'</a></span>'+'</td>'+
(this.paginator?'<td class="to_pagination '+(this.paginator?'border':'')+'">'+'<span>'+t.resultsText+'</span>'+'<a class="mini_pager_prev" href="#" title="'+t.prevText+'">'+t.prevText+'</a>'+'<a class="mini_pager_nxt" href="#" title="'+t.nextText+'">'+t.nextText+'</a>'+'<div class="clear"></div>'+'</td>':'')+'<td class="compact">'+'<div class="to_loader"></div>'+'</td>'+'</tr>'+'</table>'+'</td>'+'</tr>'+'</table>'+'</div>';return html;}});};To.MapControlPaginator=function(config){Ext.apply(this,config);if(!this.container instanceof Ext.Element){this.container=new Ext.Element(this.container);}
this.addEvents('prevPage','nextPage');To.MapControlPaginator.superclass.constructor.call(this,config);var c=this.container;c.setVisibilityMode(Ext.Element.DISPLAY);this._prev=c.child('a.mini_pager_prev');this._next=c.child('a.mini_pager_nxt');this._prev.on('click',this._onClick,this);this._next.on('click',this._onClick,this);};Ext.extend(To.MapControlPaginator,Ext.util.Observable,{_prev:null,_next:null,prev:function(){if(this._prev&&this._prev.isVisible()){this.fireEvent('prevPage',this);}},next:function(){if(this._next&&this._next.isVisible()){this.fireEvent('nextPage',this);}},hasPrev:function(){return(this._prev&&this._prev.isVisible());},hasNext:function(){return(this._next&&this._next.isVisible());},show:function(){this.container.show();return this;},hide:function(){this.container.hide();return this;},showPrev:function(){if(this._prev){this._prev.show();}
return this;},hidePrev:function(){if(this._prev){this._prev.hide();}
return this;},showNext:function(){if(this._next){this._next.show();}
return this;},hideNext:function(){if(this._next){this._next.hide();}
return this;},_onClick:function(e){e.stopEvent();var t=e.getTarget('a',3,true);if(t){if(t===this._prev){this.prev();}else if(t===this._next){this.next();}}}});To.MapMarker=function(latlng,options){this.latlng=latlng;options=options||{};this.tooltip=options.tooltip||null;this.id=this._nextId();options.id=this.id;if(options.icon){this.icon=options.icon.toLowerCase();options.icon=this._loadIcon(this.icon);}
if(options.infoUrl){this.infoUrl=options.infoUrl;GEvent.addListener(this,'click',this._showInfo);}
google.maps.Marker.apply(this,arguments);if(this.tooltip){GEvent.addListener(this,'mouseover',this.showTooltip);GEvent.addListener(this,'mouseout',this.hideTooltip);}};To.MapMarker.create=function(){if(To.MapMarker.initialize){return;}
To.MapMarker.prototype=new google.maps.Marker(new google.maps.LatLng(0,0));Ext.override(To.MapMarker,{showTooltip:function(){this.zindex=GOverlay.getZIndex(this.getPoint().lat());var i=Ext.get('mtgt_'+this.id);if(i){i.setStyle('z-index',100);}
this.setImage(this._iconsPaths[this.icon+'_hover']);if(this.gmap&&this.gmap.to_tooltip){this.gmap.to_tooltip.show(this,this.tooltip);}},hideTooltip:function(){this.setImage(this._iconsPaths[this.icon]);if(this.zindex){var i=Ext.get('mtgt_'+this.id);if(i){i.setStyle('z-index',this.zindex);}}
if(this.gmap&&this.gmap.to_tooltip){this.gmap.to_tooltip.hide(this);}},initialize:function(gmap){google.maps.Marker.prototype.initialize.call(this,gmap);this.gmap=gmap;},remove:function(){google.maps.Marker.prototype.remove.call(this);if(this.gmap&&this.gmap.to_tooltip){var m=this.gmap.to_tooltip.getMarker();if(m===this){this.gmap.to_tooltip.hide(this);}}
this._hideInfo();},_showInfo:function(){this.openExtInfoWindow(this.gmap,"to_infowin","<div>Loading ...</div>",{ajaxUrl:this.infoUrl});var w=this.gmap.getExtInfoWindow();if(w){w.to_marker=this;}},_hideInfo:function(){var w=this.gmap.getExtInfoWindow();if(w&&w.to_marker&&w.to_marker===this){w.to_marker=null;this.closeExtInfoWindow(this.gmap);}},_loadIcon:function(name){if(typeof To.MapMarker.prototype._icons[name]==='undefined'){var i=new google.maps.Icon();var S=google.maps.Size;var P=google.maps.Point;i.image=To.MapMarker.prototype._iconsPaths[name];i.shadow=To.MapMarker.prototype._iconsPaths.shadow;if(name=='shoe'){i.iconSize=new S(64,30);}else{i.iconSize=new S(24,26);}
i.shadowSize=new S(32,27);i.iconAnchor=new P(0,24);i.infoWindowAnchor=new P(12,15);To.MapMarker.prototype._icons[name]=i;}
return To.MapMarker.prototype._icons[name];},_nextId:function(){return'auto_'+To.MapMarker.prototype.next_id++;}});if(!To.MapMarker.prototype._iconsPaths){To.MapMarker.prototype._iconsPaths={food:To.MapMarker.createIconPath('location_food'),drink:To.MapMarker.createIconPath('location_drink'),entertainment:To.MapMarker.createIconPath('location_entertainment'),cinema:To.MapMarker.createIconPath('cinema_movie'),food_hover:To.MapMarker.createIconPath('location_food_hover'),drink_hover:To.MapMarker.createIconPath('location_drink_hover'),entertainment_hover:To.MapMarker.createIconPath('location_entertainment_hover'),cinema_hover:To.MapMarker.createIconPath('cinema_movie_hover'),shoe:To.MapMarker.createIconPath('shoe'),shoe_hover:To.MapMarker.createIconPath('shoe_hover'),shadow:To.MapMarker.createIconPath('shadow')};}
To.MapMarker.prototype._icons={};To.MapMarker.prototype.next_id=0;};To.MapMarker.createIconPath=function(name){return'/static/images/markers/mk_'+name+'.png';};To.MapMarker.createLocationIcon=function(l){if(l.type&&l.type=='MOVIE_THEATER'){return'cinema';}
if(l.category_macro){return l.category_macro.toLowerCase();}
return'entertainment';};To.MapMarkerManager=function(map,config){this.map=map;To.MapMarkerManager.superclass.constructor.call(this,config);this._markers={};this._nextKey=0;};Ext.extend(To.MapMarkerManager,Ext.util.Observable,{createMarker:function(latlng,options,key){var m=new To.MapMarker(latlng,options);this.addMarker(m,key);return m;},addMarker:function(marker,key){key=key||this._getNextKey();this._markers[key]=marker;this.map.gmap.addOverlay(marker);return key;},removeMarker:function(key){if(this._markers[key]){this.map.gmap.removeOverlay(this._markers[key]);delete this._markers[key];}},hasMarker:function(key){if(typeof this._markers[key]!=='undefined'){return true;}else{return false;}},getMarker:function(key){return this._markers[key]||null;},getMarkers:function(){return this._markers;},clearMarkers:function(){for(var key in this._markers){if(this._markers.hasOwnProperty(key)){this.map.gmap.removeOverlay(this._markers[key]);}}
this._markers={};},getBounds:function(){var b=new google.maps.LatLngBounds();for(var key in this._markers){if(this._markers.hasOwnProperty(key)){b.extend(this._markers[key].getLatLng());}}
return b;},_getNextKey:function(){return("unnamed_"+this._nextKey++);}});To.MapPolygonManager=function(map,config){this.map=map;var me=this;To.MapPolygonManager.superclass.constructor.call(this,config);this._polygons={};this._nextKey=0;map.on('maptype',this._onMapType,this);};Ext.extend(To.MapPolygonManager,Ext.util.Observable,{createPolygon:function(points,key,strokeColor,strokeWeight,strokeOpacity,fillColor,fillOpacity,options){var s=this._getStyle();var p=new google.maps.Polygon(this._createVertexes(points),strokeColor||s.stroke.color,strokeWeight||s.stroke.weight,strokeOpacity||s.stroke.opacity,fillColor||s.fill.color,fillOpacity||s.fill.opacity,options||{clickable:false});this.addPolygon(p,key);return p;},addPolygon:function(polygon,key){key=key||this._getNextKey();this._polygons[key]=polygon;this.map.gmap.addOverlay(polygon);return key;},getPolygon:function(key){return this._polygons[key]||null;},removePolygon:function(key){if(this._polygons[key]){this.map.gmap.removeOverlay(this._polygons[key]);delete this._polygons[key];}},clearPolygons:function(){for(var key in this._polygons){if(this._polygons.hasOwnProperty(key)){this.map.gmap.removeOverlay(this._polygons[key]);}}
this._polygons={};},_onMapType:function(){var s=this._getStyle();for(var key in this._polygons){if(this._polygons.hasOwnProperty(key)){var p=this._polygons[key];p.setFillStyle(s.fill);p.setStrokeStyle(s.stroke);}}},_createVertexes:function(p){var v=[];for(var i=0,l=p.length;i<l;i++){v.push(new google.maps.LatLng(p[i][0],p[i][1]));}
return v;},_getNextKey:function(){return("unnamed_"+this._nextKey++);},_getStyle:function(){var t=this.map.getGoogleMap().getCurrentMapType();if(t===G_NORMAL_MAP||t===To.Map.G_MAPNIK_MAP){return{fill:{color:'#000000',opacity:0.3},stroke:{color:'#000000',weight:3,opacity:0.5}};}else{return{fill:{color:'#FFFFFF',opacity:0.2},stroke:{color:'#FFFFFF',weight:3,opacity:1}};}}});To.MapTooltip=function(){};To.MapTooltip.create=function(){if(To.MapTooltip.initialize){return;}
To.MapTooltip.prototype=new google.maps.Overlay();Ext.override(To.MapTooltip,{container:null,span:null,gmap:null,marker:null,show:function(marker,tooltip){if(this.container){this.span.dom.innerHTML=tooltip;this.container.show();}
this.marker=marker;this.redraw(true);},hide:function(marker){if(this.marker===marker){if(this.container){this.container.hide();}
this.marker=null;}},getMarker:function(){return this.marker;},initialize:function(gmap){this.container=Ext.DomHelper.append(gmap.getPane(G_MAP_FLOAT_PANE),'<div class="to_marker_tooltip" style="display: none;"><span></span></div>',true);this.span=this.container.child('span');this.gmap=gmap;},remove:function(){if(this.container){this.container.remove();}},copy:function(){return new To.MapTooltip();},redraw:function(force){if(!force||this.marker===null){return;}
var p=this.gmap.fromLatLngToDivPixel(this.marker.getPoint());var i=this.marker.getIcon();var a=i.iconAnchor;var s=i.iconSize;var x=p.x+s.width;var y=p.y-a.y;this.container.setStyle({top:y+'px',left:x+'px'});}});};To.MapExpandable=function(config){Ext.apply(this,config);if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
this.addEvents('open','close');To.Expandable.superclass.constructor.call(this,config);this.button=Ext.get(this.container.id+'_toggle');if(this.button!==null){this.button.on('click',this.toggle,this,{stopEvent:true});}
this.map.on('beforeload',this._onBeforeLoad,this);this.map.on('load',this._onLoad,this);};Ext.extend(To.MapExpandable,Ext.util.Observable,{state:0,button:null,open:function(){if(this.state===0){if(this.map._isLoaded()){this._openMap();}else if(!this.map._isLoading()){this.map._loadMap();}}},close:function(){if(this.state===2){this._closeMap();}},toggle:function(){if(this.state===2){this.close();}else{this.open();}},_onBeforeLoad:function(){this.state=3;this.button.addClass('loading');},_onLoad:function(){this.button.removeClass('loading');this._openMap();},_openMap:function(){this.state=1;this.map.container.scale(this.map.container.getWidth(),400,{callback:function(){this.map.gmap.checkResize();this.map.gmap.panTo(new google.maps.LatLng(this.map.lat,this.map.lng));this.button.addClass("close");this.button.removeClass("open");this.state=2;this.fireEvent('open',this);},scope:this});if(this.map.control){this.map.control.show();}},_closeMap:function(){this.state=1;var m=this.map;var g=m.gmap;var a=g.fromContainerPixelToLatLng(new GPoint(310,50));var b=g.fromContainerPixelToLatLng(new GPoint(310,200));g.panTo(new GLatLng(m.lat-(a.lat()-b.lat()),m.lng));m.container.scale(m.container.getWidth(),100,{callback:function(){this.map.gmap.checkResize();this.button.removeClass("close");this.button.addClass("open");this.state=0;this.fireEvent('close',this);},scope:this});if(m.control){m.control.hide();}}});To.MapUtility={getBoundsUrl:function(b){return b.getSouthWest().toUrlValue()+'|'+
b.getNorthEast().toUrlValue();},getZoom:function(a){switch(a){case 1:return 6;case 2:return 8;case 3:return 10;case 4:return 13;case 5:return 15;case 6:return 16;case 7:return 17;case 8:return 17;case 9:return 17;default:return 10;}}};To.Math={min:function(){var l=arguments.length;if(l<=0){return null;}
var m=arguments[0];for(var i=1;i<l;i++){if(arguments[i]<m){m=arguments[i];}}
return m;},max:function(){var l=arguments.length;if(l<=0){return null;}
var m=arguments[0];for(var i=1;i<l;i++){if(arguments[i]>m){m=arguments[i];}}
return m;}};To.MiniTabs=function(config){Ext.apply(this,config);if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
To.MiniTabs.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.MiniTabs,Ext.util.Observable,{_currentLink:null,_currentRow:null,_ignoreEvents:false,_onMouseOver:function(e){if(this._ignoreEvents){return false;}
this._ignoreEvents=true;var a=new Ext.Element(e.getTarget('a',3,true));if(a&&!a.hasClass('inactive')){var r=Ext.get(To.History.getHash(a.dom.href));if(r&&r!==this._currentRow){if(this._currentLink){this._currentLink.removeClass('active');}
if(this._currentRow){this._currentRow.removeClass('visible');this._currentRow.addClass('hidden');}
this._currentLink=a;this._currentRow=r;a.addClass('active');r.addClass('visible');r.removeClass('hidden');}}
this._ignoreEvents=false;},_initialize:function(){var c=this.container;var a=c.select('thead a',true);this._currentLink=c.child('thead a.active');if(this._currentLink){this._currentRow=Ext.get(To.History.getHash(this._currentLink.dom.href));}
if(a){a.on('mouseover',this._onMouseOver,this);a.on('click',function(e){e.stopEvent();});}}});To.Overlay=function(config){Ext.apply(this,config);if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
this.addEvents('open','close');To.Overlay.superclass.constructor.call(this,config);var c=this.container;var h=c.child('div');this.button=h.child('a.btn_show_overlay');h.on('click',this._onToggle,this);this.overlay=c.child('.to_overlay').setVisibilityMode(Ext.Element.DISPLAY);if(!this.direct){this.overlay.select('a').on('click',this._onSelect,this);}};Ext.extend(To.Overlay,Ext.util.Observable,{open:function(){if(!this.overlay.isVisible()){this.overlay.show();if(this.button){this.button.addClass('close');}
if(this.anchor){var h=this.container.child('div');this.overlay.alignTo(h,this.anchor);if(!this.anchored){this.overlay.anchorTo(h,this.anchor);this.anchored=true;}}
this.fireEvent('open',this);Ext.getBody().on('click',this._onClick,this);}
return this;},close:function(){if(this.overlay.isVisible()){this.overlay.hide();if(this.button){this.button.removeClass('close');}
this.fireEvent('close',this);Ext.getBody().un('click',this._onClick,this);}
return this;},_onToggle:function(e){e.stopEvent();if(this.overlay.isVisible()){this.close();}else{this.open();}},_onClick:function(e){var t=e.getTarget('.to_overlay');if(!t||t.id!==this.overlay.id){this.close();}}});To.Paginable=function(config){Ext.apply(this,config);if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
To.Paginable.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.Paginable,Ext.util.Observable,{_state:0,_onPage:function(paginator,page){if(this._state===0){this._state=1;this._paginator.showLoading();this._sendRequest(page);}},_sendRequest:function(page){},_successListener:function(r){r=Ext.decode(r.responseText);Ext.DomHelper.overwrite(this.container,r.html);this._registerPaginator();this._state=0;},_failureListener:function(r){this._paginator.hideLoading();this._state=0;To.util.Growl.error('Unable to load data from server');},_initialize:function(){this._registerPaginator();},_registerPaginator:function(){if(this._paginator){this._paginator.destructor();delete this._paginator;this._paginator=null;}
this._paginator=new To.Paginator({container:this.container.child('div.to_pagination'),listeners:{gotoPage:this._onPage,scope:this}});}});To.PaginableSimple=function(config){To.PaginableSimple.superclass.constructor.call(this,config);};Ext.extend(To.PaginableSimple,To.Paginable,{_sendRequest:function(page){var p=Ext.apply(this.params||{},{page:page});Ext.Ajax.request({url:this.url||'',method:'GET',params:p,scope:this,success:this._successListener,failure:this._failureListener});}});To.Paginator=function(config){Ext.apply(this,config,{arrows:false,name:'page'});if(!this.container instanceof Ext.Element){this.container=new Ext.Element(this.container);}
this.addEvents('gotoPage');To.Paginator.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.Paginator,Ext.util.Observable,{destructor:function(){if(this.history){To.History.un('change',this._onHistory,this);}},prev:function(){var a=this.container.child('a.to_prev_arrow');if(a){var v=To.History.getHash(a.dom.href);if(v!==''){this._saveHistory(v);this.fireEvent('gotoPage',this,v);}}},next:function(){var a=this.container.child('a.to_nxt_arrow');if(a){var v=To.History.getHash(a.dom.href);if(v!==''){this._saveHistory(v);this.fireEvent('gotoPage',this,v);}}},hasPrev:function(){return(this.container.child('a.to_prev_arrow')!==null);},hasNext:function(){return(this.container.child('a.to_nxt_arrow')!==null);},showLoading:function(){if(this.container){this.container.addClass('loading');}},hideLoading:function(){if(this.container){this.container.removeClass('loading');}},getCurrentPage:function(){if(this.container){var s=this.container.child('a.selected');if(s){return To.History.getHash(s.dom.href);}}
return null;},_onClick:function(e){e.stopEvent();var p=0;var a=e.getTarget('a');if(a!==null){p=To.History.getHash(a.href);}
this._saveHistory(p);this.fireEvent('gotoPage',this,p);},_onHistory:function(values){var c=this.getCurrentPage()||1;var p=values[this.name]||null;if(p&&p!=c){this.fireEvent('gotoPage',this,data.page);}},_initialize:function(){this.container.select('a').on('click',this._onClick,this);if(this.arrows){var n=new Ext.KeyNav(Ext.getDoc(),{'left':this.prev,'right':this.next,scope:this});}
if(this.bookmark){var p=To.History.getLast(this.name);var c=this.getCurrentPage()||1;if(p&&p!=c){this._saveHistory(c);}}
if(this.history){To.History.on('change',this._onHistory,this);}},_saveHistory:function(p){if(this.history||this.bookmark){To.History.add(this.name,p).save();}}});To.Search=function(config){Ext.apply(this,config);if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
this.addEvents('submit','reset','suggestion');To.Search.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.Search,Ext.util.Observable,{_state:null,reset:function(){this._hideSuggestions();this._input.dom.value='';this._button.removeClass('cancel');this._saveState();this.fireEvent('reset',this);},_onSubmit:function(e){e.stopEvent();var i=this._input;if(i&&!i.hasClass('to_hint')){var v=i.getValue();if(v!==''){this._button.addClass('cancel');this._saveState();this.fireEvent('submit',this,v);}else{this._saveState();this._onReset(e);}}else{this._hideSuggestions();this._button.removeClass('cancel');}},_onReset:function(e){e.stopEvent();this.reset();},_onFocus:function(e){e.stopEvent();var i=this._input;if(i){if(i.hasClass('to_hint')){i.removeClass('to_hint').dom.value='';}
if(i.dom.value!==''){setTimeout(function(){i.dom.select();},100);}}},_onBlur:function(e){this._restoreState();},_onSuggestion:function(e,t,o){if(e){e.stopEvent();}
var d=null;if(o&&o.data){d=o.data;}
this._hideSuggestions();this._input.dom.value='';this._button.removeClass('cancel');this._saveState();this.fireEvent('suggestion',this,d);},_addSuggestion:function(l,d){var e=Ext.DomHelper.append(this._items,'<p><a href="#">'+l+'</a></p>',true);if(e){e.child('a').on('click',this._onSuggestion,this,{data:d||null});}
return this;},_showSuggestions:function(){var s=this._suggestions;if(s&&!s.isVisible()){s.slideIn();}
return this;},_hideSuggestions:function(){var s=this._suggestions;if(s&&s.isVisible()){s.slideOut('t',{callback:this._removeSuggestions,scope:this});}},_removeSuggestions:function(){Ext.DomHelper.overwrite(this._items,'');return this;},_initialize:function(){var id=this.container.id;this._form=Ext.get(id+'_form');this._input=Ext.get(id+'_query');this._suggestions=Ext.get(id+'_suggestions');this._items=Ext.get(id+'_suggestions_items');if(this._suggestions){this._suggestions.setVisibilityMode(Ext.Element.DISPLAY);}
this._form.on('submit',this._onSubmit,this);this._input.on('focus',this._onFocus,this);this._input.on('blur',this._onBlur,this);this._button=this.container.child('a.to_btn_search');this._button.on('click',function(e){if(this._button.hasClass('cancel')){this._onReset(e);}else{this._onSubmit(e);}},this);if(!this._input.hasClass('to_hint')){this._saveState();}},_saveState:function(){this._state={input:this._input.dom.value,cancel:this._button.hasClass('cancel')};},_restoreState:function(){if(this._state){this._input.dom.value=this._state.input;if(this._state.cancel){this._button.addClass('cancel');}else{this._button.removeClass('cancel');}}}});To.Select=function(config){config=Ext.apply({name:''},config);this.addEvents('change');To.Select.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.Select,To.Overlay,{reset:function(){var l=this.getDefaultLabel();var v=this.getDefaultValue();if(l&&v&&(l!==this.getCurrentLabel()||v!==this.getCurrentValue())){this._update(l,v,true,true);this.highlight();}
return this;},highlight:function(){To.Fx.blink(this.label,'FF3891');return this;},getDefaultLabel:function(){if(typeof this.defaultLabel==='undefined'){this.defaultLabel=null;var v=this.getDefaultValue();if(v){var a=Ext.get('to_select_'+this.name+'_'+v);if(a){this.defaultLabel=this._getLabel(a);}}}
return this.defaultLabel;},getDefaultValue:function(){if(typeof this.defaultValue==='undefined'){var d=this.overlay.child('a.default');if(d!==null){this.defaultValue=To.History.getHash(d.dom.href);}else{this.defaultValue=null;}}
return this.defaultValue;},getCurrentLabel:function(){if(this.label){return this.label.dom.innerHTML;}else{return null;}},getCurrentValue:function(){if(this.value){return this.value.dom.innerHTML;}else{return null;}},_onSelect:function(e){e.stopEvent();var t=e.getTarget('a',10,true);if(!t){return;}
var l=this._getLabel(t);var v=To.History.getHash(t.dom.href);if(v!=this.getCurrentValue()){this._update(l,v,true,true);}
this.close();},_onHistory:function(values){var v=this.initValue;if(values[this.name]){v=values[this.name];}
if(v!=this.getCurrentValue()){var l=this._getLabel(Ext.get('to_select_'+this.name+'_'+v));this._update(l,v,true,false);}},_initialize:function(){var c=this.container;this.label=Ext.get('to_select_'+this.name+'_label');this.value=Ext.get('to_select_'+this.name+'_value');if(this.bookmark){var v=To.History.getLast(this.name);if(v&&this.value!=this.getCurrentValue()){var a=Ext.get('to_select_'+this.name+'_'+v);if(a){this._update(this._getLabel(a),v,false,false);}}}
this.initValue=this.getCurrentValue();this.initLabel=this.getCurrentLabel();if(this.history){To.History.on('change',this._onHistory,this);}},_getLabel:function(el){var l=el.child('span');if(l!==null){l=l.dom.innerHTML;}else{l=el.dom.innerHTML;}
return l;},_update:function(l,v,n,h){this.label.dom.innerHTML=l;this.value.dom.innerHTML=v;if((this.history||this.bookmark)&&h){To.History.add(this.name,v).save();}
if(n){this.fireEvent('change',this,l,v);}}});To.Tab=function(config){Ext.apply(this,config);To.Tab.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.Tab,Ext.util.Observable,{container:null,button:null,getID:function(){return this.container.id;},show:function(){this.container.show();this.button.setSelected(true);},hide:function(){this.container.hide();this.button.setSelected(false);},isVisible:function(){return this.container.isVisible();},_initialize:function(){this.container.setVisibilityMode(Ext.Element.DISPLAY);}});To.Tabs=function(config){Ext.apply(this,config);this.addEvents('activate','deactivate');To.Tabs.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.Tabs,Ext.util.Observable,{container:null,_buttons:null,_tabs:null,current:null,collapse:function(){if(!this.isCollapsed()){this.container.slideOut('t',{useDisplay:true});}},expand:function(){if(this.isCollapsed()){this.container.slideIn('t',{useDisplay:true});}},isCollapsed:function(){return!this.container.isVisible();},showTab:function(id){var c=this._current;var t=this._tabs[id];if(t&&c!==t){if(c){c.hide();}
t.show();this._current=t;}},_onClick:function(g,b){this.showTab(To.History.getHash(b.getAnchor().dom.href));},_createTab:function(config){return new To.Tab(config);},_initialize:function(){this._tabs={};var l=this.container.child('ul');if(l){this._buttons=To.ui.ButtonGroupBuilder.buildFromList(l);this._buttons.on('click',this._onClick,this);var o=this._buttons.getButtons();for(var i in o){if(o.hasOwnProperty(i)){var a=o[i].getAnchor();var id=To.History.getHash(a.dom.href);var t=this._createTab({container:Ext.get(id),button:o[i]});this._tabs[id]=t;if(t.isVisible()){this._current=t;}}}}}});To.util.Array={count:function(o){if(Ext.isArray(o)){return o.length;}else if(typeof o==='object'){var n=0;for(var i in o){if(o.hasOwnProperty(i)){n++;}}
return n;}else{return 0;}},find:function(o,k){for(var i in o){if(o.hasOwnProperty(i)){if(i===k){return o[i];}else if(typeof o[i]==='object'){var v=this.find(o[i],k);if(v!==null){return v;}}}}
return null;}};To.util.Cookie={getCookies:function(){var cookies={};var c=document.cookie+";";var re=/\s?(.*?)=(.*?);/g;var matches;while((matches=re.exec(c))!==null){var name=matches[1];var value=matches[2];cookies[matches[1]]=matches[2];}
return cookies;}};To.util.Form={mask:function(f){var a={'DISABLED':true};f.select('input').set(a);f.select('textarea').set(a);},unmask:function(f){f.select('input').each(this._unmask);f.select('textarea').each(this._unmask);},getField:function(f,n){n='[name='+n+']';return f.child('input'+n+',textarea'+n+',select'+n);},showFieldErrors:function(f,es){var id='error_'+f.id;var h='<ul class="errors" id="'+id+'">';for(var x in es){if(es.hasOwnProperty(x)){h+='<li>'+es[x]+'</li>';}}
h+='</ul>';f.addClass('error');var p=f.parent();if(p&&p.is('.x-form-field-wrap')){p.insertHtml('afterEnd',h,false);}else{p.insertHtml('beforeEnd',h,false);}},showFormErrors:function(f,es){for(var x in es){if(es.hasOwnProperty(x)){var e=this.getField(f,x);if(e){this.showFieldErrors(e,es[x]);}}}},hideFieldErrors:function(f){var e=Ext.get('error_'+f.dom.id);if(e){e.remove();}
f.removeClass('error');},hideFormErrors:function(f){f.select('input,textarea,select').each(this.hideFieldErrors);},_unmask:function(f){f.dom.disabled=false;}};To.util.Growl={_queue:[],_delay:5000,info:function(m,o){return this._showMessage(m,'info',o);},warning:function(m,o){return this._showMessage(m,'warning',o);},error:function(m,o){return this._showMessage(m,'error',o);},show:function(m,l,o){return this._showMessage(m,l,o);},loadMessages:function(){Ext.Ajax.request({url:'/api/ajax/notification',params:{method:'getMessages'},scope:this,success:function(r,o){r=Ext.decode(r.responseText).response;if(r){if(Ext.isArray(r)&&r.length>0){this._showMessages(r);}}}});},_showMessage:function(text,level,options){options=options||{};var q=this._queue;var last=0;if(q.length>0){last=q[q.length-1];}
var t=10+Ext.getDoc().getScroll().top+(last*83);var h='<div class="growl" style="visibility: hidden; top: '+t+'px;">'+text+'</div>';var e=Ext.DomHelper.insertFirst(document.body,h,true);e.fadeIn();e.on('click',function(){e.fadeOut({remove:true});q.shift();});if(options.close!==false){(function(){e.fadeOut({remove:true});q.shift();}).defer(this._delay);}
q.push(last+1);},_showMessages:function(ms){if(Ext.isArray(ms)){for(var i in ms){if(ms.hasOwnProperty(i)){this._showMessage(ms[i].text,ms[i].level,ms[i].options);}}}},_hideMessages:function(){Ext.getBody().select('.growl').fadeOut({remove:true});}};To.util.Queue=function(){this._queue=[];this._space=0;};To.util.Queue.prototype={size:function(){return this._queue.length-this._space;},isEmpty:function(){return(this._queue.length===0);},push:function(e){this._queue.push(e);return this;},pop:function(){var e=undefined;if(!this.isEmpty()){e=this._queue[this._space];if(++this._space*2>=this._queue.length){this._queue=this._queue.slice(this._space);this._space=0;}}
return e;}};To.util.QueueActions=Ext.extend(To.util.Queue,{push:function(func,args,scope){return To.util.QueueActions.superclass.push.call(this,{func:func,args:args,scope:scope});},exec:function(){var c;while((c=this.pop())){c.func.apply(c.scope,c.args);}
return this;}});To.validate.Field=function(config){Ext.apply(this,config);if(this.name===null){this.name=this.form.id;}
this._options={url:root+'api/ajax/form?method=validateField&name='+this.name,method:'POST',params:{},scope:this,success:this._onSuccess,failure:this._onFailure};this._task=new Ext.util.DelayedTask(this.validate,this);this.field.on(this.event,this._onChange,this);};To.validate.Field.prototype={form:null,field:null,name:null,event:'keyup',delay:500,_task:null,_options:{},errorText:'Unable to validate this field.',validate:function(){var o=this._options;var n=this.field.dom.name;o.params[n]=this.field.getValue();Ext.Ajax.request(o);},_onChange:function(e){if(!e.isNavKeyPress()){this._task.delay(this.delay);}},_onSuccess:function(r){To.util.Form.hideFieldErrors(this.field);try{r=Ext.decode(r.responseText).response;if(r.valid!==true){To.util.Form.showFieldErrors(this.field,r.errors);}}catch(e){To.util.Form.showFieldErrors(this.field,{'':this.errorText});}},_onFailure:function(r){To.util.Form.showFieldErrors(this.field,{'':this.errorText});}};To.validate.Form=function(config){Ext.apply(this,config);this._init();};To.validate.Form.prototype={form:null,name:null,_submit:null,errorText:'Unable to validate this form.',retryText:'Please, try again.',validate:function(){var values=Ext.Ajax.serializeForm(this.form.dom);this.mask();Ext.Ajax.request({url:'/api/ajax/form?method=validateForm&formName='+this.name,params:values,method:'POST',success:this._onSuccess,failure:this._onFailure,scope:this});},mask:function(){To.util.Form.mask(this.form);if(this._submit){this._submit.parent('div.to_buttons').addClass('load');}},unmask:function(){To.util.Form.unmask(this.form);if(this._submit){this._submit.parent('div.to_buttons').removeClass('load');}},_onSubmit:function(e){e.stopEvent();this.validate();},_onSuccess:function(r){try{r=Ext.decode(r.responseText).response;this.unmask();To.util.Form.hideFormErrors(this.form);if(!r.valid){To.util.Form.showFormErrors(this.form,r.errors);}else{document.forms[this.form.dom.id].submit();}}catch(e){this._error();}},_onFailure:function(){this.unmask();this._error();},_init:function(){var f=this.form;if(!this.name){this.name=f.id;}
f.select('input[type="submit"]').on('click',this._onSubmit,this);var s=Ext.get(this.form.id+'_submit');if(s){s.on('click',this._onSubmit,this);}
this._submit=s;},_error:function(){var m=this.errorText+'<br /><br /><b>'+this.retryText+'</b>';To.util.Growl.error(m);}};To.hook.Handler=function(config){Ext.apply(this,config);};To.hook.Handler.prototype={callback:null,scope:null,wait:0,done:function(){this.wait--;if(this.wait===0){if(this.callback){this.callback.apply(this.scope||this,[]);}}}};To.hook.Hook=function(config){this._listeners=[];};To.hook.Hook.prototype={_listeners:null,addListener:function(f,s){this._listeners.push(this._createListener(f,s));},findListener:function(f,s){s=s||this;var ls=this._listeners;for(var i=0,len=ls.length;i<len;i++){var l=ls[i];if(l.func==f&&l.scope==s){return i;}}
return-1;},removeListener:function(f,s){var i=this.findListener(f,s);if(i!==-1){this._listeners.splice(i,1);}},fire:function(args,callback,scope){var ls=this._listeners;var len=ls.length;var r;if(len>0){var h=new To.hook.Handler({callback:callback,scope:scope,wait:len});args=[h].concat(args);for(var i=0;i<len;i++){r=ls[i].func.apply(ls[i].scope,args);if(r===true){h.done();}}}else{if(callback){callback.apply(scope||this,[]);}}},_createListener:function(f,s){s=s||this;return{func:f,scope:s};}};To.hook.Manager={_hooks:{},on:function(n,f,s){var h=this._hooks[n];if(h===undefined){h=new To.hook.Hook({name:n});this._hooks[n]=h;}
h.addListener(f,s);},un:function(n,f,s){if(this._hooks[n]){this._hooks[n].removeListener(f,s);}},notify:function(n,a,c,s){var h=this._hooks[n];if(h){h.fire(a,c,s);}else{if(c){c.apply(s||this);}}}};To.api.Comment={addFeedback:function(i,s,f,c){this._request({method:"addFeedback",comment_id:i},s,f,c);},removeFeedback:function(i,s,f,c){this._request({method:"removeFeedback",comment_id:i},s,f,c);},setChecked:function(i,s,f,c){this._request({method:"setChecked",comment_id:i},s,f,c);},removeComment:function(i,s,f,c){this._request({method:"removeComment",comment_id:i},s,f,c);},_request:function(p,s,f,c){Ext.Ajax.request({url:'/api/ajax/comment/',method:'GET',params:p,success:s,failure:f,scope:c});}};To.api.Facebook={login:function(s,f,c){this._request({method:'login'},s,f,c);},_request:function(p,s,f,c){Ext.Ajax.request({url:'/api/ajax/facebook/',method:'GET',params:p,success:s,failure:f,scope:c});}};To.ui.Button=function(config){Ext.apply(this,config);this.addEvents('click');To.ui.Button.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.ui.Button,Ext.util.Observable,{container:null,_anchor:null,_superscript:null,getID:function(){return this.container.id;},getAnchor:function(){return this._anchor;},setSelected:function(s){if(this._anchor){if(s){this._anchor.addClass('selected');}else{this._anchor.removeClass('selected');}}
return this;},getSelected:function(){return(this._anchor&&this._anchor.hasClass('selected'));},setDisabled:function(d){if(this._anchor){if(d){this._anchor.addClass('off').removeClass('selected');}else{this._anchor.removeClass('off');}}},getDisabled:function(){return(this._anchor&&this._anchor.hasClass('off'));},setSuperscript:function(v){if(this._superscript){this._superscript.dom.innerHTML=v;}
return this;},getSuperscript:function(){if(this._superscript){return this._superscript.dom.innerHTML;}else{return null;}},hasSuperscript:function(){return(this._superscript);},_onClick:function(e){e.stopEvent();if(this._anchor){this._anchor.blur();}
this.fireEvent('click',this,this._anchor);},_initialize:function(){var c=this.container;var a=c.child('a');if(a){a.on('click',this._onClick,this);this._anchor=a;}
this._superscript=c.child('.superscript');}});To.ui.ButtonGroup=function(config){Ext.apply(this,config);this.addEvents('click');To.ui.ButtonGroup.superclass.constructor.call(this,config);this._buttons={};};Ext.extend(To.ui.ButtonGroup,Ext.util.Observable,{_buttons:null,_current:null,addButton:function(b){if(b.getSelected()){this._current=b;}
this._buttons[b.getID()]=b;b.on('click',this._onClick,this);return this;},clickButton:function(id){if(this._current===null||this._current.getID()!==id){var b=this._buttons[id];if(b){if(this._current!==null){this._current.setSelected(false);}
b.setSelected(true);this._current=b;this.fireEvent('click',this,b);}}
return this;},getCurrent:function(){return this._current;},getButtons:function(){return this._buttons;},_onClick:function(b,a){this.clickButton(b.getID());}});To.ui.ButtonGroupBuilder={buildFromList:function(c){var g=new To.ui.ButtonGroup();c.select('li',true).each(function(e){if(e.hasClass('clear')){return;}
g.addButton(new To.ui.Button({container:e}));});return g;}};To.ui.ExpandableGallery=function(config){To.ui.ExpandableGallery.superclass.constructor.call(this,config);this.on('open',this._onOpen,this);};Ext.extend(To.ui.ExpandableGallery,To.Expandable,{_galleryHeight:null,_onOpen:function(){var g=this._getBodyGallery();if(g){if(this._galleryHeight===null||this._galleryHeight<g.getHeight()){this._galleryHeight=g.getHeight();}
g.setHeight(this._galleryHeight);}},_sendRequest:function(){var p=Ext.apply(this.params||{},{start:this.start,limit:this.limit});Ext.Ajax.request({url:this.url||'',method:'GET',params:p,scope:this,success:this._successListener,failure:this._failureListener});},_successListener:function(r){To.ui.ExpandableGallery.superclass._successListener.call(this,r);var g=this._getBodyGallery();if(g){if(this._galleryHeight===null||this._galleryHeight<g.getHeight()){this._galleryHeight=g.getHeight();}
g.setHeight(this._galleryHeight);}},_getBodyGallery:function(){var b=this.container.child('.to_expandable_body');if(b){return b.child('.to_tmb_gallery');}}});To.ui.Item=function(config){Ext.apply(this,config,{mlisteners:[]});if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
To.ui.Item.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.ui.Item,Ext.util.Observable,{destructor:function(){var c=this.container;c.removeListener('mouseover',this._onMouseover,this);c.removeListener('mouseout',this._onMouseout,this);if(this.add){this.add.removeListener('click',this._onAdd,this);}
for(var i=0,l=this.mlisteners.length;i<l;i++){GEvent.removeListener(this.mlisteners[i]);}},_onAdd:function(e){e.stopEvent();},_onMouseover:function(e){if(this.marker){this.marker.showTooltip();}},_onMouseout:function(e){if(this.marker){this.marker.hideTooltip();}},_onMarkerMouseover:function(){this.container.addClass('active');},_onMarkerMouseout:function(){this.container.removeClass('active');},_initialize:function(){this.add=this.container.child('.to_cmd .to_add');this.container.hover(this._onMouseover,this._onMouseout,this);if(this.add){this.add.on('click',this._onAdd,this);}
if(this.marker){var i=this;var m=i.marker;this.mlisteners.push(GEvent.addListener(m,'mouseover',function(m){i._onMarkerMouseover();}));this.mlisteners.push(GEvent.addListener(m,'mouseout',function(m){i._onMarkerMouseout();}));}}});To.ui.ItemManager=function(config){Ext.apply(this,config||{});this._items=[];};To.ui.ItemManager.prototype={_items:null,addItem:function(item,key){key=key||this._getNextKey();this._items[key]=item;return key;},removeItem:function(key){if(this._items[key]){var i=this._items[key];delete this._items[key];i.destructor();}},hasItem:function(key){if(this._items[key]){return true;}else{return false;}},getItem:function(key){return this._items[key]||null;},getItems:function(){return this._items;},clearItems:function(){for(var key in this._items){if(this._items[key]instanceof To.ui.Item){this.removeItem(key);}}
this._items={};},count:function(){return To.util.Array.count(this._items);},_getNextKey:function(){return("unnamed_"+this._nextKey++);}};To.ui.OverlayVote=function(config){Ext.apply(this,config);};To.ui.OverlayVote.prototype={container:null,fields:[],show:function(a){var c=this.container;a=new Ext.Element(a);a=a.parent('div');for(var i=1,l=arguments.length;i<l;i++){var f=this.fields[i-1];var v=arguments[i];var e=Ext.get(this.container.id+'_'+f);if(e){e.setVisibilityMode(Ext.Element.DISPLAY);if(v!==''&&v>0){e.show().child('span').setStyle('width',(v*20)+'%');}else{e.hide();}}}
c.setStyle('top',(a.getY()+a.getHeight()+10)+'px');c.setStyle('left',a.getX()+'px');c.show();},hide:function(){if(this.container){this.container.hide();}},_initialize:function(){this.container.setVisibilityMode(Ext.Element.DISPLAY);}};To.ui.OverlayVoteEdit=function(config){Ext.apply(this,config);this.addEvents('change');To.ui.OverlayVoteEdit.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.ui.OverlayVoteEdit,Ext.util.Observable,{container:null,resource_type:null,resource_id:null,url:'',fields:[],_votes:{},show:function(){this.container.slideIn('t',{useDisplay:true});},hide:function(){this.container.slideOut('t',{useDisplay:true});},_onMouseOver:function(e,t){var f=t.id.split('_');f=f[f.length-2];var v=t.innerHTML;this._updateUserFieldClass(f,0,'voted');this._updateUserFieldClass(f,v,'voting');},_onMouseOut:function(e,t){var f=t.id.split('_');f=f[f.length-2];var v=t.innerHTML;this._updateUserFieldClass(f,0,'voting');this._updateUserFieldClass(f,this._votes[f],'voted');},_onMouseClick:function(e,t){var p=t.id.split('_');f=p[p.length-2];var v=t.innerHTML;if(f=='remove'){this._removeVote(p[p.length-1]);}else{this._addVote(f,v);}},_onAddSuccess:function(r,o){r=Ext.decode(r.responseText).response;var f=o.params.field;var v=o.params.value;this._votes[f]=v;this._updateUserField(f,v);if(f=='general'){for(var i=0,l=this.fields.length;i<l;i++){Ext.get(this.container.id+'_user_'+this.fields[i]).show();}}
this._updateCommunity(r);this.fireEvent('change',this,r);To.hook.Manager.notify('vote::voteAdd',[this,{resource_type:this.resource_type,resource_id:this.resource_id,vote_field:o.params.field,vote_value:o.params.value}]);},_onAddFailure:function(r,o){var f=o.params.field;this._updateUserFieldClass(f,this._votes[f],'voted');To.util.Growl.error('Unable to add the vote');},_onRemoveSuccess:function(r,o){r=Ext.decode(r.responseText).response;var f=o.params.field;this._votes[f]=0;this._updateUserField(f,0);if(f=='general'){for(var i=0,l=this.fields.length;i<l;i++){if(this.fields[i]!=='general'){this._votes[this.fields[i]]=0;Ext.get(this.container.id+'_user_'+this.fields[i]).hide();this._updateUserField(this.fields[i],0);}}}
this._updateCommunity(r);this.fireEvent('change',this,r);},_onRemoveFailure:function(r){To.util.Growl.error('Unable to remove the vote');},_initialize:function(){var f=this.fields;var id=this.container.id;var i;var e;var v;for(i=0,l=f.length;i<l;i++){this._votes[f[i]]=0;for(v=1;v<=5;v++){e=Ext.get(id+'_user_'+f[i]+'_'+v);if(e){e.on('mouseover',this._onMouseOver,this);e.on('mouseout',this._onMouseOut,this);e.on('click',this._onMouseClick,this);if(e.hasClass('voted')){this._votes[f[i]]=v;}}}
e=Ext.get(id+'_remove_'+f[i]);if(e){e.on('click',this._onMouseClick,this,{stopEvent:true});}}},_updateUserField:function(f,v){if(v>0){this._updateUserFieldClass(f,v,'voted');}else{this._updateUserFieldClass(f,0,'voted');}
var r=Ext.get(this.container.id+'_remove_'+f);if(r){if(v>0){r.show();}else{r.hide();}}},_updateUserFieldClass:function(f,v,c){var id=this.container.id+'_user_'+f;var e;for(var i=1;i<=5;i++){e=Ext.get(id+'_'+i);if(i<=v){e.addClass(c);}else{e.removeClass(c);}}},_updateCommunity:function(v){for(var f in v){if(v.hasOwnProperty(f)){this._updateCommunityField(f,v[f]);}}},_updateCommunityField:function(f,v){var e=Ext.get(this.container.id+'_community_'+f);if(e){e.setStyle('width',(v*20)+'%');}},_addVote:function(f,v){this._updateUserFieldClass(f,0,'voting');this._updateUserFieldClass(f,v,'voted');Ext.Ajax.request({url:this.url,method:'GET',params:{method:'addVote',field:f,value:v},scope:this,success:this._onAddSuccess,failure:this._onAddFailure});},_removeVote:function(f){Ext.Ajax.request({url:this.url,method:'GET',params:{method:'removeVote',field:f},scope:this,success:this._onRemoveSuccess,failure:this._onRemoveFailure});}});To.comment.Comment=function(config){Ext.apply(this,config,{collapsible:true,expandable:true});if(this.container instanceof Ext.Element===false){this.container=new Ext.Element(this.container);}
this.addEvents('expand','collapse','edit','remove','feedback');To.comment.Comment.superclass.constructor.call(this,config);var v=this.container.dom.id.split('_');if(v.length>0){this.comment_id=v[v.length-1];}
if(this.collapsible||this.expandable){this.container.child('h4 a').on('click',function(e){e.stopEvent();this.toggleCollapse();},this);}
var f=this.container.child('.to_feedback_action');if(f!==null){f.child('.add').setVisibilityMode(Ext.Element.DISPLAY).on('click',this._onFeedbackAdd,this);f.child('.remove').setVisibilityMode(Ext.Element.DISPLAY).on('click',this._onFeedbackRemove,this);}
var a=this.container.child('.to_cmt_ftr');if(a!==null){if(a.child('a.edit')){a.child('a.edit').on('click',this._onCommentEdit,this);}
if(a.child('a.remove')){a.child('a.remove').on('click',function(e){e.stopEvent();this.remove(true);},this);}}};Ext.extend(To.comment.Comment,Ext.util.Observable,{_animating:false,comment_id:null,ignoreFeedback:false,getCommentId:function(){return this.comment_id;},expand:function(){if(this.expandable&&!this._animating){var c=this._getCollapsible();if(!c.isVisible()){this._animating=true;c.slideIn('t',{useDisplay:true,scope:this,callback:function(){this._animating=false;}});}
this.fireEvent('expand',this);}},collapse:function(){if(this.collapsible&&!this._animating){var c=this._getCollapsible();if(c.isVisible()){this._animating=true;c.slideOut('t',{useDisplay:true,scope:this,callback:function(){this._animating=false;}});}
this.fireEvent('collapse',this);}},isCollapsed:function(){return!this._getCollapsible().isVisible();},toggleCollapse:function(){if(this.isCollapsed()){this.expand();}else{this.collapse();}},remove:function(s){if(s){To.api.Comment.removeComment(this.comment_id,this._onCommentRemoveSuccess,this._onCommentRemoveFailure,this);}else{this._onCommentRemoveSuccess();}},_onFeedbackAdd:function(e){e.stopEvent();if(this.ignoreFeedback){return;}
this.ignoreFeedback=true;this.container.child('.to_feedback_action').addClass('load');To.api.Comment.addFeedback(this.comment_id,this._onFeedbackAddSuccess,this._onFeedbackAddFailure,this);},_onFeedbackAddSuccess:function(){this._updateFeedback('add');this.fireEvent('feedback',this,'add');this.ignoreFeedback=false;},_onFeedbackAddFailure:function(){To.util.Growl.error('Unable to add your feedback');this.ignoreFeedback=false;},_onFeedbackRemove:function(e){e.stopEvent();if(this.ignoreFeedback){return;}
this.ignoreFeedback=true;this.container.child('.to_feedback_action').addClass('load');To.api.Comment.removeFeedback(this.comment_id,this._onFeedbackRemoveSuccess,this._onFeedbackRemoveFailure,this);},_onFeedbackRemoveSuccess:function(){this._updateFeedback('remove');this.fireEvent('feedback',this,'remove');this.ignoreFeedback=false;},_onFeedbackRemoveFailure:function(){To.util.Growl.error('Unable to remove your feedback');this.ignoreFeedback=false;},_onCommentEdit:function(e){e.stopEvent();this.fireEvent('edit',this);},_onCommentRemoveSuccess:function(){if(this.container!==null){this.container.slideOut('t',{useDisplay:true,remove:true});this.container=null;}
this.fireEvent('remove',this);},_onCommentRemoveFailure:function(){To.util.Growl.error('Unable to remove your comment');},_updateFeedback:function(change){var f=this.container.child('.to_feedback');var a=this.container.child('.to_feedback_action');var n=parseInt(f.dom.innerHTML,10);a.select('span',true).setVisibilityMode(Ext.Element.DISPLAY);f.dom.innerHTML=n+(change=='add'?1:-1);if(change=='add'){a.addClass('nostar').removeClass('star').removeClass('load');a.child('.add').hide();a.child('.remove').show();if(n===0){f.removeClass('disabled');}}else{a.addClass('star').removeClass('nostar').removeClass('load');a.child('.remove').hide();a.child('.add').show();if(n===1){f.addClass('disabled');}}},_getCollapsible:function(){return this.container.child('.to_comment_body');}});To.comment.Form=function(config){this.addEvents('cancel','success');To.comment.Form.superclass.constructor.call(this,config);this._initialize();};Ext.extend(To.comment.Form,To.Form,{resource_type:'',resource_id:0,_undo:{title:{hint:false,value:''},text:{hint:false,value:''}},open:function(scroll){if(this.isClosed()){var o={useDisplay:true};if(scroll===true){Ext.apply(o,{callback:function(e){e.scrollIntoView();}});}
this.container.slideIn('t',o);}},close:function(){if(!this.isClosed()){this.container.slideOut('t',{useDisplay:true});}},isClosed:function(){return!this.container.isVisible();},reset:function(){var title=this._form.child('input[name="title"]');var text=this._form.child('textarea[name="text"]');title.dom.value='';text.dom.value='';this._saveState();},_onSubmit:function(e){e.stopEvent();var type=this.resource_type.toLowerCase();var title=this._form.child('input[name="title"]');var text=this._form.child('textarea[name="text"]');if(this._undo.title.value===title.getValue()&&this._undo.text.value===text.getValue())
{this.fireEvent('cancel',this);return;}
this.mask();Ext.Ajax.request({url:'/api/ajax/'+type+'/'+type+'_id/'+this.resource_id,params:{method:'addComment',title:(title.hasClass('to_hint')?'':title.getValue()),text:(text.hasClass('to_hint')?'':text.getValue())},method:'POST',scope:this,success:this._onSubmitSuccess,failure:this._onSubmitFailure});},_onSubmitSuccess:function(r){this.unmask();To.util.Form.hideFormErrors(this._form);this._saveState();this.fireEvent('success',this);r=Ext.decode(r.responseText).response;To.hook.Manager.notify('comment::commentAdd',[this,r]);},_onSubmitFailure:function(r){this.unmask();To.util.Form.hideFormErrors(this._form);try{r=Ext.decode(r.responseText);To.util.Form.showFormErrors(this._form,r.messages);}catch(e){To.util.Growl.error('Unable to add your comment. Please, try again.');}},_onReset:function(e){e.stopEvent();this._undoState();this.fireEvent('cancel',this);},_initialize:function(){this._form.on('submit',this._onSubmit,this);this._submit.on('click',this._onSubmit,this);this._reset.on('click',this._onReset,this);this._saveState();},_saveState:function(){var t;t=this._form.child('input[name="title"]');this._undo.title={hint:t.hasClass('to_hint'),value:t.getValue()};t=this._form.child('textarea[name="text"]');this._undo.text={hint:t.hasClass('to_hint'),value:t.getValue()};},_undoState:function(){var t;t=this._form.child('input[name="title"]');if(this._undo.title.hint){t.addClass('to_hint');}else{t.removeClass('to_hint');}
t.dom.value=this._undo.title.value;t=this._form.child('textarea[name="text"]');if(this._undo.text.hint){t.addClass('to_hint');}else{t.removeClass('to_hint');}
t.dom.value=this._undo.text.value;}});To.comment.Growable=function(config){this.addEvents('commentedit','commentremove','commentfeedback');To.comment.Growable.superclass.constructor.call(this,config);};Ext.extend(To.comment.Growable,To.Growable,{url:'',params:null,button:null,_lang:null,_sort:null,_comments:null,setLanguage:function(lang){this._lang=lang;},getLanguage:function(){return this._lang;},setSort:function(sort){this._sort=sort;},getSort:function(){return this._sort;},getComment:function(id){if(this._comments[id]){return this._comments[id];}else{return null;}},removeComment:function(id){var c=this._comments[id];if(c){c.remove(false);}},reloadComments:function(){if(this._state===0){this._state=1;this._showLoading();this._sendRequest(true);}},_sendRequest:function(reload){var p=this.params||{};if(reload){p.start=0;p.limit=this.start;}else{p.start=this.start;p.limit=this.limit;}
if(this._lang!==null){p.language=this._lang;}
if(this._sort!==null){p.sort=this._sort;}
Ext.Ajax.request({url:this.url,method:'GET',params:p,scope:this,success:(reload?this._onReloadSuccess:this._successListener),failure:this._failureListener});},_onMore:function(g,r,c){var m=r.metadata;if(m){if(this.button&&m.count){this.button.setSuperscript(m.count);}
this._registerComments(m);}},_onCommentEdit:function(c){this.fireEvent('commentedit',this,c);},_onCommentRemove:function(c){var id=c.getCommentId();var b=this.button;if(this._comments[id]){delete this._comments[id];this.start--;if(b){if(b.getSuperscript()>0){b.setSuperscript(b.getSuperscript()-1);}}
this.fireEvent('commentremove',this,c);}},_onCommentFeedback:function(c,a){this.fireEvent('commentfeedback',this,c,a);},_onReloadSuccess:function(r,o){var a=this.animation;this.animation=false;this._more=null;Ext.DomHelper.overwrite(this.container,'');this._successListener(r,o);this.animation=a;},_initialize:function(){To.comment.Growable.superclass._initialize.call(this);this._comments={};this.on('more',this._onMore,this);this.container.select('.to_comment',true).each(this._registerComment,this);},_registerComments:function(m){if(m&&m.rows){for(var i in m.rows){if(m.rows.hasOwnProperty(i)){var c=m.rows[i];var id;if(this._sort){id='to_'+this._sort+'_comment_'+c.comment_id;}else{id='to_comment_'+c.comment_id;}
var e=Ext.get(id);if(e){this._registerComment(e);}}}}},_registerComment:function(e){var c=new To.comment.Comment({container:e});c.on('edit',this._onCommentEdit,this);c.on('remove',this._onCommentRemove,this);c.on('feedback',this._onCommentFeedback,this);this._comments[c.getCommentId()]=c;}});To.comment.Tab=Ext.extend(To.Tab,{growable:null,resource_type:'',resource_id:0,lang:null,sort:null,_initialize:function(){To.comment.Tab.superclass._initialize.call(this);var r=this.resource_type.toLowerCase();var p={};p[r+'_id']=this.resource_id;var g=new To.comment.Growable({container:this.container,button:this.button,url:'/ajax/'+r+'/comments/',params:p,start:10});if(this.lang){g.setLanguage(this.lang);}
if(this.sort){g.setSort(this.sort);}
this.growable=g;}});To.comment.Tabs=function(config){this.addEvents('commentadd','commentedit','commentremove');To.comment.Tabs.superclass.constructor.call(this,config);};Ext.extend(To.comment.Tabs,To.Tabs,{resource_type:'',resource_id:0,_ignore:false,reloadComments:function(){for(var i in this._tabs){if(this._tabs.hasOwnProperty(i)){this._tabs[i].growable.reloadComments();}}},_onCommentAdd:function(e){e.stopEvent();this.fireEvent('commentadd');},_onCommentEdit:function(t,c){this.fireEvent('commentedit',c);},_onCommentRemove:function(t,c){if(!this._ignore){this._ignore=true;for(var i in this._tabs){if(this._tabs.hasOwnProperty(i)){this._tabs[i].growable.removeComment(c.getCommentId(),false);}}
this.fireEvent('commentremove',c);this._ignore=false;}},_onCommentFeedback:function(t,c,a){for(var i in this._tabs){if(this._tabs.hasOwnProperty(i)){var x=this._tabs[i].growable.getComment(c.getCommentId());if(x!==null&&x!==c){x._updateFeedback(a);}}}},_createTab:function(config){var s=config.container.id.split('_');s=s[s.length-1];var t=new To.comment.Tab(Ext.apply(config,{resource_type:this.resource_type,resource_id:this.resource_id,sort:s}));t.growable.on('commentedit',this._onCommentEdit,this);t.growable.on('commentremove',this._onCommentRemove,this);t.growable.on('commentfeedback',this._onCommentFeedback,this);return t;},_initialize:function(){To.comment.Tabs.superclass._initialize.call(this);var c;c=Ext.get("to_add_comment");if(c){c.on('click',this._onCommentAdd,this);}}});To.map.Geocoder=function(c){Ext.apply(this,c);};To.map.Geocoder.prototype={suffix:null,setSuffix:function(s){this.suffix=s;return this;},getPlacemarks:function(q,o){}};To.map.GeocoderUtility={_config:{},_geocoder:null,setConfig:function(c){this._config=c;this._geocoder=null;},getPlacemarks:function(q,o){return this._getGeocoder().getPlacemarks(q,o);},_getGeocoder:function(){if(!this._geocoder){var c=this._config;var t=c.type||'GOOGLE';if(c.type==='YAHOO'){this._geocoder=new To.yahoo.Geocoder(c);}else{this._geocoder=new To.google.Geocoder(c);}}
return this._geocoder;}};To.map.Placemark=function(c){if(c&&c.data){this._parse(c.data);}};To.map.Placemark.prototype={_address:null,_zipcode:null,_lat:0,_lng:0,_accuracy:8,_geocoder:null,getAddress:function(){return this._addr;},getZipcode:function(){return this._zipcode;},getLatitude:function(){return this._lat;},getLongitude:function(){return this._lng;},getAccuracy:function(){return this._accuracy;},getGeocoderName:function(){return this._geocoder;},_parse:function(d){}};To.map.Search=function(c){Ext.apply(this,c);this.addEvents('submit','reset','geocode','suggestion');To.map.Search.superclass.constructor.call(this,c);this._init();};Ext.extend(To.map.Search,Ext.util.Observable,{_button:null,_form:null,_search:null,_suggestions:null,_items:null,_state:null,getSearch:function(){var s=this._search;if(s.hasClass('to_hint')){return null;}else{return s.dom.value;}},submit:function(){var q=this._search;if(q&&!q.hasClass('to_hint')){var v=q.getValue();if(v!==''){this._button.addClass('cancel');this._saveState();this.fireEvent('submit',this,v);To.map.GeocoderUtility.getPlacemarks(v,{success:this._onGeocoderSuccess,failure:this._onGeocoderFailure,scope:this});}else{this._saveState();this.reset();}}else{this._clearSuggestions();this._button.removeClass('cancel');}},reset:function(){this._clearSuggestions();this._search.dom.value='';this._button.removeClass('cancel');this._saveState();this.fireEvent('reset',this);},_onSearchClick:function(e){e.stopEvent();if(this._button.hasClass('cancel')){this.reset();}else{this.submit();}},_onSearchFocus:function(e){e.stopEvent();var t=e.getTarget();if(t){t=new Ext.Element(t);if(t.hasClass('to_hint')){t.removeClass('to_hint').dom.value='';}
if(t.dom.value!==''){setTimeout(function(){t.dom.select();},100);}}},_onSearchBlur:function(e){this._restoreState();},_onSuggestionClick:function(e,t,o){e.stopEvent();this._onSuggestion(o.placemark);},_onSuggestion:function(p){this._clearSuggestions();if(p.getAddress()){this._search.blur().dom.value=p.getAddress();}
this._button.removeClass('cancel');this._saveState();this.fireEvent('suggestion',this,p);},_onGeocoderSuccess:function(ps,o){if(ps.length===1){this._clearSuggestions();}else{this._updateSuggestions(ps);}
this.fireEvent('geocode',this,200,ps);},_onGeocoderFailure:function(c,o){this._clearSuggestions();this.fireEvent('geocode',this,c,null);},_clearSuggestions:function(){var s=this._suggestions;if(s.isVisible()){s.slideOut('t',{scope:this,callback:function(){Ext.DomHelper.overwrite(this._items,'');}});}},_updateSuggestions:function(ps){var s=this._suggestions;var c=this._items;Ext.DomHelper.overwrite(c,'');for(var i=0,l=ps.length;i<l;i++){var p=ps[i];var e=Ext.DomHelper.append(c,'<p><a href="#">'+p.getAddress()+'</a></p>',true);e.child('a').on('click',this._onSuggestionClick,this,{placemark:p});}
if(!s.isVisible()){s.slideIn();}},_init:function(){var e,c=this.container;e=c.child('form');e.on('submit',this.submit,this,{stopEvent:true});this._form=e;e=this._form.child('input[name="search"]');e.on('focus',this._onSearchFocus,this);e.on('blur',this._onSearchBlur,this);this._search=e;this._suggestions=c.child('.to_search_suggestion').setVisibilityMode(Ext.Element.DISPLAY);this._items=this._suggestions.child('.to_search_suggestion_items');e=c.child('a.to_btn_search');e.on('click',this._onSearchClick,this);this._button=e;if(!this._search.hasClass('to_hint')){this._saveState();}},_saveState:function(){this._state={search:this._search.dom.value,cancel:this._button.hasClass('cancel')};},_restoreState:function(){if(this._state){this._search.dom.value=this._state.search;if(this._state.cancel){this._button.addClass('cancel');}else{this._button.removeClass('cancel');}}}});To.google.Geocoder=Ext.extend(To.map.Geocoder,{_client:null,getPlacemarks:function(q,o){if(!this._init()){return false;}
if(this.suffix){q+=' '+this.suffix;}
this._client.getLocations(q,this._onGeocode.createDelegate(this,[o],2));return true;},_onGeocode:function(r,o){var c=r.Status.code;if(c===200&&o.success){var ps=[];for(var i=0,l=r.Placemark.length;i<l;i++){ps.push(new To.google.Placemark({data:r.Placemark[i]}));}
o.success.apply(o.scope||this,[ps,o]);}else if(c!==200&&o.failure){o.failure.apply(o.scope||this,[c,o]);}},_init:function(){if(!this._client){try{this._client=new google.maps.ClientGeocoder();}catch(e){return false;}}
return true;}});To.google.Placemark=Ext.extend(To.map.Placemark,{_parse:function(d){this._geocoder='GOOGLE';if(d.address){this._addr=d.address;}
if(d.Point){var c=d.Point.coordinates;this._lat=c[1];this._lng=c[0];}
if(d.AddressDetails){this._accuracy=d.AddressDetails.Accuracy;}
var z=To.util.Array.find(d,'PostalCodeNumber');if(z){this._zipcode=z;}}});To.yahoo.Geocoder=Ext.extend(To.map.Geocoder,{_ymap:null,_options:null,_pending:[],getPlacemarks:function(q,o){this._init();if(this.suffix){q+=', '+this.suffix;}
this._options=o;this._ymap.geoCodeAddress(q);},_onGeocode:function(r){var o=this._options;if(r.success){if(o.success){o.success.apply(o.scope||this,[[new To.yahoo.Placemark({data:r})],o]);}}else{if(o.failure){o.failure.apply(o.scope||this,[620,o]);}}},_init:function(){if(!this._ymap){var el=Ext.DomHelper.append(Ext.getBody(),'<div style="position: absolute; width: 0px; height: 0px; margin: -1000px -1000px -1000px -1000px;">'+'<div></div>'+'</div>',true);this._ymap=new YMap(el.first().dom);YEvent.Capture(this._ymap,'onEndGeoCode',this._onGeocode.createDelegate(this));}}});To.yahoo.Placemark=Ext.extend(To.map.Placemark,{_parse:function(d){this._geocoder='YAHOO';if(d.Address){this._addr=d.Address;}
if(d.GeoPoint){this._lat=d.GeoPoint.Lat;this._lng=d.GeoPoint.Lon;}}});To.manager.Framework={notifications:null,_languages:null,_cities:null,_initialized:false,initialize:function(config){var F=To.manager.Framework;var c;Ext.apply(this,config);if(F._initialized){return;}
F._initLogin();F._initNotifications();F._initMedia();if(Ext.isIE6){F._patchIE6();}
c=Ext.get('to_overlay_language');if(c){F._languages=new To.Overlay({container:c,anchor:'bl-tl',listeners:{open:function(){if(this._cities){this._cities.close();}},scope:F}});}
c=Ext.get('to_overlay_city');if(c){F._cities=new To.Overlay({container:c,anchor:'bl-tl',listeners:{open:function(){if(this._languages){this._languages.close();}},scope:F}});}
F._initialized=true;},_initLogin:function(){var e;e=Ext.get('to_login_form_identity');if(e){e.on({focus:function(){if(this.value==='nickname / email'){this.value='';}},blur:function(){if(this.value===''){this.value='nickname / email';}},scope:e.dom});}
e=Ext.get('to_login_form_password');if(e){if(!Ext.isIE&&e.getValue()=='password'){e.dom.type='text';}
e.on({focus:function(){if(this.value==='password'){if(!Ext.isIE){this.type='password';}
this.value='';}},blur:function(){if(this.value===''){this.value='password';if(!Ext.isIE){this.type='text';}}},scope:e.dom});}},_initNotifications:function(){if(this.notifications){var l=this.notifications;for(var i in l){if(l.hasOwnProperty(i)){To.util.Growl.show(l[i].text,l[i].level);}}}},_initMedia:function(){var H=To.History;var M=To.manager.Media;var g=H.getLast('gallery_id');var m=H.getLast('media_id');if(g&&m&&M){M.showMedia(g,m);}},_patchIE6:function(){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}};To.manager.Overlay={_location:null,_movie:null,_theater:null,showLocationVotes:function(t,g,s,p,a,m,f,d){var o=this._location;if(!o){var c=Ext.get('to_overlay_location_votes');if(c){o=new To.ui.OverlayVote({container:c,fields:['general','service','price','ambient','music','food','drink']});this._location=o;}else{return;}}
o.show(t,g,s,p,a,m,f,d);},hideLocationVotes:function(){if(this._location){this._location.hide();}},showMovieVotes:function(t,g,e,f,n,p,s){var o=this._movie;if(!o){var c=Ext.get('to_overlay_movie_votes');if(c){o=new To.ui.OverlayVote({container:c,fields:['general','emotion','effects','entertainment','plot','soundtrack']});this._movie=o;}else{return;}}
o.show(t,g,e,f,n,p,s);},hideMovieVotes:function(){if(this._movie){this._movie.hide();}},showMovieTheaterVotes:function(t,g,s,c,a,p){var o=this._theater;if(!o){var x=Ext.get('to_overlay_movie_theater_votes');if(x){o=new To.ui.OverlayVote({container:x,fields:['general','screens','comfort','audio','parking']});this._theater=o;}else{return;}}
o.show(t,g,s,c,a,p);},hideMovieTheaterVotes:function(){if(this._theater){this._theater.hide();}}};To.manager.Home={_keyNav:null,_lock:false,initialize:function(){this._initSuggestion();this._initKeyboard();},nextSuggestion:function(){if(this._lock){return false;}else{this._lock=true;}
Ext.Ajax.request({url:'/ajax/suggestion/next',scope:this,success:this._onSuggestionSuccess,failure:this._onSuggestionFailure});return true;},_onSuggestionNext:function(){if(!To.manager.Media||!To.manager.Media.isShown()){this.nextSuggestion();}},_onSuggestionSuccess:function(r){r=Ext.decode(r.responseText);if(r.html){Ext.DomHelper.overwrite(Ext.get('to_suggestion_resource'),r.html);}
if(r.user){Ext.DomHelper.overwrite(Ext.get('to_suggestion_user'),r.user);}
this._lock=false;},_onSuggestionFailure:function(r){To.util.Growl.error('Unable to load suggestion');this._lock=false;},_initSuggestion:function(){var e;e=Ext.get('to_suggestion_next');if(e){e.on('click',this.nextSuggestion,this,{stopEvent:true});}},_initKeyboard:function(){this._keyNav=new Ext.KeyNav(Ext.getDoc(),{right:this._onSuggestionNext,scope:this});}};To.facebook.Feed=function(config){Ext.apply(this,config,{data:{}});this._init();};To.facebook.Feed.prototype={id:null,data:null,resource_type:null,resource_id:null,callback:null,scope:null,run:function(){if(!this._loadResource()){this._show();}},_onResourceLoad:function(r){var d=this.data;var u=null;r=Ext.decode(r.responseText).response;switch(this.resource_type){case'LOCATION':Ext.apply(d,{"location.name":r.name,"location.url":r.url,"resource.name":r.name,"resource.url":r.url,"site.name":r.site.name,"site.url_base":r.site.url_base});u=r.url;if(r.photo&&!d.images&&!d.video){d.images=[{src:r.photo.thumb_url,href:r.url}];}
break;case'MOVIE':Ext.apply(d,{"movie.title":r.title,"movie.url":r.url,"movie.director":(r.director!==null?r.director:"N/A"),"movie.cast":(r.cast!==null?r.cast:"N/A"),"resource.name":r.title,"resource.url":r.url});u=r.url;if(r.photo&&!d.images&&!d.video){d.images=[{src:r.photo.movie_url,href:r.url}];}
break;case'EVENT':Ext.apply(d,{"event.title":r.title,"event.url":r.url,"event.description":r.summary,"resource.name":r.title,"resource.url":r.url});u=r.url;if(r.photo&&!d.images&&!d.video){d.images=[{src:r.photo.thumb_url,href:r.url}];}
break;}
if(u&&d.images){for(var i=0,len=d.images.length;i<len;i++){if(!d.images[i].href){d.images[i].href=u;}}}
this._show();},_init:function(){var d=this.data;var l=logged;if(l){if(!d["actor.url"]){d["actor.url"]=l.url;}}},_show:function(){var c=null;if(this.callback){if(this.scope){c=this.callback.createDelegate(this.scope);}else{c=this.callback;}}
FB.Connect.showFeedDialog(this.id,this.data,[],'',null,FB.RequireConnect.require,c);},_loadResource:function(){if(this.resource_type&&this.resource_id){switch(this.resource_type){case'LOCATION':To.api.Location.getInfo(this.resource_id,this._onResourceLoad,null,this);return true;case'MOVIE':To.api.Movie.getInfo(this.resource_id,this._onResourceLoad,null,this);return true;case'EVENT':To.api.Event.getInfo(this.resource_id,this._onResourceLoad,null,this);return true;default:return false;}}else{return false;}}};To.facebook.FeedQueue=function(config){Ext.apply(this,config);this._queue=[];};To.facebook.FeedQueue.prototype={handler:null,_queue:null,push:function(feed){this._queue.push(feed);},pop:function(){if(this.size()>0){return this._queue.shift();}else{return null;}},size:function(){return this._queue.length;},run:function(){this.next();},next:function(){var f=this.pop();if(f!==null){f.callback=this._onFeedComplete;f.scope=this;f.run();}else{this._onQueueComplete();}},_onFeedComplete:function(){this.next();},_onQueueComplete:function(){if(this.handler){this.handler.done();}}};To.facebook.Hook={onCommentAdd:function(h,f,c){var F=To.manager.Facebook;if(F.isLogged()){var d,id;switch(c.resource_type){case'LOCATION':id=70981119161;d={"location.name":c.resource.name,"location.url":c.resource.url,"comment.title":c.title,"comment.text":c.text};break;case'MOVIE':id=70070894161;d={"movie.title":c.resource.title,"movie.url":c.resource.url,"comment.title":c.title,"comment.text":c.text};break;}
if(c.resource.photo){d.images=[{src:c.resource.photo.thumb_url,href:c.resource.url}];}
var feed=new To.facebook.Feed({id:id,data:d,callback:h.done,scope:h});feed.run();}else{return true;}},onVoteAdd:function(h,o,d){if(To.manager.Facebook.isLogged()){if(d.vote_field=='general'&&d.vote_value>3){var id;switch(d.resource_type){case'LOCATION':id=70979949161;break;case'MOVIE':id=70976989161;break;}
var feed=new To.facebook.Feed({id:id,resource_type:d.resource_type,resource_id:d.resource_id,callback:h.done,scope:h});feed.run();}else{return true;}}else{return true;}},onEventParticipantAdd:function(h,p){if(To.manager.Facebook.isLogged()){var feed=new To.facebook.Feed({id:70971229161,data:{"participant.date":p.date,"participant.date_epoch":p.date_epoch},resource_type:'EVENT',resource_id:p.event_id,callback:h.done,scope:h});feed.run();}else{return true;}},onEventPromoterAdd:function(h,p){if(To.manager.Facebook.isLogged()){var feed=new To.facebook.Feed({id:70973939161,resource_type:'EVENT',resource_id:p.event_id,callback:h.done,scope:h});feed.run();}else{return true;}},onMediasUpload:function(h,l,ms){if(To.manager.Facebook.isLogged()){if(l.resource_type=='LOCATION'||l.resource_type=='EVENT'){var q,f,m,i;var images=[];q=new To.facebook.FeedQueue({handler:h});for(i in ms){if(ms.hasOwnProperty(i)){m=ms[i];if(m.type=='PHOTO'){images.push({src:m.thumb_url});}
if(images.length==5){break;}}}
if(images.length>0){q.push(new To.facebook.Feed({id:70984114161,resource_type:l.resource_type,resource_id:l.resource_id,data:{"images":images}}));}
for(i in ms){if(ms.hasOwnProperty(i)){m=ms[i];if(m.type=='VIDEO'){q.push(new To.facebook.Feed({id:70984574161,resource_type:l.resource_type,resource_id:l.resource_id,data:{"video":{video_src:"http://static.tonight.eu/static/flash/player/player.swf?file="+m.media_url+"&autostart=true&skin=http://static.tonight.eu/static/flash/player/kleur.swf",preview_img:m.thumb_url}}}));}}}
q.run();}else{return true;}}else{return true;}}};To.hook.Manager.on('media::mediasUpload',To.facebook.Hook.onMediasUpload,To.facebook.Hook);To.hook.Manager.on('comment::commentAdd',To.facebook.Hook.onCommentAdd,To.facebook.Hook);To.hook.Manager.on('event::participantAdd',To.facebook.Hook.onEventParticipantAdd,To.facebook.Hook);To.hook.Manager.on('event::promoterAdd',To.facebook.Hook.onEventPromoterAdd,To.facebook.Hook);To.hook.Manager.on('vote::voteAdd',To.facebook.Hook.onVoteAdd,To.facebook.Hook);To.facebook.LightboxLogin=function(config){Ext.apply(config,{width:400,height:400});To.facebook.LightboxLogin.superclass.constructor.call(this,config);};Ext.extend(To.facebook.LightboxLogin,To.Lightbox,{profile:null,_onCreate:function(){var id=this.id;var c=this._container;var w=Ext.get(id+'_wrapper');var e,f;c.addClass('to_lightbox_choose_username');w.addClass('to_location');Ext.DomHelper.overwrite(w,To.facebook.LightboxLoginFactory.createLayout(id,this.profile));e=Ext.get(id+'_registration');if(e){f=new To.validate.Field({form:e,name:'User_Profile_FacebookSignup',field:Ext.get(id+'_registration_username')});f=new To.validate.Form({form:e,name:'User_Profile_FacebookSignup'});}},_onShow:function(){To.facebook.LightboxLogin.superclass._onShow.call(this);Ext.get(this.id+'_registration_username').focus();}});To.facebook.LightboxLoginFactory={titleText:'Hi',descriptionText:'you\'ve been successfully authenticated by Facebook!',usernameText:'Please select a nickname to use on Tonight.eu',signupText:'Sign up',loginText:'or click here if you\'re already a registered user',createLayout:function(id,p){var h='<h1>Facebook Connect</h1>';if(p){h+='<div style="float: left; margin: 0 10px 10px; border: 2px solid #303030;"><img src="'+p.pic_square+'" alt="" /></div>'+'<h3>'+this.titleText+' '+p.first_name+',</h3>';}else{h+='<h3>'+this.titleText+',</h3>';}
h+='<p>'+this.descriptionText+'</p>'+'<div class="to_choose_username">'+
this.createRegistration(id)+'<div class="clear"></div>'+'</div>';return h;},createRegistration:function(id){id+='_registration';return'<form id="'+id+'" method="post" action="/user/signup/facebook" enctype="application/x-www-form-urlencoded">'+'<dl class="zend_form">'+'<dt><label class="required" for="username">'+this.usernameText+':</label></dt>'+'<dd><input type="text" value="" id="'+id+'_username" name="username"/></dd>'+'<dd style="display: none;"><input type="submit" class="to_form_button" value="'+this.signupText+'" id="signup" name="signup"/></dd>'+'</dl>'+'<div class="to_buttons"><a id="'+id+'_submit" href="#"><span>'+this.signupText+'</span></a></div>'+'<div class="clear"></div>'+'</form>'+'<br /><br /><p><a href="/user/login">'+this.loginText+'</a></p>';}};To.manager.Facebook={key:'61086b868d8151eb811b6b804be1815a',_id:null,_api:null,_loginProgress:false,init:function(){var F=To.manager.Facebook;FB.init(F.key,"/xd_receiver.htm",{ifUserConnected:F._onFacebookConnected,ifUserNotConnected:F._onFacebookDisconnected});},getClient:function(){if(this._api===null){this._api=new FB.ApiClient(this.key);}
return this._api;},login:function(){FB.Connect.requireSession(this._onFacebookLogin);},logout:function(){var F=To.manager.Facebook;var r='/user/logout';if(FB.Connect&&this._id!==null){FB.Connect.logoutAndRedirect(r);}else{window.location=r;}},isLogged:function(){return(this._id!==null);},_onFacebookLogin:function(){var F=To.manager.Facebook;To.api.Facebook.login(F._onTonightLogin,null,F);F._loginProgress=true;},_onFacebookConnected:function(id){var F=To.manager.Facebook;var e;F._id=id;if(F._loginProgress){return;}
if(logged!==null){e=Ext.get('to_facebook_connect');if(e){e.setVisibilityMode(Ext.Element.DISPLAY).hide();}
var c=F.getClient();c.users_getInfo([id],['first_name','last_name','pic_square','profile_url'],F._onProfileLoaded);}},_onFacebookDisconnected:function(){var F=To.manager.Facebook;var e;F._id=null;e=Ext.get('to_facebook_connect');if(e){e.setVisibilityMode(Ext.Element.DISPLAY).show();}},_onProfileLoaded:function(p,r){if(p){var e,n='';p=p[0];if(p.first_name){n=p.first_name;}
if(p.last_name){n+=' '+p.last_name;}
e=Ext.get('to_facebook_pic');if(e){e.child('a').dom.href=p.profile_url;e.child('img').dom.src=p.pic_square;}
e=Ext.get('to_facebook_name');if(e){e.dom.href=p.profile_url;e.dom.innerHTML=n;}
e=Ext.get('to_facebook');if(e){e.setDisplayed('block');}}},_onTonightLogin:function(r){r=Ext.decode(r.responseText).response;if(r!==null){window.location.reload();}else{var c=this.getClient();c.users_getInfo([this._id],['first_name','pic_square'],function(r){var l=new To.facebook.LightboxLogin({id:'to_facebook_lightbox',profile:r[0]});l.show();});}
this._loginProgress=false;}};var addthis_conf={ver:200};function addthis_invoke(e,c,d,f){addthis_config.username=f||_ate.pub();addthis_share.url=(c||b.addthis_url);addthis_share.title=(d||b.addthis_title);var b=window,g=addthis_share.url.toLowerCase(),a=addthis_share.title.toLowerCase();if(g===""||g==="[url]"){addthis_share.url=location.href}if(a===""||a==="[title]"){addthis_share.title=document.title}_ate.as(e);return false};if(!window._ate){var _atd="www.addthis.com/",_atr="//s7.addthis.com/",_atn="//l.addthiscdn.com/",_euc=encodeURIComponent,_duc=decodeURIComponent,_atu="undefined",_atc={dr:0,ver:250,loc:0,enote:"",cwait:500,tamp:-1,samp:0.005,camp:1,vamp:1,xamp:0.073,pamp:0.1,mamp:0.7,addr:-1,addt:1,xfl:!!window.addthis_disable_flash,abf:!!window.addthis_do_ab};(function(){try{var I=window.location;if(I.protocol.indexOf("file")===0){_atr="http:"+_atr}if(I.hostname.indexOf("localhost")!=-1){_atc.loc=1}}catch(N){}var L=navigator.userAgent.toLowerCase(),O=document,u=window,t=u.addEventListener,h=u.attachEvent,J=O.location,Q={win:/windows/.test(L),xp:/windows nt 5.1/.test(L)||/windows nt 5.2/.test(L),chr:/chrome/.test(L),iph:/iphone/.test(L),saf:/safari/.test(L),web:/webkit/.test(L),opr:/opera/.test(L),msi:(/msie/.test(L))&&!(/opera/.test(L)),ffx:/firefox/.test(L),ff2:/firefox\/2/.test(L),ie6:/msie 6.0/.test(L),ie7:/msie 7.0/.test(L),mod:-1},n={isBound:false,isReady:false,readyList:window.addthis_onload||[],onReady:function(){if(!n.isReady){n.isReady=true;var a=n.readyList;for(var b=0;b<a.length;b++){a[b].call(window)}n.readyList=[]}},addLoad:function(a){var b=u.onload;if(typeof u.onload!="function"){u.onload=a}else{u.onload=function(){if(b){b()}a()}}},bindReady:function(){if(A.isBound){return}A.isBound=true;if(O.addEventListener&&!Q.opr){O.addEventListener("DOMContentLoaded",A.onReady,false)}var a=window.addthis_product;if(a&&a.indexOf("f")>-1){A.onReady();return}if(Q.msi&&window==top){(function(){if(A.isReady){return}try{O.documentElement.doScroll("left")}catch(c){setTimeout(arguments.callee,0);return}A.onReady()})()}if(Q.opr){O.addEventListener("DOMContentLoaded",function(){if(A.isReady){return}for(var c=0;c<O.styleSheets.length;c++){if(O.styleSheets[c].disabled){setTimeout(arguments.callee,0);return}}A.onReady()},false)}if(Q.saf){var b;(function(){if(A.isReady){return}if(O.readyState!="loaded"&&O.readyState!="complete"){setTimeout(arguments.callee,0);return}if(b===undefined){var c=O.gn("link");for(var d=0;d<c.length;d++){if(c[d].getAttribute("rel")=="stylesheet"){b++}}var e=O.gn("style");b+=e.length}if(O.styleSheets.length!=b){setTimeout(arguments.callee,0);return}A.onReady()})()}A.addLoad(A.onReady)},append:function(b,a){A.bindReady();if(A.isReady){b.call(window,[])}else{A.readyList.push(function(){return b.call(window,[])})}}},A=n,v=function(q,l,p,c){if(!q){return p}if(q instanceof Array){for(var e=0,a=q.length,b=q[0];e<a;b=q[++e]){p=l.call(c||q,p,b,e,q)}}else{for(var d in q){p=l.call(c||q,p,q[d],d,q)}}return p},D=Array.prototype.slice,F=function(b){return D.apply(b,D.call(arguments,1))},E=function(a){return a.replace(/(^\s+|\s+$)/g,"")},M=function(a,b){return v(F(arguments,1),function(d,c){return v(c,function(l,i,e){l[e]=i;return l},d)},a)},j=function(b,a){return v(b,function(e,d,c){c=E(c);if(c){e.push(_euc(c)+"="+_euc(E(d)))}return e},[]).join(a||"&")},g=function(b,a){return v((b||"").split(a||"&"),function(i,l){var e=l.split("="),d=E(_duc(e[0])),c=E(_duc(e.slice(1).join("=")));if(d){i[d]=c}return i},{})},f={vst:[],rev:"$Rev: 74429 $",_euc:_euc,_duc:_duc,reduce:v,slice:F,strip:E,extend:M,toKV:j,fromKV:g,bro:Q,clck:1,show:1,dl:J,camp:_atc.camp-Math.random(),samp:_atc.samp-Math.random(),vamp:_atc.vamp-Math.random(),tamp:_atc.tamp-Math.random(),pamp:_atc.pamp-Math.random(),xamp:_atc.xamp-Math.random(),mamp:_atc.mamp-Math.random(),ab:"-",scnt:1,seq:1,dcp:0,inst:1,wait:500,tmo:null,cvt:[],svt:[],sttm:new Date().getTime(),max:4294967295,pix:"tev",sid:0,sub:!!window.at_sub,dbm:0,uid:null,oot:null,swf:"//bin.clearspring.com/at/v/1/button1.6.swf",evu:"//o.addthis.com/at/",spt:"static/r07/widget13.png",ifpp:null,trim:function(a,b){try{a=a.replace(/^[\s\u3000]+|[\s\u3000]+$/g,"");if(b){a=_euc(a)}}catch(b){}return a},gat:function(){},com:function(a){if(window.parent&&window.postMessage){window.parent.postMessage(a,"*")}else{f.ifm(a)}},ifwn:function(){var b=f;try{b.rec(b.sifr.contentWindow.name)}catch(c){}},ifm:function(b){if(addthis_wpl){var c=(addthis_wpl.split("#"))[0];window.parent.location.href=c+"#at"+b}return false},hash:window.location.hash,ifp:function(){var c=f,b=window.location.hash,i=0;if(b&&b.indexOf("#at")>-1){b=b.substr(3).split(";");for(var e in b){var d=b[e].length>3?b[e].substr(0,3):null;switch(d){case"ssh":i=1;c.ssh(b[e].substr(4));break;case"uid":i=1;c.asetup(b[e].substr(4));break}}if(i){if(!c.hash.length||c.hash==""){c.hash="#"}window.location.hash=c.hash}}if(c.gssh&&c.guid){clearInterval(c.ifpp)}},pmh:function(a){if(a.origin.slice(-12)==".addthis.com"){f.rec(a.data)}},_rec:[],rec:function(d){if(!d){return}var l=g(d),b=f,c=b.sifr,e=b._rec;if(l.ssh){b.ssh(l.ssh)}if(l.uid){b.asetup(l.uid)}if(l.dbm){b.dbm=l.dbm}if(c&&c.parentNode){}for(var p=0;p<e.length;p++){e[p](l)}},ssh:function(b){f.gssh=1;var a=window.addthis_ssh=_duc(b);f._ssh=a.split(",")},mun:function(c){var a=291;if(c){for(var b=0;b<c.length;b++){a=(a*(c.charCodeAt(b)+b)+3)&1048575}}return(a&16777215).toString(32)},jsl:function(){return((((u.jQuery||{}).fn||{}).jquery&&1)|((u.Prototype||{}).Version&&2)|((u.YUI||{}).version||(u.YAHOO||{}).VERSION&&4)|((u.Ext||{}).version&&8)|((u.dojo||{}).version&&16))},ibt:function(){if(f.bti){return f.bti}var a=(window.addthis_product||"men").substr(0,3),b=a=="bkm"||a=="fct"||a=="fxe";if(b){f.bti=b}return b},off:function(){return Math.floor((new Date().getTime()-f.sttm)/100).toString(16)},ran:function(){return Math.floor(Math.random()*4294967295).toString(36)},srd:function(){if(f.dr){return"&pre="+_euc(f.dr)}else{return""}},cst:function(a){return"CXNID=2000001.521545608054043907"+(a||2)+"NXC"},imgz:[],hrr:function(c){if(c&&c.urls&&c.urls instanceof Array){for(var b=0;b<c.urls.length;b++){var a=new Image();f.imgz.push(a);a.src=c.urls[b]}}},omp:function(){f.img(_atc.ver+"sh","3");if(f.lng().indexOf("en")==0){if(f.mamp>=0){f.xred(200)}}},img:function(p,r,b){if(!window.at_sub&&!_atc.xtr){var e=f,q=e.dr,d=((e.rev||"").split(" "));if(q){q=q.split("?").shift().split("http://").pop().split("https://").pop();if(q.length>25){q=q.substr(0,25)}}var l=new Image();e.imgz.push(l);l.src=_atn+"live/t00/"+p+".gif?"+(e.uid!==null?"uid="+e.uid+"&":"")+e.ran()+"&"+e.cst(r)+(e.pub()?"&pub="+e.pub():"")+(q?"&dr="+_euc(q):"")+(d.length>1?"&rev="+d[1]:"")+(b?"&"+b:"")}},cuid:function(){return((f.sttm/1000)&f.max).toString(16)+("00000000"+(Math.floor(Math.random()*(f.max+1))).toString(16)).slice(-8)},ssid:function(){if(f.sid===0){f.sid=f.cuid()}return f.sid},sev:function(b,a){f.pix="sev-"+(typeof(b)!=="number"?_euc(b):b);f.svt.push(b+";"+f.off());if(a===1){f.xmi(true)}else{f.sxm(true)}},cev:function(b,a){f.pix="cev-"+_euc(b);f.cvt.push(_euc(b)+"="+_euc(a)+";"+f.off());f.sxm(true)},sxm:function(a){if(f.tmo!==null){clearTimeout(f.tmo)}if(a){f.tmo=f.sto("_ate.xmi(false)",f.wait)}},sto:function(b,a){return setTimeout(b,a)},sta:function(){var b=f;return"AT-"+(b.pub()?b.pub():"unknown")+"/-/"+b.ab+"/"+b.ssid()+"/"+(b.seq++)+(b.uid!==null?"/"+b.uid:"")},xred:function(d){try{var s=window,ae=f,b=0,W=O.referer||O.referrer||"",T=J?J.href:null,aa=J?J.hostname.split(".").slice(-2).join("."):null,y=100,q=300,ac=0,p=1,l=2,x=4,V=ac,ad=".com/",Y=0;if(W){var U=W.split("//").pop().split("/").shift().split("?").shift().split(".").slice(-2).join(".");if(U==aa){V|=l}else{V|=x}}if(((ae.camp>=0&&(W.indexOf(ad)>-1&&W.indexOf("addthis")==-1))||d)&&(T&&J&&J.protocol&&(J.protocol.indexOf("https")==-1))){if(W&&W.match(/ws\/results\/(Web|Images|Video|News)/)){Y=1;V|=p}else{if(W.indexOf(ad+"search")>-1||W.indexOf(ad+"url")>-1||W.indexOf(ad+"web")>-1||W.indexOf(ad+"aol")>-1||W.indexOf(ad+"s?bs")>-1||W.indexOf("hotbot"+ad)>-1){var S=W.split("?").pop().split("&");for(var Z=0;Z<S.length;Z++){if(S[Z].indexOf("q=")===0||S[Z].indexOf("bs=")===0||S[Z].indexOf("p=")===0||S[Z].indexOf("query")===0||S[Z].indexOf("qry")===0||S[Z].indexOf("text")===0){Y=1;break}}V|=p}}if(!ae.dcp&&!_atc.xtr&&!_atc.xck&&(Y||d)&&ae.mun(ae.pub())!=="mu2r"){if(!d){d=y}ae.dcp=d;var X=O.ce("script");X.src="//cf.addthis.com/red/p.json?rb="+V+"&gen="+d+"&callback=_ate.hrr"+(ae.pub()?"&pub="+ae.pub():"")+(ae.uid&&ae.uid!=="anonymous"?"&uid="+_euc(ae.uid):"")+"&url="+_euc(T)+(W?"&ref="+_euc(W):"")+"&"+ae.ran();O.gn("head")[0].appendChild(X)}}}catch(ab){}},xld:function(){var b=f,e={"6jb4":1,sirb:1,q8fc:1,mv86:1,qmo0:1},c=b.jsl(),d=b.mun(b.pub());if(!b.xld_p){b.xld_p=1;if(e[d]){_atc.samp/=4;b.samp=_atc.samp-Math.random()}if(b.samp>=0&&!b.sub){b.sev("20");b.cev("plo",Math.round(1/_atc.samp));if(b.dr){b.cev("pre",b.dr)}}if(b.xamp>=0&&b.lng().indexOf("en")==0){b.xred(100)}else{b.xred()}b.img(_atc.ver+"lo","2",c?"jsl="+c:"")}},xmi:function(r){var b=f,p=b.dl?b.dl.hostname:"";if(!b.uid){b.dck("X"+b.cuid())}else{b.coo()}if(b.cvt.length+b.svt.length>0){b.sxm(false);if(b.seq===1){b.cev("pin",b.inst)}if(_atc.xtr){return}if(p.indexOf(".gov")>-1||p.indexOf(".mil")>-1){_atc.xck=1}var s=b.pix+"-"+b.ran()+".png?ev="+f.sta()+"&se="+b.svt.join(",")+"&ce="+b.cvt.join(",")+(_atc.xck?"&xck=1":""),e=b.evu+s;b.cvt=[];b.svt=[];if(r){var q=document,l=q.ce("iframe");l.id="_atf";l.src=e;f.opp(l.style);q.body.appendChild(l);l=q.getElementById("_atf")}else{var c=new Image();b.imgz.push(c);c.src=e}}},loc:function(){return _atc.loc},opp:function(a){a.width=a.height="1px";a.position="absolute";a.zIndex=100000},pub:function(){return _euc(window.addthis_config&&addthis_config.username?addthis_config.username:(window.addthis_pub||""))},plo:[],lad:function(a){f.plo.push(a)},lng:function(){return window.addthis_language||(window.addthis_config||{}).ui_language||(f.bro.msi?navigator.userLanguage:navigator.language)},ivl:function(a){var b={af:1,afr:"af",ar:1,ara:"ar",az:1,aze:"az",be:1,bye:"be",bg:1,bul:"bg",bn:1,ben:"bn",bs:1,bos:"bs",ca:1,cat:"ca",cs:1,ces:"cs",cze:"cs",cy:1,cym:"cy",da:1,dan:"da",de:1,deu:"de",ger:"de",el:1,gre:"el",ell:"ell",es:1,esl:"es",spa:"spa",et:1,est:"et",fa:1,fas:"fa",per:"fa",fi:1,fin:"fi",fo:1,fao:"fo",fr:1,fra:"fr",fre:"fr",ga:1,gae:"ga",gdh:"ga",gl:1,glg:"gl",he:1,heb:"he",hi:1,hin:"hin",hr:1,cro:"hr",hu:1,hun:"hu",id:1,ind:"id",is:1,ice:"is",it:1,ita:"it",ja:1,jpn:"ja",ko:1,kor:"ko",lb:1,ltz:"lb",lt:1,lit:"lt",lv:1,lav:"lv",mk:1,mac:"mk",mak:"mk",ms:1,msa:"ms",may:"ms",nb:1,nl:1,nla:"nl",dut:"nl",no:1,nno:"no",oc:1,oci:"oc",pl:1,pol:"pl",pt:1,por:"pt",ro:1,ron:"ro",rum:"ro",ru:1,rus:"ru",sk:1,slk:"sk",slo:"sk",sl:1,slv:"sl",sq:1,alb:"sq",sr:1,ser:"sr",sv:1,sve:"sv",swe:"sv",ta:1,tam:"ta",te:1,teg:"te",th:1,tha:"th",tl:1,tgl:"tl",tr:1,tur:"tr",uk:1,ukr:"uk",ur:1,urd:"ur",vi:1,vie:"vi","zh-hk":1,"chi-hk":"zh-hk","zho-hk":"zh-hk","zh-tr":1,"chi-tr":"zh-tr","zho-tr":"zh-tr","zh-tw":1,"chi-tw":"zh-tw","zho-tw":"zh-tw",zh:1,chi:"zh",zho:"zh"};if(b[a]){return b[a]}a=a.split("-").shift();if(b[a]){if(b[a]===1){return a}else{return b[a]}}return 0},alg:function(e,c){var i=document,a=(e||f.lng()||"en").toLowerCase(),b=f.ivl(a);if(a.indexOf("en")!==0&&(!f.pll||c)){if(b){if(b!==1){a=b}f.pll=f.ajs("static/r07/lang00/"+a+".js")}}},jlr:{},ajs:function(a){if(!f.jlr[a]){var b=O.ce("script");b.src=_atr+a;O.gn("head")[0].appendChild(b);f.jlr[a]=1;return b}return 1},jlo:function(){try{var p=document,b=f,l=b.lng();b.alg(l);if(!b.pld){if(b.bro.ie6){var c=new Image();b.imgz.push(c);c.src=_atr+b.spt;if(window.addthis_feed){c=new Image();b.imgz.push(c);c.src=_atr+"static/r05/feed00.gif"}}if(b.pll&&!window.addthis_translations){b.sto(function(){b.pld=b.ajs("static/r07/menu46.js")},10)}else{b.pld=b.ajs("static/r07/menu46.js")}}}catch(i){}},igv:function(a,b){if(!u.addthis_share){u.addthis_share={}}if(!addthis_share.url){u.addthis_share.url=u.addthis_url||a}if(!addthis_share.title){u.addthis_share.title=u.addthis_title||b}if(!u.addthis_config){u.addthis_config={username:u.addthis_pub}}else{if(addthis_config.data_use_flash===false){_atc.xfl=1}if(addthis_config.data_use_cookies===false){_atc.xck=1}}},lod:function(S){try{var U=window,ak=f,x=ak.bro.msi,d=0,Z=O.referer||O.referrer||"",X=J?J.href:null,ag=J.hostname,aj=X?X.indexOf("sms_ss"):-1,ah=((S===1||U.addthis_load_flash)&&!_atc.abf),ac=((U.addthis_language||(U.addthis_config?U.addthis_config.ui_language:null)||(ak.bro.msi?navigator.userLanguage:navigator.language)).split("-")).shift(),s=(J.href.indexOf(_atr)==-1)&&!ak.bro.ie6&&!ak.bro.ie7,ad=O.gn("link"),q=_atr+"static/r07/sh11.html",y="_ate.ifwn()",r,T;if(!U.postMessage){var W=O.gn("img");for(var ae=0;ae<W.length;ae++){if(W[ae].src.split("//").pop().indexOf(ag)==0){r=W[ae].src;break}}}if(s&&(!_atc.xic||(U.postMessage||ak.bro.msi))){if(!x){T=O.ce("iframe")}else{var V=O.ce("div");V.style.visibility="hidden";ak.opp(V.style);O.body.insertBefore(V,O.body.firstChild);V.innerHTML='<iframe id="_atssh" width="1" height="1" name="_atssh" '+(!U.postMessage?'onload="'+y+'" ':"")+">";T=O.getElementById("_atssh")}}for(var ae=0;ae<ad.length;ae++){var ab=ad[ae];if(ab.rel&&ab.rel=="canonical"&&ab.href){X=ab.href}}ak.igv(X,O.title||"");ak.gov();ak.dr=Z;var p=(ak.swf&&!_atc.xfl&&!(ak.loc())&&!_atc.abf&&(ah||ak.uid===null||(ak.uid!=="anonymous"&&ak.oot&&((new Date()).getTime()-ak.oot>60480000))));q+="#swfp="+(p&&x?1:0)+(Z&&Z!=X?"&dr="+_euc(Z):"")+"&du="+_euc(X)+(ak.xamp>0?"&px=1":"")+"&vr="+_euc(_atc.ver)+(_atc.xck?"&xck=1":"")+"&psp="+(Math.ceil(1/_atc.pamp));if(!x&&p){var c=function(e,l,a){var i=O.ce("param");i.name=l;i.value=a;e.appendChild(i)},V=O.ce("div"),Y="atff",b=Y+"c",aa=O.ce("object");V.id=b;O.body.insertBefore(V,O.body.firstChild);setTimeout(function(){var a=O.getElementById(b);aa.id=Y;aa.data=ak.swf;aa.width=aa.height="1px";aa.type="application/x-shockwave-flash";c(aa,"wmode","transparent");c(aa,"allowScriptAccess","always");a.appendChild(aa)},10)}if(s&&T){T.id="_atssh";ak.opp(T.style);T.frameborder=T.style.border=0;T.style.top=T.style.left=0;if(U.postMessage){T.src=q;if(x){U.attachEvent("onmessage",ak.pmh)}else{U.addEventListener("message",ak.pmh,false)}T=O.body.appendChild(T)}else{if(r&&!_atc.xic&&ak.bro.msi&&window==top){T.onload=y;T.src=r;T=O.body.appendChild(T);T.src=q+"&wpl="+_euc(r)}}ak.sifr=T}if(!ah){if(p){ak.uoo();if(ak.bro.ie6||ak.bro.ie7){ak.sto("if (_ate.xld) _ate.xld()",5000)}else{ak.sto("_ate.xld()",5000)}}else{ak.guid=1;ak.xld()}if(aj>-1&&X.indexOf(_atd+"book")==-1){var af=X.substr(aj);af=af.split("&").shift().split("#").shift().split("=").pop();if(ak.vamp>=0&&!ak.sub&&af.length){ak.cev("plv",Math.round(1/_atc.vamp));ak.cev("rsc",af)}}}if(window.addthis_language||(window.addthis_config||{}).ui_language){ak.alg()}if(ak.plo.length>0){ak.jlo()}}catch(ai){}},kck:function(a){var b=document;if(b.cookie){b.cookie=a+"= ; expires=Tue, 31 Mar 2009 05:47:11 UTC; path=/"}},rck:function(e){var p=document;if(p.cookie){var b=p.cookie.split(";");for(var l=0;l<b.length;l++){var q=b[l],a=q.indexOf(e+"=");if(a>=0){return q.substring(a+(e.length+1))}}}return},uoo:function(){f.sck("_csoot",(new Date().getTime()))},coo:function(a){if(f.uid=="anonymous"&&!f.oot){_atc.xck=1;f.uoo()}},dck:function(a){f.uid=a;f.sck("_csuid",a);f.coo()},gov:function(){var b=f.dl?f.dl.hostname:"";if(b.indexOf(".gov")>-1||b.indexOf(".mil")>-1){_atc.xck=1;_atc.xfl=1}var c=f.pub(),a=["usarmymedia","govdelivery"];for(K in a){if(c==a[K]){_atc.xck=1;_atc.xfl=1;break}}},sck:function(b,a,c){f.gov();if(!_atc.xck){O.cookie=b+"="+a+(!c?"; expires=Wed, 04 Oct 2028 03:19:53 GMT":"")+"; path=/"}},asetup:function(b){var c=f;try{if(!c.guid){c.guid=1;if(b!==null&&b!==_atu){c.dck(b)}c.xld()}}catch(d){}return b},ao:function(b,i,e,c,d,a){f.lad(["open",b,i,e,c,d,a]);f.jlo();return false},ac:function(){},as:function(b,c,a){f.lad(["send",b,c,a]);f.jlo()}},R=f;u._ate=R;u._adr=A;O.ce=O.createElement;O.gn=O.getElementsByTagName;A.bindReady();if(!_atc.ost){if(!u.addthis_conf){u.addthis_conf={}}for(var K in addthis_conf){_atc[K]=addthis_conf[K]}_atc.ost=1}A.append(R.lod);if(O.cookie){var m=O.cookie.split(";");for(var K=0;K<m.length;K++){var P=m[K],o=P.indexOf("_csuid="),k=P.indexOf("_csoot=");if(o>=0){f.uid=P.substring(o+7)}else{if(k>=0){f.oot=P.substring(k+7)}}}}try{if(!_atc.xcs){var I=O.ce("link");I.rel="stylesheet";I.type="text/css";I.href=_atr+"static/r07/widget29.css";I.media="all";O.gn("head")[0].appendChild(I)}}catch(N){}var H=O.gn("script"),z=H[H.length-1],B=z.src.indexOf("#")>-1?z.src.replace(/^[^\#]+\#?/,""):z.src.replace(/^[^\?]+\??/,""),C=g(B);if(C.pub){u.addthis_pub=_duc(C.pub)}else{if(C.username){u.addthis_pub=_duc(C.username)}}if(u.addthis_pub&&u.addthis_config){u.addthis_config.username=u.addthis_pub}if(C.domready){_atc.dr=1}try{if(_atc.ver===120){var G="atb"+u._ate.cuid();O.write('<span id="'+G+'"></span>');u._ate.igv();u._ate.lad(["span",G,addthis_share.url||"[url]",addthis_share.title||"[title]"])}if(u.addthis_clickout){f.lad(["cout"])}}catch(N){}})();function addthis_open(b,f,e,c,d,a){if(typeof d=="string"){d=null}return _ate.ao(b,f,e,c,d,a)}function addthis_close(){_ate.ac()}function addthis_sendto(b,c,a){_ate.as(b,c,a);return false}if(_atc.dr){_adr.onReady()}}else{_ate.inst++}if(_atc.abf){addthis_open(document.getElementById("ab"),"emailab",window.addthis_url||"[URL]",window.addthis_title||"[TITLE]")};