Ext={version:"2.2"};window["undefined"]=window["undefined"];Ext.apply=function(C,D,B){if(B){Ext.apply(C,B)}if(C&&D&&typeof D=="object"){for(var A in D){C[A]=D[A]}}return C};(function(){var idSeed=0;var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isSafari=(/webkit|khtml/).test(ua),isSafari3=isSafari&&ua.indexOf("webkit/5")!=-1,isIE=!isOpera&&ua.indexOf("msie")>-1,isIE7=!isOpera&&ua.indexOf("msie 7")>-1,isGecko=!isSafari&&ua.indexOf("gecko")>-1,isGecko3=!isSafari&&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]}}},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.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"){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"}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,isSafari:isSafari,isSafari3:isSafari3,isSafari2:isSafari&&!isSafari3,isIE:isIE,isIE6:isIE&&!isIE7,isIE7:isIE7,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 P=parseInt(K.getStyle("borderTopWidth"),10)||0;var H=parseInt(K.getStyle("borderLeftWidth"),10)||0;O+=H;L+=P;if(F!=G&&K.getStyle("overflow")!="visible"){O+=H;L+=P}}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(P,Q,N){var R=this.getListeners(P,N);if(R){for(var O=0,L=R.length;O<L;++O){var M=R[O];this.removeListener(P,M.type,M.fn)}}if(Q&&P&&P.childNodes){for(O=0,L=P.childNodes.length;O<L;++O){this.purgeElement(P.childNodes[O],Q,N)}}},getListeners:function(M,R){var P=[],L;if(!R){L=[G,K]}else{if(R=="unload"){L=[K]}else{L=[G]}}for(var O=0;O<L.length;++O){var T=L[O];if(T&&T.length>0){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===M&&(!R||R===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.ADJ_SCOPE],index:Q})}}}}return(P.length)?P:null},_unload:function(S){var R=Ext.lib.Event,P,O,M,L,N;for(P=0,L=K.length;P<L;++P){M=K[P];if(M){var Q=window;if(M[R.ADJ_SCOPE]){if(M[R.ADJ_SCOPE]===true){Q=M[R.OBJ]}else{Q=M[R.ADJ_SCOPE]}}M[R.FN].call(Q,R.getEvent(S),M[R.OBJ]);K[P]=null;M=null;Q=null}}K=null;if(G&&G.length>0){O=G.length;while(O){N=O-1;M=G[N];if(M){R.removeListener(M[R.EL],M[R.TYPE],M[R.FN],N)}O=O-1}M=null;R.clearCache()}R.doRemove(window,"unload",R._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(K,I,E,J,F){if(F){var G=F.headers;if(G){for(var H in G){if(G.hasOwnProperty(H)){this.initHeader(H,G[H],false)}}}if(F.xmlData){if(!G||!G["Content-Type"]){this.initHeader("Content-Type","text/xml",false)}K=(K?K:(F.method?F.method:"POST"));J=F.xmlData}else{if(F.jsonData){if(!G||!G["Content-Type"]){this.initHeader("Content-Type","application/json",false)}K=(K?K:(F.method?F.method:"POST"));J=typeof F.jsonData=="object"?Ext.encode(F.jsonData):F.jsonData}}}return this.asyncRequest(K,I,E,J)},serializeForm:function(F){if(typeof F=="string"){F=(document.getElementById(F)||document.forms[F])}var G,E,H,J,K="",M=false;for(var L=0;L<F.elements.length;L++){G=F.elements[L];J=F.elements[L].disabled;E=F.elements[L].name;H=F.elements[L].value;if(!J&&E){switch(G.type){case"select-one":case"select-multiple":for(var I=0;I<G.options.length;I++){if(G.options[I].selected){if(Ext.isIE){K+=encodeURIComponent(E)+"="+encodeURIComponent(G.options[I].attributes["value"].specified?G.options[I].value:G.options[I].text)+"&"}else{K+=encodeURIComponent(E)+"="+encodeURIComponent(G.options[I].hasAttribute("value")?G.options[I].value:G.options[I].text)+"&"}}}break;case"radio":case"checkbox":if(G.checked){K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&"}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(M==false){K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&";M=true}break;default:K+=encodeURIComponent(E)+"="+encodeURIComponent(H)+"&";break}}}K=K.substr(0,K.length-1);return K},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(I){var H,E;try{E=new XMLHttpRequest();H={conn:E,tId:I}}catch(G){for(var F=0;F<this.activeX.length;++F){try{E=new ActiveXObject(this.activeX[F]);H={conn:E,tId:I};break}catch(G){}}}finally{return H}},getConnectionObject:function(){var F;var G=this.transactionId;try{F=this.createXhrObject(G);if(F){this.transactionId++}}catch(E){}finally{return F}},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(I,J,E){if(!J){this.releaseObject(I);return }var G,F;try{if(I.conn.status!==undefined&&I.conn.status!=0){G=I.conn.status}else{G=13030}}catch(H){G=13030}if(G>=200&&G<300){F=this.createResponseObject(I,J.argument);if(J.success){if(!J.scope){J.success(F)}else{J.success.apply(J.scope,[F])}}}else{switch(G){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:F=this.createExceptionObject(I.tId,J.argument,(E?E:false));if(J.failure){if(!J.scope){J.failure(F)}else{J.failure.apply(J.scope,[F])}}break;default:F=this.createResponseObject(I,J.argument);if(J.failure){if(!J.scope){J.failure(F)}else{J.failure.apply(J.scope,[F])}}}}this.releaseObject(I);F=null},createResponseObject:function(E,K){var H={};var M={};try{var G=E.conn.getAllResponseHeaders();var J=G.split("\n");for(var I=0;I<J.length;I++){var F=J[I].indexOf(":");if(F!=-1){M[J[I].substring(0,F)]=J[I].substring(F+2)}}}catch(L){}H.tId=E.tId;H.status=E.conn.status;H.statusText=E.conn.statusText;H.getResponseHeader=M;H.getAllResponseHeaders=G;H.responseText=E.conn.responseText;H.responseXML=E.conn.responseXML;if(typeof K!==undefined){H.argument=K}return H},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(G,E){var F=function(){this.onComplete.removeListener(F);if(typeof G=="function"){G.call(E||this,this)}};this.onComplete.addListener(F,this);this.animate()},setRuntimeAttribute:function(F){var K;var G;var H=this.attributes;this.runtimeAttributes[F]={};var J=function(L){return(typeof L!=="undefined")};if(!J(H[F]["to"])&&!J(H[F]["by"])){return false}K=(J(H[F]["from"]))?H[F]["from"]:this.getAttribute(F);if(J(H[F]["to"])){G=H[F]["to"]}else{if(J(H[F]["by"])){if(K.constructor==Array){G=[];for(var I=0,E=K.length;I<E;++I){G[I]=K[I]+H[F]["by"][I]}}else{G=K+H[F]["by"]}}}this.runtimeAttributes[F].start=K;this.runtimeAttributes[F].end=G;this.runtimeAttributes[F].unit=(J(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(I,H){var J=I.length;var G=[];for(var F=0;F<J;++F){G[F]=[I[F][0],I[F][1]]}for(var E=1;E<J;++E){for(F=0;F<J-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(I,M,J){var L;if(this.patterns.color.test(I)){L=[];for(var K=0,H=M.length;K<H;++K){L[K]=G.doMethod.call(this,I,M[K],J[K])}L="rgb("+Math.floor(L[0])+","+Math.floor(L[1])+","+Math.floor(L[2])+")"}else{L=G.doMethod.call(this,I,M,J)}return L};E.setRuntimeAttribute=function(I){G.setRuntimeAttribute.call(this,I);if(this.patterns.color.test(I)){var K=this.attributes;var M=this.parseColor(this.runtimeAttributes[I].start);var J=this.parseColor(this.runtimeAttributes[I].end);if(typeof K[I]["to"]==="undefined"&&typeof K[I]["by"]!=="undefined"){J=this.parseColor(K[I].by);for(var L=0,H=M.length;L<H;++L){J[L]=M[L]+J[L]}}this.runtimeAttributes[I].start=M;this.runtimeAttributes[I].end=J}}})();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(T){if(typeof T=="string"){return T}var O="";if(Ext.isArray(T)){for(var R=0,P=T.length;R<P;R++){O+=A(T[R])}return O}if(!T.tag){T.tag="div"}O+="<"+T.tag;for(var N in T){if(N=="tag"||N=="children"||N=="cn"||N=="html"||typeof T[N]=="function"){continue}if(N=="style"){var S=T["style"];if(typeof S=="function"){S=S.call()}if(typeof S=="string"){O+=" style=\""+S+"\""}else{if(typeof S=="object"){O+=" style=\"";for(var Q in S){if(typeof S[Q]!="function"){O+=Q+":"+S[Q]+";"}}O+="\""}}}else{if(N=="cls"){O+=" class=\""+T["cls"]+"\""}else{if(N=="htmlFor"){O+=" for=\""+T["htmlFor"]+"\""}else{O+=" "+N+"=\""+T[N]+"\""}}}}if(F.test(T.tag)){O+="/>"}else{O+=">";var U=T.children||T.cn;if(U){O+=A(U)}else{if(T.html){O+=T.html}}O+="</"+T.tag+">"}return O};var M=function(T,O){var S;if(Ext.isArray(T)){S=document.createDocumentFragment();for(var R=0,P=T.length;R<P;R++){M(T[R],S)}}else{if(typeof T=="string"){S=document.createTextNode(T)}else{S=document.createElement(T.tag||"div");var Q=!!S.setAttribute;for(var N in T){if(N=="tag"||N=="children"||N=="cn"||N=="html"||N=="style"||typeof T[N]=="function"){continue}if(N=="cls"){S.className=T["cls"]}else{if(Q){S.setAttribute(N,T[N])}else{S[N]=T[N]}}}Ext.DomHelper.applyStyles(S,T.style);var U=T.children||T.cn;if(U){M(U,S)}else{if(T.html){S.innerHTML=T.html}}}}if(O){O.appendChild(S)}return S};var I=function(S,Q,P,R){L.innerHTML=[Q,P,R].join("");var N=-1,O=L;while(++N<S){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,P,O){return this.doInsert(N,P,O,"beforeBegin")},insertAfter:function(N,P,O){return this.doInsert(N,P,O,"afterEnd","nextSibling")},insertFirst:function(N,P,O){return this.doInsert(N,P,O,"afterBegin","firstChild")},doInsert:function(Q,S,R,T,P){Q=Ext.getDom(Q);var O;if(this.useDom){O=M(S,null);(P==="firstChild"?Q:Q.parentNode).insertBefore(O,P?Q[P]:Q)}else{var N=A(S);O=this.insertHtml(T,Q,N)}return R?Ext.get(O,true):O},append:function(P,R,Q){P=Ext.getDom(P);var O;if(this.useDom){O=M(R,null);P.appendChild(O)}else{var N=A(R);O=this.insertHtml("beforeEnd",P,N)}return Q?Ext.get(O,true):O},overwrite:function(N,P,O){N=Ext.getDom(N);N.innerHTML=A(P);return O?Ext.get(N.firstChild,true):N.firstChild},createTemplate:function(O){var N=A(O);return new Ext.Template(N)}}}();
Ext.Template=function(E){var B=arguments;if(Ext.isArray(E)){E=E.join("")}else{if(B.length>1){var C=[];for(var D=0,A=B.length;D<A;D++){if(typeof B[D]=="object"){Ext.apply(this,B[D])}else{C[C.length]=B[D]}}E=C.join("")}}this.html=E;if(this.compiled){this.compile()}};Ext.Template.prototype={applyTemplate:function(B){if(this.compiled){return this.compiled(B)}var A=this.disableFormats!==true;var E=Ext.util.Format,C=this;var D=function(G,I,L,H){if(L&&A){if(L.substr(0,5)=="this."){return C.call(L.substr(5),B[I],B)}else{if(H){var K=/^\s*['"](.*)["']\s*$/;H=H.split(",");for(var J=0,F=H.length;J<F;J++){H[J]=H[J].replace(K,"$1")}H=[B[I]].concat(H)}else{H=[B[I]]}return E[L].apply(E,H)}}else{return B[I]!==undefined?B[I]:""}};return this.html.replace(this.re,D)},set:function(A,B){this.html=A;this.compiled=null;if(B){this.compile()}return this},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Ext.util.Format;var useF=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,name,format,args){if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format="this.call(\""+format.substr(5)+"\", ";args=", values"}}else{args="";format="(values['"+name+"'] == undefined ? '' : "}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'"};var body;if(Ext.isGecko){body="this.compiled = function(values){ return '"+this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+"';};"}else{body=["this.compiled = function(values){ return ['"];body.push(this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return this},call:function(C,B,A){return this[C](B,A)},insertFirst:function(B,A,C){return this.doInsert("afterBegin",B,A,C)},insertBefore:function(B,A,C){return this.doInsert("beforeBegin",B,A,C)},insertAfter:function(B,A,C){return this.doInsert("afterEnd",B,A,C)},append:function(B,A,C){return this.doInsert("beforeEnd",B,A,C)},doInsert:function(C,E,B,A){E=Ext.getDom(E);var D=Ext.DomHelper.insertHtml(C,E,this.applyTemplate(B));return A?Ext.get(D,true):D},overwrite:function(B,A,C){B=Ext.getDom(B);B.innerHTML=this.applyTemplate(A);return C?Ext.get(B.firstChild,true):B.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.DomHelper.Template=Ext.Template;Ext.Template.from=function(B,A){B=Ext.getDom(B);return new Ext.Template(B.value||B.innerHTML,A||"")};
Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={};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,F){if(typeof A=="object"){F=A;for(var E in F){if(this.filterOptRe.test(E)){continue}if(typeof F[E]=="function"){this.addListener(E,F[E],F.scope,F)}else{this.addListener(E,F[E].fn,F[E].scope,F[E])}}return }F=(!F||typeof F=="boolean")?{}:F;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,F)},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(D){if(!this.events){this.events={}}if(typeof D=="string"){for(var C=0,A=arguments,B;B=A[C];C++){if(!this.events[A[C]]){this.events[A[C]]=true}}}else{Ext.applyIf(this.events,D)}},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(G){if(!this.methodEvents){this.methodEvents={}}var F=this.methodEvents[G];if(!F){F={};this.methodEvents[G]=F;F.originalFn=this[G];F.methodName=G;F.before=[];F.after=[];var C,B,D;var E=this;var A=function(J,I,H){if((B=J.apply(I||E,H))!==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[G]=function(){C=B=undefined;D=false;var I=Array.prototype.slice.call(arguments,0);for(var J=0,H=F.before.length;J<H;J++){A(F.before[J].fn,F.before[J].scope,I);if(D){return C}}if((B=F.originalFn.apply(E,I))!==undefined){C=B}for(var J=0,H=F.after.length;J<H;J++){A(F.after[J].fn,F.after[J].scope,I);if(D){return C}}return C}}return F},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(F,D,C){var E=this.getMethodEvent(F);for(var B=0,A=E.before.length;B<A;B++){if(E.before[B].fn==D&&E.before[B].scope==C){E.before.splice(B,1);return }}for(var B=0,A=E.after.length;B<A;B++){if(E.after[B].fn==D&&E.after[B].scope==C){E.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(F,G,E,D){return function(){G.removeListener(E,D);return F.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,H){H=H||{};F=F||this.obj;var D={fn:G,scope:F,options:H};var E=G;if(H.delay){E=A(E,H,F)}if(H.single){E=C(E,this,G,F)}if(H.buffer){E=B(E,H,F)}D.fireFn=E;return D},findListener:function(I,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==I&&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,I,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 T,M,I=false;var K,S,C,O;var L=Ext.lib.Event;var N=Ext.lib.Dom;var B=function(){if(!I){I=true;Ext.isReady=true;if(M){clearInterval(M)}if(Ext.isGecko||Ext.isOpera){document.removeEventListener("DOMContentLoaded",B,false)}if(Ext.isIE){var D=document.getElementById("ie-deferred-loader");if(D){D.onreadystatechange=null;D.parentNode.removeChild(D)}}if(T){T.fire();T.clearListeners()}}};var A=function(){T=new Ext.util.Event();if(Ext.isGecko||Ext.isOpera){document.addEventListener("DOMContentLoaded",B,false)}else{if(Ext.isIE){document.write("<s"+"cript id=\"ie-deferred-loader\" defer=\"defer\" src=\"/"+"/:\"></s"+"cript>");var D=document.getElementById("ie-deferred-loader");D.onreadystatechange=function(){if(this.readyState=="complete"){B()}}}else{if(Ext.isSafari){M=setInterval(function(){var E=document.readyState;if(E=="complete"){B()}},10)}}}L.on(window,"load",B)};var R=function(E,U){var D=new Ext.util.DelayedTask(E);return function(V){V=new Ext.EventObjectImpl(V);D.delay(U.buffer,E,null,[V])}};var P=function(V,U,D,E){return function(W){Ext.EventManager.removeListener(U,D,E);V(W)}};var F=function(D,E){return function(U){U=new Ext.EventObjectImpl(U);setTimeout(function(){D(U)},E.delay||10)}};var J=function(U,E,D,Y,X){var Z=(!D||typeof D=="boolean")?{}:D;Y=Y||Z.fn;X=X||Z.scope;var W=Ext.getDom(U);if(!W){throw"Error listening for \""+E+"\". Element \""+U+"\" doesn't exist."}var V=function(b){b=Ext.EventObject.setEvent(b);var a;if(Z.delegate){a=b.getTarget(Z.delegate,W);if(!a){return }}else{a=b.target}if(Z.stopEvent===true){b.stopEvent()}if(Z.preventDefault===true){b.preventDefault()}if(Z.stopPropagation===true){b.stopPropagation()}if(Z.normalized===false){b=b.browserEvent}Y.call(X||W,b,a,Z)};if(Z.delay){V=F(V,Z)}if(Z.single){V=P(V,W,E,Y)}if(Z.buffer){V=R(V,Z)}Y._handlers=Y._handlers||[];Y._handlers.push([Ext.id(W),E,V]);L.on(W,E,V);if(E=="mousewheel"&&W.addEventListener){W.addEventListener("DOMMouseScroll",V,false);L.on(window,"unload",function(){W.removeEventListener("DOMMouseScroll",V,false)})}if(E=="mousedown"&&W==document){Ext.EventManager.stoppedMouseDownEvent.addListener(V)}return V};var G=function(E,U,Z){var D=Ext.id(E),a=Z._handlers,X=Z;if(a){for(var V=0,Y=a.length;V<Y;V++){var W=a[V];if(W[0]==D&&W[1]==U){X=W[2];a.splice(V,1);break}}}L.un(E,U,X);E=Ext.getDom(E);if(U=="mousewheel"&&E.addEventListener){E.removeEventListener("DOMMouseScroll",X,false)}if(U=="mousedown"&&E==document){Ext.EventManager.stoppedMouseDownEvent.removeListener(X)}};var H=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var Q={addListener:function(U,D,W,V,E){if(typeof D=="object"){var Y=D;for(var X in Y){if(H.test(X)){continue}if(typeof Y[X]=="function"){J(U,X,Y,Y[X],Y.scope)}else{J(U,X,Y[X])}}return }return J(U,D,E,W,V)},removeListener:function(E,D,U){return G(E,D,U)},onDocumentReady:function(U,E,D){if(I){T.addListener(U,E,D);T.fire();T.clearListeners();return }if(!T){A()}T.addListener(U,E,D)},onWindowResize:function(U,E,D){if(!K){K=new Ext.util.Event();S=new Ext.util.DelayedTask(function(){K.fire(N.getViewWidth(),N.getViewHeight())});L.on(window,"resize",this.fireWindowResize,this)}K.addListener(U,E,D)},fireWindowResize:function(){if(K){if((Ext.isIE||Ext.isAir)&&S){S.delay(50)}else{K.fire(N.getViewWidth(),N.getViewHeight())}}},onTextResize:function(V,U,D){if(!C){C=new Ext.util.Event();var E=new Ext.Element(document.createElement("div"));E.dom.className="x-text-resize";E.dom.innerHTML="X";E.appendTo(document.body);O=E.dom.offsetHeight;setInterval(function(){if(E.dom.offsetHeight!=O){C.fire(O,O=E.dom.offsetHeight)}},this.textResizeInterval)}C.addListener(V,U,D)},removeResizeListener:function(E,D){if(K){K.removeListener(E,D)}},fireResize:function(){if(K){K.fire(N.getViewWidth(),N.getViewHeight())}},ieDeferSrc:false,textResizeInterval:50};Q.on=Q.addListener;Q.un=Q.removeListener;Q.stoppedMouseDownEvent=new Ext.util.Event();return Q}();Ext.onReady=Ext.EventManager.onDocumentReady;Ext.onReady(function(){var B=Ext.getBody();if(!B){return }var A=[Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":"ext-ie7"):Ext.isGecko?"ext-gecko":Ext.isOpera?"ext-opera":Ext.isSafari?"ext-safari":""];if(Ext.isMac){A.push("ext-mac")}if(Ext.isLinux){A.push("ext-linux")}if(Ext.isBorderBox){A.push("ext-border-box")}if(Ext.isStrict){var C=B.dom.parentNode;if(C){C.className+=" ext-strict"}}B.addClass(A.join(" "))});Ext.EventObject=function(){var B=Ext.lib.Event;var A={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,RETURN:13,ENTER:13,SHIFT:16,CONTROL:17,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,F5:116,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 E=0;if(D.wheelDelta){E=D.wheelDelta/120}else{if(D.detail){E=-D.detail/3}}return E},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)?true:false},within:function(E,F){var D=this[F?"getRelatedTarget":"getTarget"]();return D&&Ext.fly(E).contains(D)},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,unique){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){Ext.EventManager.removeListener(this.dom,eventName,fn);return this},removeAllListeners:function(){E.purgeElement(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.isGecko){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.setStyle("position","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.dom.clientWidth,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")},isMasked:function(){return this._mask&&this._mask.isVisible()},createShim:function(){var el=document.createElement("iframe");el.frameBorder="no";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);this.dom.parentNode.removeChild(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){E.purgeElement(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.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(D,F){if(Ext.isArray(D)){for(var C=0,A=D.length;C<A;C++){this.removeElement(D[C])}return this}var B=typeof D=="number"?D:this.indexOf(D);if(B!==-1&&this.elements[B]){if(F){var E=this.elements[B];if(E.dom){E.remove()}else{Ext.removeNode(E)}}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(D,C,A){var B=typeof D=="number"?D:this.indexOf(D);if(B!==-1){C=Ext.getDom(C);if(A){var E=this.elements[B];E.parentNode.insertBefore(C,E);Ext.removeNode(E)}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.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,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 G=Ext.urlEncode(this.extraParams);C=C?(C+"&"+G):G}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 I=D.getAttribute("enctype");if(E.isUpload||(I&&I.toLowerCase()=="multipart/form-data")){return this.doFormUpload(E,C,B)}var H=Ext.lib.Ajax.serializeForm(D);C=C?(C+"&"+H):H}var J=E.headers;if(this.defaultHeaders){J=Ext.apply(J||{},this.defaultHeaders);if(!E.headers){E.headers=J}}var F={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:E},timeout:E.timeout||this.timeout};var A=E.method||this.method||(C?"POST":"GET");if(A=="GET"&&(this.disableCaching&&E.disableCaching!==false)||E.disableCaching===true){B+=(B.indexOf("?")!=-1?"&":"?")+"_dc="+(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,F,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 L,J;if(A){L=[];A=Ext.urlDecode(A,false);for(var H in A){if(A.hasOwnProperty(H)){J=document.createElement("input");J.type="hidden";J.name=H;J.value=A[H];D.appendChild(J);L.push(J)}}}function G(){var M={responseText:"",responseXML:null};M.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){M.responseText=O.body.innerHTML}if(O&&O.XMLDocument){M.responseXML=O.XMLDocument}else{M.responseXML=O}}catch(N){}Ext.EventManager.removeListener(F,"load",G,this);this.fireEvent("requestcomplete",this,M,E);Ext.callback(E.success,E.scope,[M,E]);Ext.callback(E.callback,E.scope,[E,true,M]);setTimeout(function(){Ext.removeNode(F)},100)}Ext.EventManager.on(F,"load",G,this);D.submit();if(L){for(var I=0,K=L.length;I<K;I++){Ext.removeNode(L[I])}}}});Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(A){return Ext.lib.Ajax.serializeForm(A)}});
Ext.Updater=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=new Ext.Updater.BasicRenderer()}Ext.Updater.superclass.constructor.call(this)};Ext.extend(Ext.Updater,Ext.util.Observable,{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(A||{},{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}});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;
Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(B){if(Date.formatFunctions[B]==null){Date.createNewFormat(B)}var A=Date.formatFunctions[B];return this[A]()};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var code="Date.prototype."+funcName+" = function(){return ";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;code+="'"+String.escape(ch)+"' + "}else{code+=Date.getFormatCode(ch)+" + "}}}eval(code.substring(0,code.length-3)+";}")};Date.formatCodes={d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var E="Y-m-dTH:i:sP",C=[],B=0,A=E.length;B<A;++B){var D=E.charAt(B);C.push(D=="T"?"'T'":Date.getFormatCode(D))}return C.join(" + ")},U:"Math.round(this.getTime() / 1000)"};Date.getFormatCode=function(B){var A=Date.formatCodes[B];if(A){A=Ext.type(A)=="function"?A():A;Date.formatCodes[B]=A}return A||("'"+String.escape(B)+"'")};Date.parseDate=function(A,C){if(Date.parseFunctions[C]==null){Date.createParser(C)}var B=Date.parseFunctions[C];return Date[B](A)};Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++;var regexNum=Date.parseRegexes.length;var currentGroup=1;Date.parseFunctions[format]=funcName;var code="Date."+funcName+" = function(input){\n"+"var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, ms = -1, o, z, u, v;\n"+"input = String(input);var d = new Date();\n"+"y = d.getFullYear();\n"+"m = d.getMonth();\n"+"d = d.getDate();\n"+"var results = input.match(Date.parseRegexes["+regexNum+"]);\n"+"if (results && results.length > 0) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;regex+=String.escape(ch)}else{var obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c}}}}code+="if (u){\n"+"v = new Date(u * 1000);\n"+"}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0){\n"+"v = new Date(y, m, d, h, i, s, ms);\n"+"}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0){\n"+"v = new Date(y, m, d, h, i, s);\n"+"}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0){\n"+"v = new Date(y, m, d, h, i);\n"+"}else if (y >= 0 && m >= 0 && d > 0 && h >= 0){\n"+"v = new Date(y, m, d, h);\n"+"}else if (y >= 0 && m >= 0 && d > 0){\n"+"v = new Date(y, m, d);\n"+"}else if (y >= 0 && m >= 0){\n"+"v = new Date(y, m);\n"+"}else if (y >= 0){\n"+"v = new Date(y);\n"+"}\n}\nreturn (v && Ext.type(z || o) == 'number')?"+" (Ext.type(z) == 'number' ? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + z) :"+" v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v;\n"+"}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$","i");eval(code)};Date.parseCodes={d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:function(){return Ext.applyIf({s:"(\\d{1,2})"},Date.parseCodes["d"])},D:function(){for(var A=[],B=0;B<7;A.push(Date.getShortDayName(B)),++B){}return{g:0,c:null,s:"(?:"+A.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:0,c:null,s:"(?:\\d{1,3}"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var A=[],B=0;B<12;A.push(Date.getShortMonthName(B)),++B){}return Ext.applyIf({s:"("+A.join("|")+")"},Date.parseCodes["F"])},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:function(){return Ext.applyIf({s:"(\\d{1,2})"},Date.parseCodes["m"])},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return Date.parseCodes["Y"]},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"},g:function(){return Date.parseCodes["G"]},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return Date.parseCodes["H"]},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = parseInt(results[{0}], 10);\n",s:"(\\d{3})"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1);","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);","var mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:function(){return Ext.applyIf({s:"([+-]\\d{2}:\\d{2})"},Date.parseCodes["O"])},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"z = results[{0}] * 1;\n"+"z = (-43200 <= z && z <= 50400)? z : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var E=Date.formatCodeToRegex,C=[];var A=[E("Y",1),E("m",2),E("d",3),E("h",4),E("i",5),E("s",6),{c:"if(results[7] == 'Z'){\no = 0;\n}else{\n"+E("P",7).c+"\n}"}];for(var D=0,B=A.length;D<B;++D){C.push(A[D].c)}return{g:1,c:C.join(""),s:A[0].s+"-"+A[1].s+"-"+A[2].s+"T"+A[3].s+":"+A[4].s+":"+A[5].s+"("+E("P",7).s+"|Z)"}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}};Date.formatCodeToRegex=function(B,A){var C=Date.parseCodes[B];if(C){C=Ext.type(C)=="function"?C():C;Date.parseCodes[B]=C;if(C.c){C.c=String.format(C.c,A)}}return C||{g:0,c:null,s:Ext.escapeRe(B)}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")};Date.prototype.getGMTOffset=function(A){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+(A?":":"")+String.leftPad(this.getTimezoneOffset()%60,2,"0")};Date.prototype.getDayOfYear=function(){var A=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var B=0;B<this.getMonth();++B){A+=Date.daysInMonth[B]}return A+this.getDate()-1};Date.prototype.getWeekOfYear=function(){var B=86400000;var C=7*B;var D=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/B;var A=Math.floor(D/7);var E=new Date(A*C).getUTCFullYear();return A-Math.floor(Date.UTC(E,0,7)/C)+1};Date.prototype.isLeapYear=function(){var A=this.getFullYear();return !!((A&3)==0&&(A%100||(A%400==0&&A)))};Date.prototype.getFirstDayOfMonth=function(){var A=(this.getDay()-(this.getDate()-1))%7;return(A<0)?(A+7):A};Date.prototype.getLastDayOfMonth=function(){var A=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(A<0)?(A+7):A};Date.prototype.getFirstDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),1)};Date.prototype.getLastDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()]};Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.getShortMonthName=function(A){return Date.monthNames[A].substring(0,3)};Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.getShortDayName=function(A){return Date.dayNames[A].substring(0,3)};Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.getMonthNumber=function(A){return Date.monthNumbers[A.substring(0,1).toUpperCase()+A.substring(1,3).toLowerCase()]};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.clearTime=function(A){if(A){return this.clone().clearTime()}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};if(Ext.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(A){if(A<=-1){var D=Math.ceil(-A);var C=Math.ceil(D/12);var B=(D%12)?12-D%12:0;this.setFullYear(this.getFullYear()-C);return Date.brokenSetMonth.call(this,B)}else{return Date.brokenSetMonth.apply(this,arguments)}}}Date.MILLI="ms";Date.SECOND="s";Date.MINUTE="mi";Date.HOUR="h";Date.DAY="d";Date.MONTH="mo";Date.YEAR="y";Date.prototype.add=function(B,C){var D=this.clone();if(!B||C===0){return D}switch(B.toLowerCase()){case Date.MILLI:D.setMilliseconds(this.getMilliseconds()+C);break;case Date.SECOND:D.setSeconds(this.getSeconds()+C);break;case Date.MINUTE:D.setMinutes(this.getMinutes()+C);break;case Date.HOUR:D.setHours(this.getHours()+C);break;case Date.DAY:D.setDate(this.getDate()+C);break;case Date.MONTH:var A=this.getDate();if(A>28){A=Math.min(A,this.getFirstDateOfMonth().add("mo",C).getLastDateOfMonth().getDate())}D.setDate(A);D.setMonth(this.getMonth()+C);break;case Date.YEAR:D.setFullYear(this.getFullYear()+C);break}return D};Date.prototype.between=function(C,A){var B=this.getTime();return C.getTime()<=B&&B<=A.getTime()};
Ext.util.DelayedTask=function(E,D,A){var G=null,F,B;var C=function(){var H=new Date().getTime();if(H-B>=F){clearInterval(G);G=null;E.apply(D,A||[])}};this.delay=function(I,K,J,H){if(G&&I!=F){this.cancel()}F=I;B=new Date().getTime();E=K||E;D=J||D;A=H||A;if(!G){G=setInterval(C,F)}};this.cancel=function(){if(G){clearInterval(G);G=null}}};
Ext.util.TaskRunner=function(E){E=E||10;var F=[],A=[];var B=0;var G=false;var D=function(){G=false;clearInterval(B);B=0};var H=function(){if(!G){G=true;B=setInterval(I,E)}};var C=function(J){A.push(J);if(J.onStop){J.onStop.apply(J.scope||J)}};var I=function(){if(A.length>0){for(var O=0,K=A.length;O<K;O++){F.remove(A[O])}A=[];if(F.length<1){D();return }}var M=new Date().getTime();for(var O=0,K=F.length;O<K;++O){var N=F[O];var J=M-N.taskRunTime;if(N.interval<=J){var L=N.run.apply(N.scope||N,N.args||[++N.taskRunCount]);N.taskRunTime=M;if(L===false||N.taskRunCount===N.repeat){C(N);return }}if(N.duration&&N.duration<=(M-N.taskStartTime)){C(N)}}};this.start=function(J){F.push(J);J.taskStartTime=new Date().getTime();J.taskRunTime=0;J.taskRunCount=0;H();return J};this.stop=function(J){C(J);return J};this.stopAll=function(){D();for(var K=0,J=F.length;K<J;K++){if(F[K].onStop){F[K].onStop()}}F=[];A=[]}};Ext.TaskMgr=new Ext.util.TaskRunner();
Ext.util.MixedCollection=function(B,A){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=B===true;if(A){this.getKey=A}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(B,C){if(arguments.length==1){C=arguments[0];B=this.getKey(C)}if(typeof B=="undefined"||B===null){this.length++;this.items.push(C);this.keys.push(null)}else{var A=this.map[B];if(A){return this.replace(B,C)}this.length++;this.items.push(C);this.map[B]=C;this.keys.push(B)}this.fireEvent("add",this.length-1,C,B);return C},getKey:function(A){return A.id},replace:function(C,D){if(arguments.length==1){D=arguments[0];C=this.getKey(D)}var A=this.item(C);if(typeof C=="undefined"||C===null||typeof A=="undefined"){return this.add(C,D)}var B=this.indexOfKey(C);this.items[B]=D;this.map[C]=D;this.fireEvent("replace",C,A,D);return D},addAll:function(E){if(arguments.length>1||Ext.isArray(E)){var B=arguments.length>1?arguments:E;for(var D=0,A=B.length;D<A;D++){this.add(B[D])}}else{for(var C in E){if(this.allowFunctions||typeof E[C]!="function"){this.add(C,E[C])}}}},each:function(E,D){var B=[].concat(this.items);for(var C=0,A=B.length;C<A;C++){if(E.call(D||B[C],B[C],C,A)===false){break}}},eachKey:function(D,C){for(var B=0,A=this.keys.length;B<A;B++){D.call(C||window,this.keys[B],this.items[B],B,A)}},find:function(D,C){for(var B=0,A=this.items.length;B<A;B++){if(D.call(C||window,this.items[B],this.keys[B])){return this.items[B]}}return null},insert:function(A,B,C){if(arguments.length==2){C=arguments[1];B=this.getKey(C)}if(A>=this.length){return this.add(B,C)}this.length++;this.items.splice(A,0,C);if(typeof B!="undefined"&&B!=null){this.map[B]=C}this.keys.splice(A,0,B);this.fireEvent("add",A,C,B);return C},remove:function(A){return this.removeAt(this.indexOf(A))},removeAt:function(A){if(A<this.length&&A>=0){this.length--;var C=this.items[A];this.items.splice(A,1);var B=this.keys[A];if(typeof B!="undefined"){delete this.map[B]}this.keys.splice(A,1);this.fireEvent("remove",C,B);return C}return false},removeKey:function(A){return this.removeAt(this.indexOfKey(A))},getCount:function(){return this.length},indexOf:function(A){return this.items.indexOf(A)},indexOfKey:function(A){return this.keys.indexOf(A)},item:function(A){var B=typeof this.map[A]!="undefined"?this.map[A]:this.items[A];return typeof B!="function"||this.allowFunctions?B:null},itemAt:function(A){return this.items[A]},key:function(A){return this.map[A]},contains:function(A){return this.indexOf(A)!=-1},containsKey:function(A){return typeof this.map[A]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(I,A,H){var C=String(A).toUpperCase()=="DESC"?-1:1;H=H||function(K,J){return K-J};var G=[],B=this.keys,F=this.items;for(var D=0,E=F.length;D<E;D++){G[G.length]={key:B[D],value:F[D],index:D}}G.sort(function(K,J){var L=H(K[I],J[I])*C;if(L==0){L=(K.index<J.index?-1:1)}return L});for(var D=0,E=G.length;D<E;D++){F[D]=G[D].value;B[D]=G[D].key}this.fireEvent("sort",this)},sort:function(A,B){this._sort("value",A,B)},keySort:function(A,B){this._sort("key",A,B||function(D,C){return String(D).toUpperCase()-String(C).toUpperCase()})},getRange:function(E,A){var B=this.items;if(B.length<1){return[]}E=E||0;A=Math.min(typeof A=="undefined"?this.length-1:A,this.length-1);var D=[];if(E<=A){for(var C=E;C<=A;C++){D[D.length]=B[C]}}else{for(var C=E;C>=A;C--){D[D.length]=B[C]}}return D},filter:function(C,B,D,A){if(Ext.isEmpty(B,false)){return this.clone()}B=this.createValueMatcher(B,D,A);return this.filterBy(function(E){return E&&B.test(E[C])})},filterBy:function(F,E){var G=new Ext.util.MixedCollection();G.getKey=this.getKey;var B=this.keys,D=this.items;for(var C=0,A=D.length;C<A;C++){if(F.call(E||this,D[C],B[C])){G.add(B[C],D[C])}}return G},findIndex:function(C,B,E,D,A){if(Ext.isEmpty(B,false)){return -1}B=this.createValueMatcher(B,D,A);return this.findIndexBy(function(F){return F&&B.test(F[C])},null,E)},findIndexBy:function(F,E,G){var B=this.keys,D=this.items;for(var C=(G||0),A=D.length;C<A;C++){if(F.call(E||this,D[C],B[C])){return C}}if(typeof G=="number"&&G>0){for(var C=0;C<G;C++){if(F.call(E||this,D[C],B[C])){return C}}}return -1},createValueMatcher:function(B,C,A){if(!B.exec){B=String(B);B=new RegExp((C===true?"":"^")+Ext.escapeRe(B),A?"":"i")}return B},clone:function(){var E=new Ext.util.MixedCollection();var B=this.keys,D=this.items;for(var C=0,A=D.length;C<A;C++){E.add(B[C],D[C])}E.getKey=this.getKey;return E}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;
Ext.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.util.Format=function(){var trimRe=/^\s+|\s+$/g;return{ellipsis:function(value,len){if(value&&value.length>len){return value.substr(0,len-3)+"..."}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(value){return !value?value:String(value).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,"\"")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split(".");var whole=ps[0];var sub=ps[1]?"."+ps[1]:".00";var r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1"+","+"$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"")},stripScriptsRe:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,stripScripts:function(v){return !v?v:String(v).replace(this.stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}()}}();
Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var P=this.html;P=["<tpl>",P,"</tpl>"].join("");var O=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/;var N=/^<tpl\b[^>]*?for="(.*?)"/;var L=/^<tpl\b[^>]*?if="(.*?)"/;var J=/^<tpl\b[^>]*?exec="(.*?)"/;var C,B=0;var G=[];while(C=P.match(O)){var M=C[0].match(N);var K=C[0].match(L);var I=C[0].match(J);var E=null,H=null,D=null;var A=M&&M[1]?M[1]:"";if(K){E=K&&K[1]?K[1]:null;if(E){H=new Function("values","parent","xindex","xcount","with(values){ return "+(Ext.util.Format.htmlDecode(E))+"; }")}}if(I){E=I&&I[1]?I[1]:null;if(E){D=new Function("values","parent","xindex","xcount","with(values){ "+(Ext.util.Format.htmlDecode(E))+"; }")}}if(A){switch(A){case".":A=new Function("values","parent","with(values){ return values; }");break;case"..":A=new Function("values","parent","with(values){ return parent; }");break;default:A=new Function("values","parent","with(values){ return "+A+"; }")}}G.push({id:B,target:A,exec:D,test:H,body:C[1]||""});P=P.replace(C[0],"{xtpl"+B+"}");++B}for(var F=G.length-1;F>=0;--F){this.compileTpl(G[F])}this.master=G[G.length-1];this.tpls=G};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(A,H,G,D,C){var J=this.tpls[A];if(J.test&&!J.test.call(this,H,G,D,C)){return""}if(J.exec&&J.exec.call(this,H,G,D,C)){return""}var I=J.target?J.target.call(this,H,G):H;G=J.target?H:G;if(J.target&&Ext.isArray(I)){var B=[];for(var E=0,F=I.length;E<F;E++){B[B.length]=J.compiled.call(this,I[E],G,E+1,F)}return B.join("")}return J.compiled.call(this,I,G,D,C)},compileTpl:function(tpl){var fm=Ext.util.Format;var useF=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,name,format,args,math){if(name.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+name.substr(4)+", values, parent, xindex, xcount)"+sep+"'"}var v;if(name==="."){v="values"}else{if(name==="#"){v="xindex"}else{if(name.indexOf(".")!=-1){v=name}else{v="values['"+name+"']"}}}if(math){v="("+v+math+")"}if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format="this.call(\""+format.substr(5)+"\", ";args=", values"}}else{args="";format="("+v+" === undefined ? '' : "}return"'"+sep+format+v+args+")"+sep+"'"};var codeFn=function(m,code){return"'"+sep+"("+code+")"+sep+"'"};var body;if(Ext.isGecko){body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+"';};"}else{body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("")}eval(body);return this},applyTemplate:function(A){return this.master.compiled.call(this,A,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(A){A=Ext.getDom(A);return new Ext.XTemplate(A.value||A.innerHTML)};
Ext.util.ClickRepeater=function(B,A){this.el=Ext.get(B);this.el.unselectable();Ext.apply(this,A);this.addEvents("mousedown","click","mouseup");this.el.on("mousedown",this.handleMouseDown,this);if(this.preventDefault||this.stopDefault){this.el.on("click",function(C){if(this.preventDefault){C.preventDefault()}if(this.stopDefault){C.stopEvent()}},this)}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)};Ext.extend(Ext.util.ClickRepeater,Ext.util.Observable,{interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,handleMouseDown:function(){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this);this.fireEvent("click",this);if(this.accelerate){this.delay=400}this.timer=this.click.defer(this.delay||this.interval,this)},click:function(){this.fireEvent("click",this);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this)},easeOutExpo:function(B,A,D,C){return(B==C)?A+D:D*(-Math.pow(2,-10*B/C)+1)+A},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn);this.el.un("mouseout",this.handleMouseOut);Ext.getDoc().un("mouseup",this.handleMouseUp);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this)}});
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 N=D.key,C=D.shift,A=D.ctrl,G=D.alt,J=D.fn||D.handler,M=D.scope;if(typeof N=="string"){var K=[];var I=N.toUpperCase();for(var E=0,H=I.length;E<H;E++){K.push(I.charCodeAt(E))}N=K}var B=Ext.isArray(N);var L=function(R){if((!C||R.shiftKey)&&(!A||R.ctrlKey)&&(!G||R.altKey)){var P=R.getKey();if(B){for(var Q=0,O=N.length;Q<O;Q++){if(N[Q]==P){if(this.stopEvent){R.stopEvent()}J.call(M||window,P,R);return }}}else{if(P==N){if(this.stopEvent){R.stopEvent()}J.call(M||window,P,R)}}}};this.bindings.push(L)},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(D){if(this.enabled){var B=this.bindings;for(var C=0,A=B.length;C<A;C++){B[C].call(this,D)}}},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.util.TextMetrics=function(){var A;return{measure:function(B,C,D){if(!A){A=Ext.util.TextMetrics.Instance(B,D)}A.bind(B);A.setFixedWidth(D||"auto");return A.getSize(C)},createInstance:function(B,C){return Ext.util.TextMetrics.Instance(B,C)}}}();Ext.util.TextMetrics.Instance=function(B,D){var C=new Ext.Element(document.createElement("div"));document.body.appendChild(C.dom);C.position("absolute");C.setLeftTop(-1000,-1000);C.hide();if(D){C.setWidth(D)}var A={getSize:function(F){C.update(F);var E=C.getSize();C.update("");return E},bind:function(E){C.setStyle(Ext.fly(E).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(E){C.setWidth(E)},getWidth:function(E){C.dom.style.width="auto";return this.getSize(E).width},getHeight:function(E){return this.getSize(E).height}};A.bind(B);return A};Ext.Element.measureText=Ext.util.TextMetrics.measure;
(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},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(H,F,M){if(typeof F=="number"){F={left:F,right:F,top:F,bottom:F}}F=F||this.defaultPadding;var J=Ext.get(this.getEl()).getBox();var C=Ext.get(H);var L=C.getScroll();var I,D=C.dom;if(D==document.body){I={x:L.left,y:L.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var K=C.getXY();I={x:K[0]+L.left,y:K[1]+L.top,width:D.clientWidth,height:D.clientHeight}}var G=J.y-I.y;var E=J.x-I.x;this.resetConstraints();this.setXConstraint(E-(F.left||0),I.width-E-J.width-(F.right||0),this.xTickSize);this.setYConstraint(G-(F.top||0),I.height-G-J.height-(F.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(E,D){if(this.primaryButtonOnly&&E.button!=0){return }if(this.isLocked()){return }this.DDM.refreshCache(this.groups);var C=new Ext.lib.Point(Ext.lib.Event.getPageX(E),Ext.lib.Event.getPageY(E));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(C,this)){}else{if(this.clickValidator(E)){this.setStartPosition();this.b4MouseDown(E);this.onMouseDown(E);this.DDM.handleMouseDown(E,this);this.DDM.stopEvent(E)}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(F){var E=true;var H;try{H=F.nodeName.toUpperCase()}catch(G){H=F.nodeName}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D])}return E},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(I,F){if(!F){return I}else{if(F[0]>=I){return F[0]}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;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][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()}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(K,L){var N=this.dragCurrent;if(!N||N.isLocked()){return }var O=K.getPoint();var B=[];var E=[];var I=[];var G=[];var D=[];for(var F in this.dragOvers){var C=this.dragOvers[F];if(!this.isTypeOfDD(C)){continue}if(!this.isOverTarget(O,C,this.mode)){E.push(C)}B[F]=true;delete this.dragOvers[F]}for(var M in N.groups){if("string"!=typeof M){continue}for(F in this.ids[M]){var H=this.ids[M][F];if(!this.isTypeOfDD(H)){continue}if(H.isTarget&&!H.isLocked()&&H!=N){if(this.isOverTarget(O,H,this.mode)){if(L){G.push(H)}else{if(!B[H.id]){D.push(H)}else{I.push(H)}this.dragOvers[H.id]=H}}}}}if(this.mode){if(E.length){N.b4DragOut(K,E);N.onDragOut(K,E)}if(D.length){N.onDragEnter(K,D)}if(I.length){N.b4DragOver(K,I);N.onDragOver(K,I)}if(G.length){N.b4DragDrop(K,G);N.onDragDrop(K,G)}}else{var J=0;for(F=0,J=E.length;F<J;++F){N.b4DragOut(K,E[F].id);N.onDragOut(K,E[F].id)}for(F=0,J=D.length;F<J;++F){N.onDragEnter(K,D[F].id)}for(F=0,J=I.length;F<J;++F){N.b4DragOver(K,I[F].id);N.onDragOver(K,I[F].id)}for(F=0,J=G.length;F<J;++F){N.b4DragDrop(K,G[F].id);N.onDragDrop(K,G[F].id)}}if(L&&!G.length){N.onInvalidDrop(K)}},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(G){if(!this.isTypeOfDD(G)){return null}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=Ext.lib.Dom.getXY(E)}catch(H){}if(!J){return null}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new Ext.lib.Region(M,B,I,F)},isOverTarget:function(J,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(J);var I=this.dragCurrent;if(!I||!I.getTargetCoord||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver}B.overlap=null;var G=I.getTargetCoord(J.x,J.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(C,B){return(C-B)},_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(J,I,E,K){if(this.scroll){var L=Ext.lib.Dom.getViewHeight();var B=Ext.lib.Dom.getViewWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A)}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A)}if(M>B&&F<C){window.scrollTo(D+A,N)}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N)}}},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)}});
Ext.dd.ScrollManager=function(){var C=Ext.dd.DragDropMgr;var E={};var B=null;var H={};var G=function(K){B=null;A()};var I=function(){if(C.dragCurrent){C.refreshCache(C.dragCurrent.groups)}};var D=function(){if(C.dragCurrent){var K=Ext.dd.ScrollManager;var L=H.el.ddScrollConfig?H.el.ddScrollConfig.increment:K.increment;if(!K.animate){if(H.el.scroll(H.dir,L)){I()}}else{H.el.scroll(H.dir,L,true,K.animDuration,I)}}};var A=function(){if(H.id){clearInterval(H.id)}H.id=0;H.el=null;H.dir=""};var F=function(L,K){A();H.el=L;H.dir=K;H.id=setInterval(D,Ext.dd.ScrollManager.frequency)};var J=function(N,P){if(P||!C.dragCurrent){return }var Q=Ext.dd.ScrollManager;if(!B||B!=C.dragCurrent){B=C.dragCurrent;Q.refreshCache()}var R=Ext.lib.Event.getXY(N);var S=new Ext.lib.Point(R[0],R[1]);for(var L in E){var M=E[L],K=M._region;var O=M.ddScrollConfig?M.ddScrollConfig:Q;if(K&&K.contains(S)&&M.isScrollable()){if(K.bottom-S.y<=O.vthresh){if(H.el!=M){F(M,"down")}return }else{if(K.right-S.x<=O.hthresh){if(H.el!=M){F(M,"left")}return }else{if(S.y-K.top<=O.vthresh){if(H.el!=M){F(M,"up")}return }else{if(S.x-K.left<=O.hthresh){if(H.el!=M){F(M,"right")}return }}}}}}A()};C.fireEvents=C.fireEvents.createSequence(J,C);C.stopDrag=C.stopDrag.createSequence(G,C);return{register:function(M){if(Ext.isArray(M)){for(var L=0,K=M.length;L<K;L++){this.register(M[L])}}else{M=Ext.get(M);E[M.id]=M}},unregister:function(M){if(Ext.isArray(M)){for(var L=0,K=M.length;L<K;L++){this.unregister(M[L])}}else{M=Ext.get(M);delete E[M.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,refreshCache:function(){for(var K in E){if(typeof E[K]=="object"){E[K]._region=E[K].getRegion()}}}}}();
Ext.dd.Registry=function(){var D={};var B={};var A=0;var C=function(F,E){if(typeof F=="string"){return F}var G=F.id;if(!G&&E!==false){G="extdd-"+(++A);F.id=G}return G};return{register:function(H,I){I=I||{};if(typeof H=="string"){H=document.getElementById(H)}I.ddel=H;D[C(H)]=I;if(I.isHandle!==false){B[I.ddel.id]=I}if(I.handles){var G=I.handles;for(var F=0,E=G.length;F<E;F++){B[C(G[F])]=I}}},unregister:function(H){var J=C(H,false);var I=D[J];if(I){delete D[J];if(I.handles){var G=I.handles;for(var F=0,E=G.length;F<E;F++){delete B[C(G[F],false)]}}}},getHandle:function(E){if(typeof E!="string"){E=E.id}return B[E]},getHandleFromEvent:function(F){var E=Ext.lib.Event.getTarget(F);return E?B[E.id]:null},getTarget:function(E){if(typeof E!="string"){E=E.id}return D[E]},getTargetFromEvent:function(F){var E=Ext.lib.Event.getTarget(F);return E?D[E.id]||B[E.id]:null}}}();
Ext.dd.StatusProxy=function(A){Ext.apply(this,A);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!A||A.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(A){A=A||this.dropNotAllowed;if(this.dropStatus!=A){this.el.replaceClass(this.dropStatus,A);this.dropStatus=A}},reset:function(A){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(A){this.ghost.update("")}},update:function(A){if(typeof A=="string"){this.ghost.update(A)}else{this.ghost.update("");A.style.margin="0";this.ghost.dom.appendChild(A)}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(A){this.el.hide();if(A){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(B,C,A){this.callback=C;this.scope=A;if(B&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:B,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null}};
Ext.data.SortTypes={none:function(A){return A},stripTagsRE:/<\/?[^>]+>/gi,asText:function(A){return String(A).replace(this.stripTagsRE,"")},asUCText:function(A){return String(A).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(A){return String(A).toUpperCase()},asDate:function(A){if(!A){return 0}if(Ext.isDate(A)){return A.getTime()}return Date.parse(String(A))},asFloat:function(A){var B=parseFloat(String(A).replace(/,/g,""));if(isNaN(B)){B=0}return B},asInt:function(A){var B=parseInt(String(A).replace(/,/g,""));if(isNaN(B)){B=0}return B}};
Ext.data.Record=function(A,B){this.id=(B||B===0)?B:++Ext.data.Record.AUTO_ID;this.data=A};Ext.data.Record.create=function(E){var C=Ext.extend(Ext.data.Record,{});var D=C.prototype;D.fields=new Ext.util.MixedCollection(false,function(F){return F.name});for(var B=0,A=E.length;B<A;B++){D.fields.add(new Ext.data.Field(E[B]))}C.getField=function(F){return D.fields.get(F)};return C};Ext.data.Record.AUTO_ID=1000;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,join:function(A){this.store=A},set:function(A,B){if(String(this.data[A])==String(B)){return }this.dirty=true;if(!this.modified){this.modified={}}if(typeof this.modified[A]=="undefined"){this.modified[A]=this.data[A]}this.data[A]=B;if(!this.editing&&this.store){this.store.afterEdit(this)}},get:function(A){return this.data[A]},beginEdit:function(){this.editing=true;this.modified={}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty&&this.store){this.store.afterEdit(this)}},reject:function(B){var A=this.modified;for(var C in A){if(typeof A[C]!="function"){this.data[C]=A[C]}}this.dirty=false;delete this.modified;this.editing=false;if(this.store&&B!==true){this.store.afterReject(this)}},commit:function(A){this.dirty=false;delete this.modified;this.editing=false;if(this.store&&A!==true){this.store.afterCommit(this)}},getChanges:function(){var A=this.modified,B={};for(var C in A){if(A.hasOwnProperty(C)){B[C]=this.data[C]}}return B},hasError:function(){return this.error!=null},clearError:function(){this.error=null},copy:function(A){return new this.constructor(Ext.apply({},this.data),A||this.id)},isModified:function(A){return this.modified&&this.modified.hasOwnProperty(A)}};
Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var A=0,B;B=arguments[A];A++){this.add(B)}},unregister:function(){for(var A=0,B;B=arguments[A];A++){this.remove(this.lookup(B))}},lookup:function(A){return typeof A=="object"?A:this.get(A)},getKey:function(A){return A.storeId||A.id}});
Ext.data.Store=function(A){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(B){return B.id};this.baseParams={};this.paramNames={"start":"start","limit":"limit","sort":"sort","dir":"dir"};if(A&&A.data){this.inlineData=A.data;delete A.data}Ext.apply(this,A);if(this.url&&!this.proxy){this.proxy=new Ext.data.HttpProxy({url:this.url})}if(this.reader){if(!this.recordType){this.recordType=this.reader.recordType}if(this.reader.onMetaChange){this.reader.onMetaChange=this.onMetaChange.createDelegate(this)}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","beforeload","load","loadexception");if(this.proxy){this.relayEvents(this.proxy,["loadexception"])}this.sortToggle={};if(this.sortInfo){this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction)}Ext.data.Store.superclass.constructor.call(this);if(this.storeId||this.id){Ext.StoreMgr.register(this)}if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}};Ext.extend(Ext.data.Store,Ext.util.Observable,{remoteSort:false,pruneModifiedRecords:false,lastOptions:null,destroy:function(){if(this.id){Ext.StoreMgr.unregister(this)}this.data=null;this.purgeListeners()},add:function(B){B=[].concat(B);if(B.length<1){return }for(var D=0,A=B.length;D<A;D++){B[D].join(this)}var C=this.data.length;this.data.addAll(B);if(this.snapshot){this.snapshot.addAll(B)}this.fireEvent("add",this,B,C)},addSorted:function(A){var B=this.findInsertIndex(A);this.insert(B,A)},remove:function(A){var B=this.data.indexOf(A);this.data.removeAt(B);if(this.pruneModifiedRecords){this.modified.remove(A)}if(this.snapshot){this.snapshot.remove(A)}this.fireEvent("remove",this,A,B)},removeAll:function(){this.data.clear();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}this.fireEvent("clear",this)},insert:function(C,B){B=[].concat(B);for(var D=0,A=B.length;D<A;D++){this.data.insert(C,B[D]);B[D].join(this)}this.fireEvent("add",this,B,C)},indexOf:function(A){return this.data.indexOf(A)},indexOfId:function(A){return this.data.indexOfKey(A)},getById:function(A){return this.data.key(A)},getAt:function(A){return this.data.itemAt(A)},getRange:function(B,A){return this.data.getRange(B,A)},storeOptions:function(A){A=Ext.apply({},A);delete A.callback;delete A.scope;this.lastOptions=A},load:function(B){B=B||{};if(this.fireEvent("beforeload",this,B)!==false){this.storeOptions(B);var C=Ext.apply(B.params||{},this.baseParams);if(this.sortInfo&&this.remoteSort){var A=this.paramNames;C[A["sort"]]=this.sortInfo.field;C[A["dir"]]=this.sortInfo.direction}this.proxy.load(C,this.reader,this.loadRecords,this,B);return true}else{return false}},reload:function(A){this.load(Ext.applyIf(A||{},this.lastOptions))},loadRecords:function(G,B,F){if(!G||F===false){if(F!==false){this.fireEvent("load",this,[],B)}if(B.callback){B.callback.call(B.scope||this,[],B,false)}return }var E=G.records,D=G.totalRecords||E.length;if(!B||B.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var C=0,A=E.length;C<A;C++){E[C].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.data.clear();this.data.addAll(E);this.totalLength=D;this.applySort();this.fireEvent("datachanged",this)}else{this.totalLength=Math.max(D,this.data.length+E.length);this.add(E)}this.fireEvent("load",this,E,B);if(B.callback){B.callback.call(B.scope||this,E,B,true)}},loadData:function(C,A){var B=this.reader.readRecords(C);this.loadRecords(B,{add:A},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if(this.sortInfo&&!this.remoteSort){var A=this.sortInfo,B=A.field;this.sortData(B,A.direction)}},sortData:function(C,D){D=D||"ASC";var A=this.fields.get(C).sortType;var B=function(F,E){var H=A(F.data[C]),G=A(E.data[C]);return H>G?1:(H<G?-1:0)};this.data.sort(D,B);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(D,B)}},setDefaultSort:function(B,A){A=A?A.toUpperCase():"ASC";this.sortInfo={field:B,direction:A};this.sortToggle[B]=A},sort:function(E,C){var D=this.fields.get(E);if(!D){return false}if(!C){if(this.sortInfo&&this.sortInfo.field==D.name){C=(this.sortToggle[D.name]||"ASC").toggle("ASC","DESC")}else{C=D.sortDir}}var B=(this.sortToggle)?this.sortToggle[D.name]:null;var A=(this.sortInfo)?this.sortInfo:null;this.sortToggle[D.name]=C;this.sortInfo={field:D.name,direction:C};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this)}else{if(!this.load(this.lastOptions)){if(B){this.sortToggle[D.name]=B}if(A){this.sortInfo=A}}}},each:function(B,A){this.data.each(B,A)},getModifiedRecords:function(){return this.modified},createFilterFn:function(C,B,D,A){if(Ext.isEmpty(B,false)){return false}B=this.data.createValueMatcher(B,D,A);return function(E){return B.test(E.data[C])}},sum:function(E,F,A){var C=this.data.items,B=0;F=F||0;A=(A||A===0)?A:C.length-1;for(var D=F;D<=A;D++){B+=(C[D].data[E]||0)}return B},filter:function(D,C,E,A){var B=this.createFilterFn(D,C,E,A);return B?this.filterBy(B):this.clearFilter()},filterBy:function(B,A){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(B,A||this);this.fireEvent("datachanged",this)},query:function(D,C,E,A){var B=this.createFilterFn(D,C,E,A);return B?this.queryBy(B):this.data.clone()},queryBy:function(B,A){var C=this.snapshot||this.data;return C.filterBy(B,A||this)},find:function(D,C,F,E,A){var B=this.createFilterFn(D,C,E,A);return B?this.data.findIndexBy(B,null,F):-1},findBy:function(B,A,C){return this.data.findIndexBy(B,A,C)},collect:function(G,H,B){var F=(B===true&&this.snapshot)?this.snapshot.items:this.data.items;var I,J,A=[],C={};for(var D=0,E=F.length;D<E;D++){I=F[D].data[G];J=String(I);if((H||!Ext.isEmpty(I))&&!C[J]){C[J]=true;A[A.length]=I}}return A},clearFilter:function(A){if(this.isFiltered()){this.data=this.snapshot;delete this.snapshot;if(A!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return this.snapshot&&this.snapshot!=this.data},afterEdit:function(A){if(this.modified.indexOf(A)==-1){this.modified.push(A)}this.fireEvent("update",this,A,Ext.data.Record.EDIT)},afterReject:function(A){this.modified.remove(A);this.fireEvent("update",this,A,Ext.data.Record.REJECT)},afterCommit:function(A){this.modified.remove(A);this.fireEvent("update",this,A,Ext.data.Record.COMMIT)},commitChanges:function(){var B=this.modified.slice(0);this.modified=[];for(var C=0,A=B.length;C<A;C++){B[C].commit()}},rejectChanges:function(){var B=this.modified.slice(0);this.modified=[];for(var C=0,A=B.length;C<A;C++){B[C].reject()}},onMetaChange:function(B,A,C){this.recordType=A;this.fields=A.prototype.fields;delete this.snapshot;this.sortInfo=B.sortInfo;this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(A){this.suspendEvents();var C=this.data.clone();this.data.add(A);this.applySort();var B=this.data.indexOf(A);this.data=C;this.resumeEvents();return B}});
Ext.data.SimpleStore=function(A){Ext.data.SimpleStore.superclass.constructor.call(this,Ext.apply(A,{reader:new Ext.data.ArrayReader({id:A.id},Ext.data.Record.create(A.fields))}))};Ext.extend(Ext.data.SimpleStore,Ext.data.Store,{loadData:function(E,B){if(this.expandData===true){var D=[];for(var C=0,A=E.length;C<A;C++){D[D.length]=[E[C]]}E=D}Ext.data.SimpleStore.superclass.loadData.call(this,E,B)}});
Ext.data.JsonStore=function(A){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(A,{proxy:!A.data?new Ext.data.HttpProxy({url:A.url}):undefined,reader:new Ext.data.JsonReader(A,A.fields)}))};Ext.extend(Ext.data.JsonStore,Ext.data.Store);
Ext.data.Field=function(D){if(typeof D=="string"){D={name:D}}Ext.apply(this,D);if(!this.type){this.type="auto"}var C=Ext.data.SortTypes;if(typeof this.sortType=="string"){this.sortType=C[this.sortType]}if(!this.sortType){switch(this.type){case"string":this.sortType=C.asUCString;break;case"date":this.sortType=C.asDate;break;default:this.sortType=C.none}}var E=/[\$,%]/g;if(!this.convert){var B,A=this.dateFormat;switch(this.type){case"":case"auto":case undefined:B=function(F){return F};break;case"string":B=function(F){return(F===undefined||F===null)?"":String(F)};break;case"int":B=function(F){return F!==undefined&&F!==null&&F!==""?parseInt(String(F).replace(E,""),10):""};break;case"float":B=function(F){return F!==undefined&&F!==null&&F!==""?parseFloat(String(F).replace(E,""),10):""};break;case"bool":case"boolean":B=function(F){return F===true||F==="true"||F==1};break;case"date":B=function(G){if(!G){return""}if(Ext.isDate(G)){return G}if(A){if(A=="timestamp"){return new Date(G*1000)}if(A=="time"){return new Date(parseInt(G,10))}return Date.parseDate(G,A)}var F=Date.parse(G);return F?new Date(F):null};break}this.convert=B}};Ext.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"};
Ext.data.DataReader=function(A,B){this.meta=A;this.recordType=Ext.isArray(B)?Ext.data.Record.create(B):B};Ext.data.DataReader.prototype={};
Ext.data.DataProxy=function(){this.addEvents("beforeload","load");Ext.data.DataProxy.superclass.constructor.call(this)};Ext.extend(Ext.data.DataProxy,Ext.util.Observable);
Ext.data.MemoryProxy=function(A){Ext.data.MemoryProxy.superclass.constructor.call(this);this.data=A};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{load:function(F,C,G,D,B){F=F||{};var A;try{A=C.readRecords(this.data)}catch(E){this.fireEvent("loadexception",this,B,null,E);G.call(D,null,B,false);return }G.call(D,A,B,true)},update:function(B,A){}});
Ext.data.HttpProxy=function(A){Ext.data.HttpProxy.superclass.constructor.call(this);this.conn=A;this.useAjax=!A||!A.events};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},load:function(E,B,F,C,A){if(this.fireEvent("beforeload",this,E)!==false){var D={params:E||{},request:{callback:F,scope:C,arg:A},reader:B,callback:this.loadResponse,scope:this};if(this.useAjax){Ext.applyIf(D,this.conn);if(this.activeRequest){Ext.Ajax.abort(this.activeRequest)}this.activeRequest=Ext.Ajax.request(D)}else{this.conn.request(D)}}else{F.call(C||this,null,A,false)}},loadResponse:function(E,D,B){delete this.activeRequest;if(!D){this.fireEvent("loadexception",this,E,B);E.request.callback.call(E.request.scope,null,E.request.arg,false);return }var A;try{A=E.reader.read(B)}catch(C){this.fireEvent("loadexception",this,E,B,C);E.request.callback.call(E.request.scope,null,E.request.arg,false);return }this.fireEvent("load",this,E,E.request.arg);E.request.callback.call(E.request.scope,A,E.request.arg,true)},update:function(A){},updateResponse:function(A){}});
Ext.data.ScriptTagProxy=function(A){Ext.data.ScriptTagProxy.superclass.constructor.call(this);Ext.apply(this,A);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(E,F,H,I,J){if(this.fireEvent("beforeload",this,E)!==false){var C=Ext.urlEncode(Ext.apply(E,this.extraParams));var B=this.url;B+=(B.indexOf("?")!=-1?"&":"?")+C;if(this.nocache){B+="&_dc="+(new Date().getTime())}var A=++Ext.data.ScriptTagProxy.TRANS_ID;var K={id:A,cb:"stcCallback"+A,scriptId:"stcScript"+A,params:E,arg:J,url:B,callback:H,scope:I,reader:F};var D=this;window[K.cb]=function(L){D.handleResponse(L,K)};B+=String.format("&{0}={1}",this.callbackParam,K.cb);if(this.autoAbort!==false){this.abort()}K.timeoutId=this.handleFailure.defer(this.timeout,this,[K]);var G=document.createElement("script");G.setAttribute("src",B);G.setAttribute("type","text/javascript");G.setAttribute("id",K.scriptId);this.head.appendChild(G);this.trans=K}else{H.call(I||this,null,J,false)}},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(B,A){this.head.removeChild(document.getElementById(B.scriptId));clearTimeout(B.timeoutId);if(A){window[B.cb]=undefined;try{delete window[B.cb]}catch(C){}}else{window[B.cb]=function(){window[B.cb]=undefined;try{delete window[B.cb]}catch(D){}}}},handleResponse:function(D,B){this.trans=false;this.destroyTrans(B,true);var A;try{A=B.reader.readRecords(D)}catch(C){this.fireEvent("loadexception",this,D,B.arg,C);B.callback.call(B.scope||window,null,B.arg,false);return }this.fireEvent("load",this,D,B.arg);B.callback.call(B.scope||window,A,B.arg,true)},handleFailure:function(A){this.trans=false;this.destroyTrans(A,false);this.fireEvent("loadexception",this,null,A.arg);A.callback.call(A.scope||window,null,A.arg,false)}});
Ext.data.JsonReader=function(A,B){A=A||{};Ext.data.JsonReader.superclass.constructor.call(this,A,B||A.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(response){var json=response.responseText;var o=eval("("+json+")");if(!o){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(o)},onMetaChange:function(A,C,B){},simpleAccess:function(B,A){return B[A]},getJsonAccessor:function(){var A=/[\[\.]/;return function(C){try{return(A.test(C))?new Function("obj","return obj."+C):function(D){return D[C]}}catch(B){}return Ext.emptyFn}}(),readRecords:function(K){this.jsonData=K;if(K.metaData){delete this.ef;this.meta=K.metaData;this.recordType=Ext.data.Record.create(K.metaData.fields);this.onMetaChange(this.meta,this.recordType,K)}var H=this.meta,A=this.recordType,R=A.prototype.fields,F=R.items,E=R.length;if(!this.ef){if(H.totalProperty){this.getTotal=this.getJsonAccessor(H.totalProperty)}if(H.successProperty){this.getSuccess=this.getJsonAccessor(H.successProperty)}this.getRoot=H.root?this.getJsonAccessor(H.root):function(U){return U};if(H.id){var Q=this.getJsonAccessor(H.id);this.getId=function(V){var U=Q(V);return(U===undefined||U==="")?null:U}}else{this.getId=function(){return null}}this.ef=[];for(var O=0;O<E;O++){R=F[O];var T=(R.mapping!==undefined&&R.mapping!==null)?R.mapping:R.name;this.ef[O]=this.getJsonAccessor(T)}}var M=this.getRoot(K),S=M.length,I=S,D=true;if(H.totalProperty){var G=parseInt(this.getTotal(K),10);if(!isNaN(G)){I=G}}if(H.successProperty){var G=this.getSuccess(K);if(G===false||G==="false"){D=false}}var P=[];for(var O=0;O<S;O++){var L=M[O];var B={};var J=this.getId(L);for(var N=0;N<E;N++){R=F[N];var G=this.ef[N](L);B[R.name]=R.convert((G!==undefined)?G:R.defaultValue,L)}var C=new A(B,J);C.json=L;P[O]=C}return{success:D,records:P,totalRecords:I}}});
Ext.data.XmlReader=function(A,B){A=A||{};Ext.data.XmlReader.superclass.constructor.call(this,A,B||A.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(A){var B=A.responseXML;if(!B){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(B)},readRecords:function(T){this.xmlData=T;var N=T.documentElement||T;var I=Ext.DomQuery;var B=this.recordType,L=B.prototype.fields;var D=this.meta.id;var G=0,E=true;if(this.meta.totalRecords){G=I.selectNumber(this.meta.totalRecords,N,0)}if(this.meta.success){var K=I.selectValue(this.meta.success,N,true);E=K!==false&&K!=="false"}var Q=[];var U=I.select(this.meta.record,N);for(var P=0,R=U.length;P<R;P++){var M=U[P];var A={};var J=D?I.selectValue(D,M):undefined;for(var O=0,H=L.length;O<H;O++){var S=L.items[O];var F=I.selectValue(S.mapping||S.name,M,S.defaultValue);F=S.convert(F,M);A[S.name]=F}var C=new B(A,J);C.node=M;Q[Q.length]=C}return{success:E,records:Q,totalRecords:G||Q.length}}});
Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(C){var B=this.meta?this.meta.id:null;var G=this.recordType,K=G.prototype.fields;var E=[];var M=C;for(var I=0;I<M.length;I++){var D=M[I];var O={};var A=((B||B===0)&&D[B]!==undefined&&D[B]!==""?D[B]:null);for(var H=0,P=K.length;H<P;H++){var L=K.items[H];var F=L.mapping!==undefined&&L.mapping!==null?L.mapping:H;var N=D[F]!==undefined?D[F]:L.defaultValue;N=L.convert(N,D);O[L.name]=N}var J=new G(O,A);J.json=D;E[E.length]=J}return{records:E,totalRecords:E.length}}});
Ext.ComponentMgr=function(){var B=new Ext.util.MixedCollection();var A={};return{register:function(C){B.add(C)},unregister:function(C){B.remove(C)},get:function(C){return B.get(C)},onAvailable:function(E,D,C){B.on("add",function(F,G){if(G.id==E){D.call(C||G,G);B.un("add",D,C)}})},all:B,registerType:function(D,C){A[D]=C;C.xtype=D},create:function(C,D){return new A[C.xtype||D](C)}}}();Ext.reg=Ext.ComponentMgr.registerType;
Ext.state.Provider=function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)};Ext.extend(Ext.state.Provider,Ext.util.Observable,{get:function(B,A){return typeof this.state[B]=="undefined"?A:this.state[B]},clear:function(A){delete this.state[A];this.fireEvent("statechange",this,A,null)},set:function(A,B){this.state[A]=B;this.fireEvent("statechange",this,A,B)},decodeValue:function(A){var J=/^(a|n|d|b|s|o)\:(.*)$/;var C=J.exec(unescape(A));if(!C||!C[1]){return }var F=C[1];var H=C[2];switch(F){case"n":return parseFloat(H);case"d":return new Date(Date.parse(H));case"b":return(H=="1");case"a":var G=[];var I=H.split("^");for(var B=0,D=I.length;B<D;B++){G.push(this.decodeValue(I[B]))}return G;case"o":var G={};var I=H.split("^");for(var B=0,D=I.length;B<D;B++){var E=I[B].split("=");G[E[0]]=this.decodeValue(E[1])}return G;default:return H}},encodeValue:function(C){var B;if(typeof C=="number"){B="n:"+C}else{if(typeof C=="boolean"){B="b:"+(C?"1":"0")}else{if(Ext.isDate(C)){B="d:"+C.toGMTString()}else{if(Ext.isArray(C)){var F="";for(var E=0,A=C.length;E<A;E++){F+=this.encodeValue(C[E]);if(E!=A-1){F+="^"}}B="a:"+F}else{if(typeof C=="object"){var F="";for(var D in C){if(typeof C[D]!="function"&&C[D]!==undefined){F+=D+"="+this.encodeValue(C[D])+"^"}}B="o:"+F.substring(0,F.length-1)}else{B="s:"+C}}}}}return escape(B)}});
Ext.state.Manager=function(){var A=new Ext.state.Provider();return{setProvider:function(B){A=B},get:function(C,B){return A.get(C,B)},set:function(B,C){A.set(B,C)},clear:function(B){A.clear(B)},getProvider:function(){return A}}}();
Ext.state.CookieProvider = function(A) { Ext.state.CookieProvider.superclass.constructor.call(this); this.path = "/"; this.expires = new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 7)); this.domain = null; this.secure = false; Ext.apply(this, A); this.state = this.readCookies() }; Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, { set: function(A, B) { if (typeof B == "undefined" || B === null) { this.clear(A); return } this.setCookie(A, B); Ext.state.CookieProvider.superclass.set.call(this, A, B) }, clear: function(A) { this.clearCookie(A); Ext.state.CookieProvider.superclass.clear.call(this, A) }, readCookies: function() { var C = {}; var F = document.cookie + ";"; var B = /\s?(.*?)=(.*?);/g; var E; while ((E = B.exec(F)) != null) { var A = E[1]; var D = E[2]; if (A && A.substring(0, 3) == "ys-") { C[A.substr(3)] = this.decodeValue(D) } } return C }, setCookie: function(A, B) { document.cookie = "ys-" + A + "=" + this.encodeValue(B) + ((this.expires == null) ? "" : ("; expires=" + this.expires.toGMTString())) + ((this.path == null) ? "" : ("; path=" + this.path)) + ((this.domain == null) ? "" : ("; domain=" + this.domain)) + ((this.secure == true) ? "; secure" : "") }, clearCookie: function(A) { document.cookie = "ys-" + A + "=null; expires=Thu, 01-Jan-70 00:00:01 GMT" + ((this.path == null) ? "" : ("; path=" + this.path)) + ((this.domain == null) ? "" : ("; domain=" + this.domain)) + ((this.secure == true) ? "; secure" : "") } });
Ext.form.VTypes = function() { var C = /^[a-zA-Z_]+$/; var D = /^[a-zA-Z0-9_]+$/; var B = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/; var A = /(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; return { "email": function(E) { return B.test(E) }, "emailText": "This field should be an e-mail address in the format \"user@domain.com\"", "emailMask": /[a-z0-9_\.\-@]/i, "url": function(E) { return A.test(E) }, "urlText": "This field should be a URL in the format \"http:/" + "/www.domain.com\"", "alpha": function(E) { return C.test(E) }, "alphaText": "This field should only contain letters and _", "alphaMask": /[a-z_]/i, "alphanum": function(E) { return D.test(E) }, "alphanumText": "This field should only contain letters, numbers and _", "alphanumMask": /[a-z0-9_]/i} } ();
dynJsExt = 'Loaded';function currencyPairGuidedTourScript(){var c=new GuidedTourStep("step1",670,285,"left");var b=new GuidedTourStep("step2",345,585,"left");var a=new GuidedTourStep("step3",420,895,"right");var d=new GuidedTour([c,b,a])}function initDropdowns(){window.addEvent("domready",mainDropNav.init)}function StartGuidedTour(){}function dashboardCarouselScript(){var a=new Carousel("dashboard_interstitial_carousel")}function newToForex(){var a=new ContentToggle("new_to_forex_toggle")}function homepageCarousel(){var a=new Carousel("homepage_carousel")}function alertBox(){$("alert_box_close").addEvent("click",function(){$("alert_box_container").setStyle("display","none")})}function mediaPlayerScript(){var a={};a.w="303";a.h="227";a.fn="flv/cnbc-08-06-04-hi.flv";var c={};var b={};swfobject.embedSWF("/resources/swf/MediaPlayer.swf","video_player","303","227","9.0.0","/resources/swf/expressInstall.swf",a,c,b)}function formatInteger(a){var b=new RegExp("(\\d{1,3})(?=(?:\\d{3})+(\\.|$))","g");return a.toString().replace(b,"$1,")}function displayPhoneNumber(){var a=$("country");var b=a.options[a.selectedIndex].value;$("phone_number_display").set("html",b)}function showCallbackRequest(){popLayer.popLayerFade="ZoomFadeCallback";popLayer.popLayerContent="ZoomShadowCallback";popLayer.shim="ZoomShimCallback";popLayer.shimYOffset=30;popLayer.shimXOffset=23;popLayer.show()}function showCallbackConfirmation(){if(popLayer!=null){popLayer.hide()}popLayer.popLayerFade="ZoomFadeCallbackConfirmation";popLayer.popLayerContent="ZoomShadowCallbackConfirmation";popLayer.shim="ZoomShimCallbackConfirmation";popLayer.shimYOffset=30;popLayer.shimXOffset=23;popLayer.show()}function showNewsletter(){popLayer.popLayerFade="ZoomFadeNewsletter";popLayer.popLayerContent="ZoomShadowNewsletter";popLayer.shim="ZoomShimNewsletter";popLayer.shimYOffset=30;popLayer.shimXOffset=23;var d=document.getElementById("txtEmailField");var g=document.getElementById("txtConfirmEmailField");var a=document.getElementById(d.value);var e=document.getElementById(g.value);var b=document.getElementById("email");var c=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;if(c.test(b.value)){a.value=b.value}popLayer.show()}function showReferAFriend(){resetReferFriendForm();popLayer.popLayerFade="ZoomFadeReferAFriend";popLayer.popLayerContent="ZoomShadowReferAFriend";popLayer.shim="ZoomShimReferAFriend";popLayer.shimYOffset=30;popLayer.shimXOffset=23;popLayer.show()}function resetReferFriendForm(){Ext.get("refer_pop").dom.style.display="block";Ext.get("divError").dom.style.display="none";Ext.get("div_Refer_Friend_Confirm").dom.style.display="none"}function showISInfoForm(){popLayer.popLayerFade="ZoomFadeISInfoForm";popLayer.popLayerContent="ZoomShadowISInfoForm";popLayer.shim="ZoomShimISInfoForm";popLayer.shimYOffset=30;popLayer.shimXOffset=23;popLayer.show()}function showOnlineSecurity(){popLayer.popLayerFade="ZoomFadeOnlineSecurity";popLayer.popLayerContent="ZoomShadowOnlineSecurity";popLayer.shim="ZoomShimOnlineSecurity";popLayer.shimYOffset=30;popLayer.shimXOffset=23;popLayer.show()}function showToolsPopup(){popLayer.popLayerFade="ZoomFadeToolsPopup";popLayer.popLayerContent="ZoomShadowToolsPopup";popLayer.shim="ZoomShimToolsPopup";popLayer.shimYOffset=30;popLayer.shimXOffset=23;popLayer.show()}function openWin(){window.open("https://secure.efxnow.com/NewOLS_FRXC_EN/agreement.aspx","popWin","status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0,width=568, height=500")}function setModelPopUpCenter(g){var d=function(){if(self.pageYOffset){return self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollLeft}else{if(document.body){return document.body.scrollLeft}}}};var c=function(){if(self.pageYOffset){return self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}else{if(document.body){return document.body.scrollTop}}}};var e=function(){if(self.innerHeight){return self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}else{if(document.body){return document.body.clientHeight}}}};var b=function(){if(self.innerHeight){return self.innerWidth}else{if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientWidth}else{if(document.body){return document.body.clientWidth}}}};var a=Math.round(b()/2)-Math.round(g.getWidth()/2);var h=c()+Math.round(e()/2)-Math.round(g.getHeight()/2);g.setLeftTop(a,h)}function hideLoginLink(){if($("homepage_feature")!= null){$("homepage_feature").getElements(".login_message").setStyle("display","none")}}function VideoControl(b,a){window.addEvent("domready",function(){changeVideo(b,a);$$("#video_list_toggle .toggle_content_item").setStyles({display:"block",visibility:"hidden"});var k=$("video_scrollbar_1");var c=$("video_scroll_grip_1");var g=$("video_listing_1");var m=g.getSize().y;m=m-232;var d=new Slider(k,c,{steps:m,range:[0],mode:"vertical",wheel:true,onChange:function(p){g.setStyle("margin-top",(p*-1))}}).set(0);var h=$("video_scrollbar_2");var o=$("video_scroll_grip_2");var e=$("video_listing_2");var l=e.getSize().y;l=l-232;var n=new Slider(h,o,{steps:l,range:[0],mode:"vertical",wheel:true,onChange:function(p){e.setStyle("margin-top",(p*-1))}}).set(0);$$("#video_list_toggle .toggle_content_item").setStyles({display:"none",visibility:""});VideoListToggle=new ContentToggle("video_list_toggle","beginner")})}function numbersFilter(b,c){var a=(b.which)?b.which:event.keyCode;b=(b.target)?b.target:b.srcElement;if(c&&b.maxLength==b.value.length){if(a==8||(a>47&&a<58)){c.focus()}return false}if(a==8||(a>47&&a<58)){return true}return false};var MooTools={version:"1.2.0",build:""};var Native=function(e){e=e||{};var l=e.afterImplement||function(){};var k=e.generics;k=(k!==false);var h=e.legacy;var m=e.initialize;var c=e.protect;var d=e.name;var b=m||h;b.constructor=Native;b.$family={name:"native"};if(h&&m){b.prototype=h.prototype}b.prototype.constructor=b;if(d){var a=d.toLowerCase();b.prototype.$family={name:a};Native.typize(b,a)}var g=function(q,o,p,n){if(!c||n||!q.prototype[o]){q.prototype[o]=p}if(k){Native.genericize(q,o,c)}l.call(q,o,p);return q};b.implement=function(n,o,p){if(typeof n=="string"){return g(this,n,o,p)}for(var q in n){g(this,q,n[q],o)}return this};b.alias=function(q,o,p){if(typeof q=="string"){q=this.prototype[q];if(q){g(this,o,q,p)}}else{for(var n in q){this.alias(n,q[n],o)}}return this};return b};Native.implement=function(b,c){for(var d=0,a=b.length;d<a;d++){b[d].implement(c)}};Native.genericize=function(c,b,a){if((!a||!c[b])&&typeof c.prototype[b]=="function"){c[b]=function(){var d=Array.prototype.slice.call(arguments);return c.prototype[b].apply(d.shift(),d)}}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b)}}};Native.alias=function(c,g,a,b){for(var d=0,e=c.length;d<e;d++){c[d].alias(g,a,b)}};(function(b){for(var a in b){Native.typize(b[a],a)}})({"boolean":Boolean,"native":Native,object:Object});(function(b){for(var a in b){new Native({name:a,initialize:b[a],protect:true})}})({String:String,Function:Function,Number:Number,Array:Array,RegExp:RegExp,Date:Date});(function(c,a){for(var b=a.length;b--;b){Native.genericize(c,a[b],true)}return arguments.callee})(Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","toString","valueOf","indexOf","lastIndexOf"])(String,["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]);function $chk(a){return !!(a||a===0)}function $clear(a){clearTimeout(a);clearInterval(a);return null}function $defined(a){return(a!=undefined)}function $empty(){}function $arguments(a){return function(){return arguments[a]}}function $lambda(a){return(typeof a=="function")?a:function(){return a}}function $extend(b,a){for(var c in (a||{})){b[c]=a[c]}return b}function $unlink(d){var e;switch($type(d)){case"object":e={};for(var b in d){e[b]=$unlink(d[b])}break;case"hash":e=$unlink(d.getClean());break;case"array":e=[];for(var c=0,a=d.length;c<a;c++){e[c]=$unlink(d[c])}break;default:return d}return e}function $merge(){var d={};for(var e=0,a=arguments.length;e<a;e++){var h=arguments[e];if($type(h)!="object"){continue}for(var g in h){var b=h[g],c=d[g];d[g]=(c&&$type(b)=="object"&&$type(c)=="object")?$merge(c,b):$unlink(b)}}return d}function $pick(){for(var b=0,a=arguments.length;b<a;b++){if(arguments[b]!=undefined){return arguments[b]}}return null}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b)}function $splat(b){var a=$type(b);return(a)?((a!="array"&&a!="arguments")?[b]:b):[]}var $time=Date.now||function(){return new Date().getTime()};function $try(){for(var c=0,a=arguments.length;c<a;c++){try{return arguments[c]()}catch(b){}}return null}function $type(a){if(a==undefined){return false}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace"}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"}else{if(a.item){return"collection"}}}}return typeof a}var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean())}for(var b in a){this[b]=a[b]}return this}});Hash.implement({getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++}}return b},forEach:function(c,b){for(var a in this){if(this.hasOwnProperty(a)){c.call(b,this[a],a,this)}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a]}}return b}});Hash.alias("forEach","each");function $H(a){return new Hash(a)}Array.implement({forEach:function(c,b){for(var d=0,a=this.length;d<a;d++){c.call(b,this[d],d,this)}}});Array.alias("forEach","each");function $A(c){if(c.item){var b=[];for(var d=0,a=c.length;d<a;d++){b[d]=c[d]}return b}return Array.prototype.slice.call(c)}function $each(c,d,b){var a=$type(c);((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,d,b)}var Browser=new Hash({Engine:{name:"unknown",version:""},Platform:{name:(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime)},Plugins:{}});if(window.opera){Browser.Engine={name:"presto",version:(document.getElementsByClassName)?950:925}}else{if(window.ActiveXObject){Browser.Engine={name:"trident",version:(window.XMLHttpRequest)?5:4}}else{if(!navigator.taintEnabled){Browser.Engine={name:"webkit",version:(Browser.Features.xpath)?420:419}}else{if(document.getBoxObjectFor!=null){Browser.Engine={name:"gecko",version:(document.getElementsByClassName)?19:18}}}}}Browser.Engine[Browser.Engine.name]=Browser.Engine[Browser.Engine.name+Browser.Engine.version]=true;if(window.orientation!=undefined){Browser.Platform.name="ipod"}Browser.Platform[Browser.Platform.name]=true;Browser.Request=function(){return $try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("MSXML2.XMLHTTP")})};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1]||0),build:parseInt(a[2]||0)}})();function $exec(b){if(!b){return b}if(window.execScript){window.execScript(b)}else{var a=document.createElement("script");a.setAttribute("type","text/javascript");a.text=b;document.head.appendChild(a);document.head.removeChild(a)}return b}Native.UID=1;var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0]}:function(a){return a.uid||(a.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a);if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe")}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}return $extend(a,Window.Prototype)},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0];a.html=a.getElementsByTagName("html")[0];a.window=a.defaultView||a.parentWindow;if(Browser.Engine.trident4){$try(function(){a.execCommand("BackgroundImageCache",false,true)})}return $extend(a,Document.Prototype)},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(c,b){for(var d=0,a=this.length;d<a;d++){if(!c.call(b,this[d],d,this)){return false}}return true},filter:function(c,b){var d=[];for(var e=0,a=this.length;e<a;e++){if(c.call(b,this[e],e,this)){d.push(this[e])}}return d},clean:function(){return this.filter($defined)},indexOf:function(c,b){var a=this.length;for(var d=(b<0)?Math.max(0,a+b):b||0;d<a;d++){if(this[d]===c){return d}}return -1},map:function(c,b){var d=[];for(var e=0,a=this.length;e<a;e++){d[e]=c.call(b,this[e],e,this)}return d},some:function(c,b){for(var d=0,a=this.length;d<a;d++){if(c.call(b,this[d],d,this)){return true}}return false},associate:function(c){var b={},d=Math.min(this.length,c.length);for(var a=0;a<d;a++){b[c[a]]=this[a]}return b},link:function(d){var a={};for(var b=0,e=this.length;b<e;b++){for(var c in d){if(d[c](this[b])){a[c]=this[b];delete d[c];break}}}return a},contains:function(a,b){return this.indexOf(a,b)!=-1},extend:function(b){for(var c=0,a=b.length;c<a;c++){this.push(b[c])}return this},getLast:function(){return(this.length)?this[this.length-1]:null},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null},include:function(a){if(!this.contains(a)){this.push(a)}return this},combine:function(b){for(var c=0,a=b.length;c<a;c++){this.include(b[c])}return this},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var b=[];for(var d=0,a=this.length;d<a;d++){var c=$type(this[d]);if(!c){continue}b=b.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[d]):this[d])}return b},hexToRgb:function(b){if(this.length!=3){return null}var a=this.map(function(c){if(c.length==1){c+=c}return c.toInt(16)});return(b)?a:"rgb("+a+")"},rgbToHex:function(b){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!b){return"transparent"}var d=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16);d.push((c.length==1)?"0"+c:c)}return(b)?d:"#"+d.join("")}});Function.implement({extend:function(a){for(var b in a){this[b]=a[b]}return this},create:function(b){var a=this;b=b||{};return function(d){var e=b.arguments;e=(e!=undefined)?$splat(e):Array.slice(arguments,(b.event)?1:0);if(b.event){e=[d||window.event].extend(e)}var c=function(){return a.apply(b.bind||null,e)};if(b.delay){return setTimeout(c,b.delay)}if(b.periodical){return setInterval(c,b.periodical)}if(b.attempt){return $try(c)}return c()}},pass:function(a,b){return this.create({arguments:a,bind:b})},attempt:function(a,b){return this.create({arguments:a,bind:b,attempt:true})()},bind:function(b,a){return this.create({bind:b,arguments:a})},bindWithEvent:function(b,a){return this.create({bind:b,event:true,arguments:a})},delay:function(c,b,a){return this.create({delay:c,bind:b,arguments:a})()},periodical:function(a,b,c){return this.create({periodical:a,bind:b,arguments:c})()},run:function(a,b){return this.apply(b,$splat(a))}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this))},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a},times:function(c,b){for(var a=0;a<this;a++){c.call(b,a,this)}},toFloat:function(){return parseFloat(this)},toInt:function(a){return parseInt(this,a||10)}});Number.alias("times","each");(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)))}}});Number.implement(a)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this)},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(a){return parseInt(this,a||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null},stripScripts:function(c){var a="";var b=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return""});if(c===true){$exec(a)}else{if($type(c)=="function"){c(a,b)}}return b},substitute:function(a,b){return this.replace(b||(/\\?\{([^}]+)\}/g),function(c,d){if(c.charAt(0)=="\\"){return c.slice(1)}return(a[d]!=undefined)?a[d]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a}}return null},hasValue:function(a){return(Hash.keyOf(this,a)!==null)},extend:function(a){Hash.each(a,function(b,c){Hash.set(this,c,b)},this);return this},combine:function(a){Hash.each(a,function(b,c){Hash.include(this,c,b)},this);return this},erase:function(a){if(this.hasOwnProperty(a)){delete this[a]}return this},get:function(a){return(this.hasOwnProperty(a))?this[a]:null},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b}return this},empty:function(){Hash.each(this,function(b,a){delete this[a]},this);return this},include:function(c,b){var a=this[c];if(a==undefined){this[c]=b}return this},map:function(c,b){var a=new Hash;Hash.each(this,function(d,e){a.set(e,c.call(b,d,e,this))},this);return a},filter:function(c,b){var a=new Hash;Hash.each(this,function(d,e){if(c.call(b,d,e,this)){a.set(e,d)}},this);return a},every:function(c,b){for(var a in this){if(this.hasOwnProperty(a)&&!c.call(b,this[a],a)){return false}}return true},some:function(c,b){for(var a in this){if(this.hasOwnProperty(a)&&c.call(b,this[a],a)){return true}}return false},getKeys:function(){var a=[];Hash.each(this,function(b,c){a.push(c)});return a},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b)});return a},toQueryString:function(a){var b=[];Hash.each(this,function(c,d){if(a){d=a+"["+d+"]"}var e;switch($type(c)){case"object":e=Hash.toQueryString(c,d);break;case"array":var g={};c.each(function(h,k){g[k]=h});e=Hash.toQueryString(g,d);break;default:e=d+"="+encodeURIComponent(c)}if(c!=undefined){b.push(e)}});return b.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(d,o){o=o||window;var h=o.document;d=d||o.event;if(d.$extended){return d}this.$extended=true;var k=d.type;var n=d.target||d.srcElement;while(n&&n.nodeType==3){n=n.parentNode}if(k.test(/key/)){var c=d.which||d.keyCode;var e=Event.Keys.keyOf(c);if(k=="keydown"){var a=c-111;if(a>0&&a<13){e="f"+a}}e=e||String.fromCharCode(c).toLowerCase()}else{if(k.match(/(click|mouse|menu)/i)){h=(!h.compatMode||h.compatMode=="CSS1Compat")?h.html:h.body;var l={x:d.pageX||d.clientX+h.scrollLeft,y:d.pageY||d.clientY+h.scrollTop};var b={x:(d.pageX)?d.pageX-o.pageXOffset:d.clientX,y:(d.pageY)?d.pageY-o.pageYOffset:d.clientY};if(k.match(/DOMMouseScroll|mousewheel/)){var m=(d.wheelDelta)?d.wheelDelta/120:-(d.detail||0)/3}var p=(d.which==3)||(d.button==2);var g=null;if(k.match(/over|out/)){switch(k){case"mouseover":g=d.relatedTarget||d.fromElement;break;case"mouseout":g=d.relatedTarget||d.toElement}if(!(function(){while(g&&g.nodeType==3){g=g.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){g=false}}}}return $extend(this,{event:d,type:k,page:l,client:b,rightClick:p,wheel:m,relatedTarget:g,target:n,code:c,key:e,shift:d.shiftKey,control:d.ctrlKey,alt:d.altKey,meta:d.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});var Class=new Native({name:"Class",initialize:function(b){b=b||{};var a=function(d){for(var e in this){this[e]=$unlink(this[e])}for(var c in Class.Mutators){if(!this[c]){continue}Class.Mutators[c](this,this[c]);delete this[c]}this.constructor=a;if(d===$empty){return this}var g=(this.initialize)?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this)}return g};$extend(a,this);a.constructor=Class;a.prototype=b;return a}});Class.implement({implement:function(){Class.Mutators.Implements(this.prototype,Array.slice(arguments));return this}});Class.Mutators={Implements:function(a,b){$splat(b).each(function(c){$extend(a,($type(c)=="class")?new c($empty):c)})},Extends:function(self,klass){var instance=new klass($empty);delete instance.parent;delete instance.parentOf;for(var key in instance){var current=self[key],previous=instance[key];if(current==undefined){self[key]=previous;continue}var ctype=$type(current),ptype=$type(previous);if(ctype!=ptype){continue}switch(ctype){case"function":if(!arguments.callee.caller){self[key]=eval("("+String(current).replace(/\bthis\.parent\(\s*(\))?/g,function(full,close){return"arguments.callee._parent_.call(this"+(close||", ")})+")")}self[key]._parent_=previous;break;case"object":self[key]=$merge(previous,current)}}self.parent=function(){return arguments.callee.caller._parent_.apply(this,arguments)};self.parentOf=function(descendant){return descendant._parent_.apply(this,Array.slice(arguments,1))}}};var Chain=new Class({chain:function(){this.$chain=(this.$chain||[]).extend(arguments);return this},callChain:function(){return(this.$chain&&this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){if(this.$chain){this.$chain.empty()}return this}});var Events=new Class({addEvent:function(b,c,a){b=Events.removeOn(b);if(c!=$empty){this.$events=this.$events||{};this.$events[b]=this.$events[b]||[];this.$events[b].include(c);if(a){c.internal=true}}return this},addEvents:function(a){for(var b in a){this.addEvent(b,a[b])}return this},fireEvent:function(b,c,a){b=Events.removeOn(b);if(!this.$events||!this.$events[b]){return this}this.$events[b].each(function(d){d.create({bind:this,delay:a,"arguments":c})()},this);return this},removeEvent:function(b,a){b=Events.removeOn(b);if(!this.$events||!this.$events[b]){return this}if(!a.internal){this.$events[b].erase(a)}return this},removeEvents:function(c){for(var b in this.$events){if(c&&c!=b){continue}var d=this.$events[b];for(var a=d.length;a--;a){this.removeEvent(b,d[a])}}return this}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(c,b){return b.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue}this.addEvent(a,this.options[a]);delete this.options[a]}return this}});Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return}a+=" "+c+'="'+b[c]+'"';if(c!="checked"){delete b[c]}});a="<"+a+">"}return $.element(this.createElement(a)).set(b)},newTextNode:function(a){return this.createTextNode(a)},getDocument:function(){return this},getWindow:function(){return this.defaultView||this.parentWindow},purge:function(){var b=this.getElementsByTagName("*");for(var c=0,a=b.length;c<a;c++){Browser.freeMem(b[c])}}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,c){var b=Element.Constructors.get(a);if(b){return b(c)}if(typeof a=="string"){return document.newElement(a,c)}return $(a).set(c)},afterImplement:function(a,b){if(!Array[a]){Elements.implement(a,Elements.multi(a))}Element.Prototype[a]=b}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var b=Array.link(arguments,{properties:Object.type,iframe:$defined});var d=b.properties||{};var e=$(b.iframe)||false;var c=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,e.id,e.name,"IFrame_"+$time());e=new Element(e||"iframe",d);var a=function(){var k=$try(function(){return e.contentWindow.location.host});if(k&&k==window.location.host){var g=new Window(e.contentWindow);var h=new Document(e.contentWindow.document);$extend(g.Element.prototype,Element.Prototype)}c.call(e.contentWindow,e.contentWindow.document)};(!window.frames[d.id])?e.addListener("load",a):a();return e}});var Elements=new Native({initialize:function(c,h){h=$extend({ddup:true,cash:true},h);c=c||[];if(h.ddup||h.cash){var b={},d=[];for(var g=0,a=c.length;g<a;g++){var e=$.element(c[g],!h.cash);if(h.ddup){if(b[e.uid]){continue}b[e.uid]=true}d.push(e)}c=d}return(h.cash)?$extend(c,this):c}});Elements.implement({filter:function(a,b){if(!a){return this}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a)}:a,b))}});Elements.multi=function(a){return function(){var g=[];var b=true;for(var d=0,e=this.length;d<e;d++){var c=this[d][a].apply(this[d],arguments);g.push(c);if(b){b=($type(c)=="element")}}return(b)?new Elements(g):g}};Window.implement({$:function(c,b){if(c&&c.$family&&c.uid){return c}var a=$type(c);return($[a])?$[a](c,b,this.document):null},$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a)}var b=[];var e=Array.flatten(arguments);for(var d=0,g=e.length;d<g;d++){var c=e[d];switch($type(c)){case"element":c=[c];break;case"string":c=this.document.getElements(c,true);break;default:c=false}if(c){b.extend(c)}}return new Elements(b)},getDocument:function(){return this.document},getWindow:function(){return this}});$.string=function(b,c,a){b=a.getElementById(b);return(b)?$.element(b,c):null};$.element=function(a,b){$uid(a);if(!b&&!a.$family&&!(/^object|embed$/i).test(a.tagName)){var d=Element.Prototype;for(var c in d){a[c]=d[c]}}return a};$.object=function(c,b,a){if(c.toElement){return $.element(c.toElement(a),b)}return null};$.textnode=$.whitespace=$.window=$.document=$arguments(0);Native.implement([Element,Document],{getElement:function(a,b){return $(this.getElements(a,true)[0]||null,b)},getElements:function(a,b){a=a.split(",");var c=[];var d=(a.length>1);a.each(function(g){var e=this.getElementsByTagName(g.trim());(d)?c.extend(e):c=e},this);return new Elements(c,{ddup:d,cash:!b})}});Element.Storage={get:function(a){return(this[a]||(this[a]={}))}};Element.Inserters=new Hash({before:function(b,a){if(a.parentNode){a.parentNode.insertBefore(b,a)}},after:function(c,a){if(!a.parentNode){return}var b=a.nextSibling;(b)?a.parentNode.insertBefore(c,b):a.parentNode.appendChild(c)},bottom:function(b,a){a.appendChild(b)},top:function(c,a){var b=a.firstChild;(b)?a.insertBefore(c,b):a.appendChild(c)}});Element.Inserters.inside=Element.Inserters.bottom;Element.Inserters.each(function(b,c){var a=c.capitalize();Element.implement("inject"+a,function(d){b(this,$(d,true));return this});Element.implement("grab"+a,function(d){b($(d,true),this);return this})});Element.implement({getDocument:function(){return this.ownerDocument},getWindow:function(){return this.ownerDocument.getWindow()},getElementById:function(b,c){var d=this.ownerDocument.getElementById(b);if(!d){return null}for(var a=d.parentNode;a!=this;a=a.parentNode){if(!a){return null}}return $.element(d,c)},set:function(b,d){switch($type(b)){case"object":for(var c in b){this.set(c,b[c])}break;case"string":var a=Element.Properties.get(b);(a&&a.set)?a.set.apply(this,Array.slice(arguments,1)):this.setProperty(b,d)}return this},get:function(b){var a=Element.Properties.get(b);return(a&&a.get)?a.get.apply(this,Array.slice(arguments,1)):this.getProperty(b)},erase:function(b){var a=Element.Properties.get(b);(a&&a.erase)?a.erase.apply(this,Array.slice(arguments,1)):this.removeProperty(b);return this},match:function(a){return(!a||Element.get(this,"tag")==a)},inject:function(b,a){Element.Inserters.get(a||"bottom")(this,$(b,true));return this},wraps:function(b,a){b=$(b,true);return this.replaces(b).grab(b,a)},grab:function(b,a){Element.Inserters.get(a||"bottom")($(b,true),this);return this},appendText:function(b,a){return this.grab(this.getDocument().newTextNode(b),a)},adopt:function(){Array.flatten(arguments).each(function(a){a=$(a,true);if(a){this.appendChild(a)}},this);return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},clone:function(a,b){switch($type(this)){case"element":var l={};for(var m=0,o=this.attributes.length;m<o;m++){var c=this.attributes[m],e=c.nodeName.toLowerCase();if(Browser.Engine.trident&&(/input/i).test(this.tagName)&&(/width|height/).test(e)){continue}var g=(e=="style"&&this.style)?this.style.cssText:c.nodeValue;if(!$chk(g)||e=="uid"||(e=="id"&&!b)){continue}if(g!="inherit"&&["string","number"].contains($type(g))){l[e]=g}}var h=new Element(this.nodeName.toLowerCase(),l);if(a!==false){for(var k=0,n=this.childNodes.length;k<n;k++){var d=Element.clone(this.childNodes[k],true,b);if(d){h.grab(d)}}}return h;case"textnode":return document.newTextNode(this.nodeValue)}return null},replaces:function(a){a=$(a,true);a.parentNode.replaceChild(this,a);return this},hasClass:function(a){return this.className.contains(a," ")},addClass:function(a){if(!this.hasClass(a)){this.className=(this.className+" "+a).clean()}return this},removeClass:function(a){this.className=this.className.replace(new RegExp("(^|\\s)"+a+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(a){return this.hasClass(a)?this.removeClass(a):this.addClass(a)},getComputedStyle:function(b){if(this.currentStyle){return this.currentStyle[b.camelCase()]}var a=this.getWindow().getComputedStyle(this,null);return(a)?a.getPropertyValue([b.hyphenate()]):null},empty:function(){$A(this.childNodes).each(function(a){Browser.freeMem(a);Element.empty(a);Element.dispose(a)},this);return this},destroy:function(){Browser.freeMem(this.empty().dispose());return null},getSelected:function(){return new Elements($A(this.options).filter(function(a){return a.selected}))},toQueryString:function(){var a=[];this.getElements("input, select, textarea").each(function(c){if(!c.name||c.disabled){return}var b=(c.tagName.toLowerCase()=="select")?Element.getSelected(c).map(function(d){return d.value}):((c.type=="radio"||c.type=="checkbox")&&!c.checked)?null:c.value;$splat(b).each(function(d){if(d){a.push(c.name+"="+encodeURIComponent(d))}})});return a.join("&")},getProperty:function(c){var d=Element.Attributes,a=d.Props[c];var b=(a)?this[a]:this.getAttribute(c,2);return(d.Bools[c])?!!b:(a)?b:b||null},getProperties:function(){var a=$A(arguments);return a.map(function(b){return this.getProperty(b)},this).associate(a)},setProperty:function(c,b){var d=Element.Attributes,e=d.Props[c],a=$defined(b);if(e&&d.Bools[c]){b=(b||!a)?true:false}else{if(!a){return this.removeProperty(c)}}(e)?this[e]=b:this.setAttribute(c,b);return this},setProperties:function(a){for(var b in a){this.setProperty(b,a[b])}return this},removeProperty:function(b){var c=Element.Attributes,d=c.Props[b],a=(d&&c.Bools[b]);(d)?this[d]=(a)?false:"":this.removeAttribute(b);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this}});(function(){var a=function(h,l,b,k,e,c){var g=h[b||l];var d=[];while(g){if(g.nodeType==1&&(!k||Element.match(g,k))){d.push(g);if(!e){break}}g=g[l]}return(e)?new Elements(d,{ddup:false,cash:!c}):$(d[0],c)};Element.implement({getPrevious:function(c,b){return a(this,"previousSibling",null,c,false,b)},getAllPrevious:function(c,b){return a(this,"previousSibling",null,c,true,b)},getNext:function(c,b){return a(this,"nextSibling",null,c,false,b)},getAllNext:function(c,b){return a(this,"nextSibling",null,c,true,b)},getFirst:function(c,b){return a(this,"nextSibling","firstChild",c,false,b)},getLast:function(c,b){return a(this,"previousSibling","lastChild",c,false,b)},getParent:function(c,b){return a(this,"parentNode",null,c,false,b)},getParents:function(c,b){return a(this,"parentNode",null,c,true,b)},getChildren:function(c,b){return a(this,"nextSibling","firstChild",c,true,b)},hasChild:function(b){b=$(b,true);return(!!b&&$A(this.getElementsByTagName(b.tagName)).contains(b))}})})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.href={get:function(){return(!this.href)?null:this.href.replace(new RegExp("^"+document.location.protocol+"//"+document.location.host),"")}};Element.Properties.html={set:function(){return this.innerHTML=Array.flatten(arguments).join("")}};Native.implement([Element,Window,Document],{addListener:function(b,a){if(this.addEventListener){this.addEventListener(b,a,false)}else{this.attachEvent("on"+b,a)}return this},removeListener:function(b,a){if(this.removeEventListener){this.removeEventListener(b,a,false)}else{this.detachEvent("on"+b,a)}return this},retrieve:function(d,a){var b=Element.Storage.get(this.uid);var c=b[d];if($defined(a)&&!$defined(c)){c=b[d]=a}return $pick(c)},store:function(c,a){var b=Element.Storage.get(this.uid);b[c]=a;return this},eliminate:function(a){var b=Element.Storage.get(this.uid);delete b[a];return this}});Element.Attributes=new Hash({Props:{html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident)?"innerText":"textContent"},Bools:["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"],Camels:["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]});Browser.freeMem=function(a){if(!a){return}if(Browser.Engine.trident&&(/object/i).test(a.tagName)){for(var b in a){if(typeof a[b]=="function"){a[b]=$empty}}Element.dispose(a)}if(a.uid&&a.removeEvents){a.removeEvents()}};(function(c){var b=c.Bools,a=c.Camels;c.Bools=b=b.associate(b);Hash.extend(Hash.combine(c.Props,b),a.associate(a.map(function(d){return d.toLowerCase()})));c.erase("Camels")})(Element.Attributes);window.addListener("unload",function(){window.removeListener("unload",arguments.callee);document.purge();if(Browser.Engine.trident){CollectGarbage()}});Element.Properties.events={set:function(a){this.addEvents(a)}};Native.implement([Element,Window,Document],{addEvent:function(l,h){var g=this.retrieve("events",{});g[l]=g[l]||{keys:[],values:[]};if(g[l].keys.contains(h)){return this}g[l].keys.push(h);var k=l,d=Element.Events.get(l),b=h,e=this;if(d){if(d.onAdd){d.onAdd.call(this,h)}if(d.condition){b=function(m){if(d.condition.call(this,m)){return h.call(this,m)}return false}}k=d.base||k}var a=function(){return h.call(e)};var c=Element.NativeEvents[k]||0;if(c){if(c==2){a=function(m){m=new Event(m,e.getWindow());if(b.call(e,m)===false){m.stop()}}}this.addListener(k,a)}g[l].values.push(a);return this},removeEvent:function(e,g){var h=this.retrieve("events");if(!h||!h[e]){return this}var b=h[e].keys.indexOf(g);if(b==-1){return this}var a=h[e].keys.splice(b,1)[0];var c=h[e].values.splice(b,1)[0];var d=Element.Events.get(e);if(d){if(d.onRemove){d.onRemove.call(this,g)}e=d.base||e}return(Element.NativeEvents[e])?this.removeListener(e,c):this},addEvents:function(a){for(var b in a){this.addEvent(b,a[b])}return this},removeEvents:function(c){var a=this.retrieve("events");if(!a){return this}if(!c){for(var b in a){this.removeEvents(b)}a=null}else{if(a[c]){while(a[c].keys[0]){this.removeEvent(c,a[c].keys[0])}a[c]=null}}return this},fireEvent:function(b,d,a){var c=this.retrieve("events");if(!c||!c[b]){return this}c[b].keys.each(function(e){e.create({bind:this,delay:a,"arguments":d})()},this);return this},cloneEvents:function(b,a){b=$(b);var c=b.retrieve("events");if(!c){return this}if(!a){for(var d in c){this.cloneEvents(b,d)}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var a=function(c){var b=c.relatedTarget;if(b==undefined){return true}if(b===false){return false}return($type(this)!="document"&&b!=this&&b.prefix!="xul"&&!this.hasChild(b))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(a){this.setStyles(a)}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"}this.style.opacity=a;this.store("opacity",a)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(c,a){switch(c){case"opacity":return this.set("opacity",parseFloat(a));case"float":c=(Browser.Engine.trident)?"styleFloat":"cssFloat"}c=c.camelCase();if($type(a)!="string"){var b=(Element.Styles.get(c)||"@").split(" ");a=$splat(a).map(function(d,e){if(!b[e]){return""}return($type(d)=="number")?b[e].replace("@",Math.round(d)):d}).join(" ")}else{if(a==String(Number(a))){a=Math.round(a)}}this.style[c]=a;return this},getStyle:function(b){switch(b){case"opacity":return this.get("opacity");case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"}b=b.camelCase();var a=this.style[b];if(!$chk(a)){a=[];for(var c in Element.ShortStyles){if(b!=c){continue}for(var d in Element.ShortStyles[c]){a.push(this.getStyle(d))}return a.join(" ")}a=this.getComputedStyle(b)}if(a){a=String(a);var g=a.match(/rgba?\([\d\s,]+\)/);if(g){a=a.replace(g[0],g[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a)))){if(b.test(/^(height|width)$/)){var h=(b=="width")?["left","right"]:["top","bottom"],e=0;h.each(function(k){e+=this.getStyle("border-"+k+"-width").toInt()+this.getStyle("padding-"+k).toInt()},this);return this["offset"+b.capitalize()]-e+"px"}if(Browser.Engine.presto&&String(a).test("px")){return a}if(b.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return a},setStyles:function(b){for(var a in b){this.setStyle(a,b[a])}return this},getStyles:function(){var a={};Array.each(arguments,function(b){a[b]=this.getStyle(b)},this);return a}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(b){var c=Element.ShortStyles;var h=Element.Styles;["margin","padding"].each(function(l){var k=l+b;c[l][k]=h[k]="@px"});var d="border"+b;c.border[d]=h[d]="@px @ rgb(@, @, @)";var e=d+"Width",a=d+"Style",g=d+"Color";c[d]={};c.borderWidth[e]=c[d][e]=h[e]="@px";c.borderStyle[a]=c[d][a]=h[a]="@";c.borderColor[g]=c[d][g]=h[g]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(l,k){if(h(this)){this.getWindow().scrollTo(l,k)}else{this.scrollLeft=l;this.scrollTop=k}return this},getSize:function(){if(h(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(h(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(h(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var k=this,l={x:0,y:0};while(k&&!h(k)){l.x+=k.scrollLeft;l.y+=k.scrollTop;k=k.parentNode}return l},getOffsetParent:function(){var k=this;if(h(k)){return null}if(!Browser.Engine.trident){return k.offsetParent}while((k=k.parentNode)&&!h(k)){if(e(k,"position")!="static"){return k}}return null},getOffsets:function(){var l=this,m={x:0,y:0};if(h(this)){return m}while(l&&!h(l)){m.x+=l.offsetLeft;m.y+=l.offsetTop;if(Browser.Engine.gecko){if(!c(l)){m.x+=g(l);m.y+=b(l)}var k=l.parentNode;if(k&&e(k,"overflow")!="visible"){m.x+=g(k);m.y+=b(k)}}else{if(l!=this&&(Browser.Engine.trident||Browser.Engine.webkit)){m.x+=g(l);m.y+=b(l)}}l=l.offsetParent;if(Browser.Engine.trident){while(l&&!l.currentStyle.hasLayout){l=l.offsetParent}}}if(Browser.Engine.gecko&&!c(this)){m.x-=g(this);m.y-=b(this)}return m},getPosition:function(l){if(h(this)){return{x:0,y:0}}var k=this.getOffsets(),n=this.getScrolls();var o={x:k.x-n.x,y:k.y-n.y};var m=(l&&(l=$(l)))?l.getPosition():{x:0,y:0};return{x:o.x-m.x,y:o.y-m.y}},getCoordinates:function(l){if(h(this)){return this.getWindow().getCoordinates()}var n=this.getPosition(l),m=this.getSize();var k={left:n.x,top:n.y,width:m.x,height:m.y};k.right=k.left+k.width;k.bottom=k.top+k.height;return k},computePosition:function(k){return{left:k.x-d(this,"margin-left"),top:k.y-d(this,"margin-top")}},position:function(k){return this.setStyles(this.computePosition(k))}});Native.implement([Document,Window],{getSize:function(){var k=this.getWindow();if(Browser.Engine.presto||Browser.Engine.webkit){return{x:k.innerWidth,y:k.innerHeight}}var l=a(this);return{x:l.clientWidth,y:l.clientHeight}},getScroll:function(){var k=this.getWindow();var l=a(this);return{x:k.pageXOffset||l.scrollLeft,y:k.pageYOffset||l.scrollTop}},getScrollSize:function(){var k=a(this);var l=this.getSize();return{x:Math.max(k.scrollWidth,l.x),y:Math.max(k.scrollHeight,l.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var k=this.getSize();return{top:0,left:0,bottom:k.y,right:k.x,height:k.y,width:k.x}}});var e=Element.getComputedStyle;function d(l,k){return e(l,k).toInt()||0}function c(k){return e(k,"-moz-box-sizing")=="border-box"}function b(k){return d(k,"border-top-width")}function g(k){return d(k,"border-left-width")}function h(k){return(/^(?:body|html)$/i).test(k.tagName)}function a(l){var k=l.getDocument();return(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}});Native.implement([Document,Element],{getElements:function(b,c){b=b.split(",");var h,e={};for(var g=0,k=b.length;g<k;g++){var a=b[g],d=Selectors.Utils.search(this,a,e);if(g!=0&&d.item){d=$A(d)}h=(g==0)?d:(h.item)?$A(h).concat(d):h.concat(d)}return new Elements(h,{ddup:(b.length>1),cash:!c})}});Element.implement({match:function(e){if(!e){return true}var c=Selectors.Utils.parseTagAndID(e);var a=c[0],b=c[1];if(!Selectors.Filters.byID(this,b)||!Selectors.Filters.byTag(this,a)){return false}var d=Selectors.Utils.parseSelector(e);return(d)?Selectors.Utils.filter(this,d,{}):true}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)["']?(.*?)["']?)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(c,b){if(!b){return true}var a=$uid(c);if(!b[a]){return b[a]=true}return false},parseNthArgument:function(b){if(Selectors.Cache.nth[b]){return Selectors.Cache.nth[b]}var e=b.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false}var c=parseInt(e[1]);var g=(c||c===0)?c:1;var d=e[2]||false;var a=parseInt(e[3])||0;if(g!=0){a--;while(a<1){a+=g}while(a>=g){a-=g}}else{g=a;d="index"}switch(d){case"n":e={a:g,b:a,special:"n"};break;case"odd":e={a:2,b:0,special:"n"};break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"};break;default:e={a:(g-1),special:"index"}}return Selectors.Cache.nth[b]=e},parseSelector:function(m){if(Selectors.Cache.parsed[m]){return Selectors.Cache.parsed[m]}var a,h={classes:[],pseudos:[],attributes:[]};while((a=Selectors.RegExps.combined.exec(m))){var g=a[1],k=a[2],l=a[3],c=a[4],b=a[5],e=a[6];if(g){h.classes.push(g)}else{if(b){var d=Selectors.Pseudo.get(b);if(d){h.pseudos.push({parser:d,argument:e})}else{h.attributes.push({name:b,operator:"=",value:e})}}else{if(k){h.attributes.push({name:k,operator:l,value:c})}}}}if(!h.classes.length){delete h.classes}if(!h.attributes.length){delete h.attributes}if(!h.pseudos.length){delete h.pseudos}if(!h.classes&&!h.attributes&&!h.pseudos){h=null}return Selectors.Cache.parsed[m]=h},parseTagAndID:function(c){var a=c.match(Selectors.RegExps.tag);var b=c.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(b)?b[1]:false]},filter:function(c,g,d){var e;if(g.classes){for(e=g.classes.length;e--;e){var b=g.classes[e];if(!Selectors.Filters.byClass(c,b)){return false}}}if(g.attributes){for(e=g.attributes.length;e--;e){var h=g.attributes[e];if(!Selectors.Filters.byAttribute(c,h.name,h.operator,h.value)){return false}}}if(g.pseudos){for(e=g.pseudos.length;e--;e){var a=g.pseudos[e];if(!Selectors.Filters.byPseudo(c,a.parser,a.argument,d)){return false}}}return true},getByTagAndID:function(d,a,b){if(b){var c=(d.getElementById)?d.getElementById(b,true):Element.getElementById(d,b,true);return(c&&Selectors.Filters.byTag(c,a))?[c]:[]}else{return d.getElementsByTagName(a)}},search:function(q,r,l){var y=[];var x=r.trim().replace(Selectors.RegExps.splitter,function(A,B,C){y.push(B);return":)"+C}).split(":)");var p,u,v,b;for(var c=0,h=x.length;c<h;c++){var d=x[c];if(c==0&&Selectors.RegExps.quick.test(d)){p=q.getElementsByTagName(d);continue}var z=y[c-1];var o=Selectors.Utils.parseTagAndID(d);var a=o[0],n=o[1];if(c==0){p=Selectors.Utils.getByTagAndID(q,a,n)}else{var w={},s=[];for(var e=0,g=p.length;e<g;e++){s=Selectors.Getters[z](s,p[e],a,n,w)}p=s}var t=Selectors.Utils.parseSelector(d);if(t){v=[];for(var k=0,m=p.length;k<m;k++){b=p[k];if(Selectors.Utils.filter(b,t,l)){v.push(b)}}p=v}}return p}};Selectors.Getters={" ":function(g,h,e,d,l){var a=Selectors.Utils.getByTagAndID(h,e,d);for(var b=0,c=a.length;b<c;b++){var k=a[b];if(Selectors.Utils.chk(k,l)){g.push(k)}}return g},">":function(g,h,e,d,k){var b=Selectors.Utils.getByTagAndID(h,e,d);for(var l=0,a=b.length;l<a;l++){var c=b[l];if(c.parentNode==h&&Selectors.Utils.chk(c,k)){g.push(c)}}return g},"+":function(d,e,a,b,c){while((e=e.nextSibling)){if(e.nodeType==1){if(Selectors.Utils.chk(e,c)&&Selectors.Filters.byTag(e,a)&&Selectors.Filters.byID(e,b)){d.push(e)}break}}return d},"~":function(d,e,a,b,c){while((e=e.nextSibling)){if(e.nodeType==1){if(!Selectors.Utils.chk(e,c)){break}if(Selectors.Filters.byTag(e,a)&&Selectors.Filters.byID(e,b)){d.push(e)}}}return d}};Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a))},byID:function(a,b){return(!b||(a.id&&a.id==b))},byClass:function(b,a){return(b.className&&b.className.contains(a," "))},byPseudo:function(a,b,c,d){return b.call(a,c,d)},byAttribute:function(d,c,e,b){var a=Element.prototype.getProperty.call(d,c);if(!a){return false}if(!e||b==undefined){return true}switch(e){case"=":return(a==b);case"*=":return(a.contains(b));case"^=":return(a.substr(0,b.length)==b);case"$=":return(a.substr(a.length-b.length)==b);case"!=":return(a!=b);case"~=":return a.contains(b," ");case"|=":return a.contains(b,"-")}return false}};Selectors.Pseudo=new Hash({empty:function(){return !(this.innerText||this.textContent||"").length},not:function(a){return !Element.match(this,a)},contains:function(a){return(this.innerText||this.textContent||"").contains(a)},"first-child":function(){return Selectors.Pseudo.index.call(this,0)},"last-child":function(){var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false}}return true},"only-child":function(){var b=this;while((b=b.previousSibling)){if(b.nodeType==1){return false}}var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false}}return true},"nth-child":function(b,d){b=(b==undefined)?"n":b;var g=Selectors.Utils.parseNthArgument(b);if(g.special!="n"){return Selectors.Pseudo[g.special].call(this,g.a,d)}var c=0;d.positions=d.positions||{};var e=$uid(this);if(!d.positions[e]){var h=this;while((h=h.previousSibling)){if(h.nodeType!=1){continue}c++;var a=d.positions[$uid(h)];if(a!=undefined){c=a+c;break}}d.positions[e]=c}return(d.positions[e]%g.a==g.b)},index:function(a){var c=this,b=0;while((c=c.previousSibling)){if(c.nodeType==1&&++b>a){return false}}return(b==a)},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a)},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a)}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this)}}};(function(){var b=function(){if(Browser.loaded){return}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};switch(Browser.Engine.name){case"webkit":(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50)})();break;case"trident":var a=document.createElement("div");(function(){($try(function(){a.doScroll("left");return $(a).inject(document.body).set("html","temp").dispose()}))?b():arguments.callee.delay(50)})();break;default:window.addEvent("load",b);document.addEvent("DOMContentLoaded",b)}})();var JSON=new Hash({encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).filter($defined))+"]";case"object":case"hash":var a=[];Hash.each(b,function(c,d){var e=JSON.encode(c);if(e){a.push(JSON.encode(d)+":"+e)}});return"{"+a+"}";case"number":case"boolean":return String(b);case false:return"null"}return null},$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16)},decode:function(string,secure){if($type(string)!="string"||!string.length){return null}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this)}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(b,a){this.key=b;this.setOptions(a)},write:function(b){b=encodeURIComponent(b);if(this.options.domain){b+="; domain="+this.options.domain}if(this.options.path){b+="; path="+this.options.path}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString()}if(this.options.secure){b+="; secure"}this.options.document.cookie=this.key+"="+b;return this},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(a)?decodeURIComponent(a[1]):null},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this}});Cookie.write=function(c,b,a){return new Cookie(c,a).write(b)};Cookie.read=function(a){return new Cookie(a).read()};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose()};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(g,e){this.instance="Swiff_"+$time();this.setOptions(e);e=this.options;var c=this.id=e.id||this.instance;var d=$(e.container);Swiff.CallBacks[this.instance]={};var p=e.params,n=e.vars,o=e.callBacks;var m=$extend({height:e.height,width:e.width},e.properties);var h=this;for(var a in o){Swiff.CallBacks[this.instance][a]=(function(q){return function(){return q.apply(h.object,arguments)}})(o[a]);n[a]="Swiff.CallBacks."+this.instance+"."+a}p.flashVars=Hash.toQueryString(n);if(Browser.Engine.trident){m.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";p.movie=g}else{m.type="application/x-shockwave-flash";m.data=g}var k='<object id="'+c+'"';for(var l in m){k+=" "+l+'="'+m[l]+'"'}k+=">";for(var b in p){if(p[b]){k+='<param name="'+b+'" value="'+p[b]+'" />'}}k+="</object>";this.object=((d)?d.empty():new Element("div")).set("html",k).firstChild},replaces:function(a){a=$(a,true);a.parentNode.replaceChild(this.toElement(),a);return this},inject:function(a){$(a,true).appendChild(this.toElement());return this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments))}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs)};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore",transition:function(a){return -(Math.cos(Math.PI*a)-1)/2}},initialize:function(a){this.subject=this.subject||this;this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"}},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.options.transition((a-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,b))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(a){return a},compute:function(b,c,a){return Fx.compute(b,c,a)},check:function(a){if(!this.timer){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(a.bind(this,Array.slice(arguments,1)));return false}return false},start:function(b,a){if(!this.check(arguments.callee,b,a)){return this}this.from=b;this.to=a;this.time=0;this.startTimer();this.onStart();return this},complete:function(){if(this.stopTimer()){this.onComplete()}return this},cancel:function(){if(this.stopTimer()){this.onCancel()}return this},onStart:function(){this.fireEvent("start",this.subject)},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject)}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain()},pause:function(){this.stopTimer();return this},resume:function(){this.startTimer();return this},stopTimer:function(){if(!this.timer){return false}this.time=$time()-this.time;this.timer=$clear(this.timer);return true},startTimer:function(){if(this.timer){return false}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true}});Fx.compute=function(b,c,a){return(c-b)*a+b};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(c,b,e){e=$splat(e);var d=e[1];if(!$chk(d)){e[1]=e[0];e[0]=c.getStyle(b)}var a=e.map(this.parse);return{from:a[0],to:a[1]}},parse:function(a){a=$lambda(a)();a=(typeof a=="string")?a.split(" "):$splat(a);return a.map(function(b){b=String(b);var c=false;Fx.CSS.Parsers.each(function(d,e){if(c){return}var g=d.parse(b);if($chk(g)){c={value:g,parser:d}}});c=c||{value:b,parser:Fx.CSS.Parsers.String};return c})},compute:function(b,c,d){var a=[];(Math.min(b.length,c.length)).times(function(e){a.push({value:b[e].parser.compute(b[e].value,c[e].value,d),parser:b[e].parser})});a.$family={name:"fx:css:value"};return a},serve:function(b,c){if($type(b)!="fx:css:value"){b=this.parse(b)}var a=[];b.each(function(d){a=a.concat(d.parser.serve(d.value,c))});return a},render:function(a,b,c,d){a.setStyle(b,this.serve(c,d))},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a]}var b={};Array.each(document.styleSheets,function(d,e){var g=d.href;if(g&&g.contains("://")&&!g.contains(document.domain)){return}var c=d.rules||d.cssRules;Array.each(c,function(h,l){if(!h.style){return}var k=(h.selectorText)?h.selectorText.replace(/^\w+/,function(m){return m.toLowerCase()}):null;if(!k||!k.test("^"+a+"$")){return}Element.Styles.each(function(m,n){if(!h.style[n]||Element.ShortStyles[n]){return}m=String(h.style[n]);b[n]=(m.test(/^rgb/))?m.rgbToHex():m})})});return Fx.CSS.Cache[a]=b}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true)}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false},compute:function(b,c,a){return b.map(function(d,e){return Math.round(Fx.compute(b[e],c[e],a))})},serve:function(a){return a.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=$(b);this.parent(a)},set:function(b,a){if(arguments.length==1){a=b;b=this.property||this.options.property}this.render(this.element,b,a,this.options.unit);return this},start:function(d,b,c){if(!this.check(arguments.callee,d,b,c)){return this}var e=Array.flatten(arguments);this.property=this.options.property||e.shift();var a=this.prepare(this.element,this.property,e);return this.parent(a.from,a.to)}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel()}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a))},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a)}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")))}return this.retrieve("tween")}};Element.implement({tween:function(a,b,c){this.get("tween").start(arguments);return this},fade:function(d){var b=this.get("tween"),c="opacity",a;d=$pick(d,"toggle");switch(d){case"in":b.start(c,1);break;case"out":b.start(c,0);break;case"show":b.set(c,1);break;case"hide":b.set(c,0);break;case"toggle":var e=this.retrieve("fade:flag",this.get("opacity")==1);b.start(c,(e)?0:1);this.store("fade:flag",!e);a=true;break;default:b.start(c,arguments)}if(!a){this.eliminate("fade:flag")}return this},highlight:function(b,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));a=(a=="transparent")?"#fff":a}var c=this.get("tween");c.start("background-color",b||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));c.callChain()}.bind(this));return this}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=$(b);this.parent(a)},set:function(a){if(typeof a=="string"){a=this.search(a)}for(var b in a){this.render(this.element,b,a[b],this.options.unit)}return this},compute:function(b,c,d){var a={};for(var e in b){a[e]=this.parent(b[e],c[e],d)}return a},start:function(e){if(!this.check(arguments.callee,e)){return this}if(typeof e=="string"){e=this.search(e)}var b={},c={};for(var d in e){var a=this.prepare(this.element,d,e[d]);b[d]=a.from;c[d]=a.to}return this.parent(b,c)}});Element.Properties.morph={set:function(a){var b=this.retrieve("morph");if(b){b.cancel()}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a))},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a)}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")))}return this.retrieve("morph")}};Element.implement({morph:function(a){this.get("morph").start(a);return this}});(function(){var a=Fx.prototype.initialize;Fx.prototype.initialize=function(d){a.call(this,d);var c=this.options.transition;if(typeof c=="string"&&(c=c.split(":"))){var b=Fx.Transitions;b=b[c[0]]||b[c[0].capitalize()];if(c[1]){b=b["ease"+c[1].capitalize()+(c[2]?c[2].capitalize():"")]}this.options.transition=b}}})();Fx.Transition=function(b,a){a=$splat(a);return $extend(b,{easeIn:function(c){return b(c,a)},easeOut:function(c){return 1-b(1-c,a)},easeInOut:function(c){return(c<=0.5)?b(2*c,a)/2:(2-b(2*(1-c),a))/2}})};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b])}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a[0]||6)},Expo:function(a){return Math.pow(2,8*(a-1))},Circ:function(a){return 1-Math.sin(Math.acos(a))},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2)},Back:function(b,a){a=a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a)},Bounce:function(b){var c;for(var d=0,a=1;1;d+=a,a/=2){if(b>=(7-4*d)/11){c=-Math.pow((11-6*d-11*b)/4,2)+a*a;break}}return c},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2])})});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false},initialize:function(a){this.xhr=new Browser.Request();this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers)},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml)}else{this.response={text:null,xml:null};this.failure()}this.xhr.onreadystatechange=$empty},isSuccess:function(){return((this.status>=200)&&(this.status<300))},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a)}return a.stripScripts(this.options.evalScripts)},success:function(b,a){this.onSuccess(this.processScripts(b),a)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},setHeader:function(a,b){this.headers.set(a,b);return this},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a)}.bind(this))},check:function(a){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(a.bind(this,Array.slice(arguments,1)));return false}return false},send:function(e){if(!this.check(arguments.callee,e)){return this}this.running=true;var h=$type(e);if(h=="string"||h=="element"){e={data:e}}var a=this.options;e=$extend({data:a.data,url:a.url,method:a.method},e);var l=e.data,c=e.url,d=e.method;switch($type(l)){case"element":l=$(l).toQueryString();break;case"object":case"hash":l=Hash.toQueryString(l)}if(this.options.format){var g="format="+this.options.format;l=(l)?g+"&"+l:g}if(this.options.emulation&&["put","delete"].contains(d)){var k="_method="+d;l=(l)?k+"&"+l:k;d="post"}if(this.options.urlEncoded&&d=="post"){var b=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+b)}if(l&&d=="get"){c=c+(c.contains("?")?"&":"?")+l;l=null}this.xhr.open(d.toUpperCase(),c,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(m,n){if(!$try(function(){this.xhr.setRequestHeader(n,m);return true}.bind(this))){this.fireEvent("exception",[n,m])}},this);this.fireEvent("request");this.xhr.send(l);if(!this.options.async){this.onStateChange()}return this},cancel:function(){if(!this.running){return this}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this}});(function(){var a={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(c,{method:b.toLowerCase()}))}});Request.implement(a)})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel()}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a))},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a)}this.store("send",new Request(this.retrieve("send:options")))}return this.retrieve("send")}};Element.implement({send:function(a){var b=this.get("send");b.send({data:this,url:a||b.options.url});return this}});Request.HTML=new Class({Extends:Request,options:{update:false,evalScripts:true,filter:false},processHTML:function(b){var c=b.match(/<body[^>]*>([\s\S]*?)<\/body>/i);b=(c)?c[1]:b;var a=new Element("div");return $try(function(){var k="<root>"+b+"</root>",e;if(Browser.Engine.trident){e=new ActiveXObject("Microsoft.XMLDOM");e.async=false;e.loadXML(k)}else{e=new DOMParser().parseFromString(k,"text/xml")}k=e.getElementsByTagName("root")[0];for(var g=0,h=k.childNodes.length;g<h;g++){var d=Element.clone(k.childNodes[g],true,true);if(d){a.grab(d)}}return a})||a.set("html",b)},success:function(b){var c=this.options,d=this.response;d.html=b.stripScripts(function(e){d.javascript=e});var a=this.processHTML(d.html);d.tree=a.childNodes;d.elements=a.getElements("*");if(c.filter){d.tree=d.elements.filter(c.filter)}if(c.update){$(c.update).empty().adopt(d.tree)}if(c.evalScripts){$exec(d.javascript)}this.onSuccess(d.tree,d.elements,d.html,d.javascript)}});Element.Properties.load={set:function(a){var b=this.retrieve("load");if(b){send.cancel()}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},a))},get:function(a){if(a||!this.retrieve("load")){if(a||!this.retrieve("load:options")){this.set("load",a)}this.store("load",new Request.HTML(this.retrieve("load:options")))}return this.retrieve("load")}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);this.headers.extend({Accept:"application/json","X-Request":"JSON"})},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a)}});var Asset=new Hash({javascript:function(g,d){d=$extend({onload:$empty,document:document,check:$lambda(true)},d);var b=new Element("script",{src:g,type:"text/javascript"});var e=d.onload.bind(b),a=d.check,h=d.document;delete d.onload;delete d.check;delete d.document;b.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e()}}}).setProperties(d);if(Browser.Engine.webkit419){var c=(function(){if(!$try(a)){return}$clear(c);e()}).periodical(50)}return b.inject(h.head)},css:function(b,a){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:b},a)).inject(document.head)},image:function(c,b){b=$merge({onload:$empty,onabort:$empty,onerror:$empty},b);var d=new Image();var a=$(d)||new Element("img");["load","abort","error"].each(function(e){var g="on"+e;var h=b[g];delete b[g];d[g]=function(){if(!d){return}if(!a.parentNode){a.width=d.width;a.height=d.height}d=d.onload=d.onabort=d.onerror=null;h.delay(1,a,a);a.fireEvent(e,a,1)}});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1)}return a.setProperties(b)},images:function(d,c){c=$merge({onComplete:$empty,onProgress:$empty},c);if(!d.push){d=[d]}var a=[];var b=0;d.each(function(g){var e=new Asset.image(g,{onload:function(){c.onProgress.call(this,b,d.indexOf(g));b++;if(b==d.length){c.onComplete()}}});a.push(e)});return new Elements(a)}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a)},compute:function(h,g,e){var b={};for(var a in h){var d=h[a],l=g[a],k=b[a]={};for(var c in d){k[c]=this.parent(d[c],l[c],e)}}return b},set:function(d){for(var c in d){var a=d[c];for(var b in a){this.render(this.elements[c],b,a[b],this.options.unit)}}return this},start:function(b){if(!this.check(arguments.callee,b)){return this}var g={},e={};for(var a in b){var k=b[a],d=g[a]={},h=e[a]={};for(var c in k){var l=this.prepare(this.elements[a],c,k[c]);d[c]=l.from;h[c]=l.to}}return this.parent(g,e)}});var Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var b=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(b.elements,b.options);this.togglers=$$(b.togglers);this.container=$(b.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var c=0,a=this.togglers.length;c<a;c++){this.addSection(this.togglers[c],this.elements[c])}this.elements.each(function(e,g){if(this.options.show===g){this.fireEvent("active",[this.togglers[g],e])}else{for(var d in this.effects){e.setStyle(d,0)}}},this);if($chk(this.options.display)){this.display(this.options.display)}},addSection:function(d,g,b){d=$(d);g=$(g);var c=this.togglers.contains(d);var h=this.togglers.length;this.togglers.include(d);this.elements.include(g);if(h&&(!c||b)){b=$pick(b,h-1);d.inject(this.togglers[b],"before");g.inject(d,"after")}else{if(this.container&&!c){d.inject(this.container);g.inject(this.container)}}var a=this.togglers.indexOf(d);d.addEvent("click",this.display.bind(this,a));if(this.options.height){g.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){g.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}g.fullOpacity=1;if(this.options.fixedWidth){g.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){g.fullHeight=this.options.fixedHeight}g.setStyle("overflow","hidden");if(!c){for(var e in this.effects){g.setStyle(e,0)}}return this},display:function(a){a=($type(a)=="element")?this.elements.indexOf(a):a;if((this.timer&&this.options.wait)||(a===this.previous&&!this.options.alwaysHide)){return this}this.previous=a;var b={};this.elements.each(function(d,e){b[e]={};var g=(e!=a)||(this.options.alwaysHide&&(d.offsetHeight>0));this.fireEvent(g?"background":"active",[this.togglers[e],d]);for(var c in this.effects){b[e][c]=g?0:d[this.effects[c]]}},this);return this.start(b)}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(d,a){this.element=this.subject=$(d);this.parent(a);var b=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body)}var c=this.element;if(this.options.wheelStops){this.addEvent("start",function(){c.addEvent("mousewheel",b)},true);this.addEvent("complete",function(){c.removeEvent("mousewheel",b)},true)}},set:function(){var a=Array.flatten(arguments);this.element.scrollTo(a[0],a[1])},compute:function(b,c,d){var e=[];var a=2;a.times(function(g){e.push(Fx.compute(b[g],c[g],d))});return e},start:function(h,b){if(!this.check(arguments.callee,h,b)){return this}var e=this.element.getSize(),d=this.element.getScrollSize();var k=this.element.getScroll(),g={x:h,y:b};for(var c in g){var a=d[c]-e[c];if($chk(g[c])){g[c]=($type(g[c])=="number")?g[c].limit(0,a):a}else{g[c]=k[c]}g[c]+=this.options.offset[c]}return this.parent([k.x,k.y],[g.x,g.y])},toTop:function(){return this.start(false,0)},toLeft:function(){return this.start(0,false)},toRight:function(){return this.start("right",false)},toBottom:function(){return this.start(false,"bottom")},toElement:function(b){var a=$(b).getPosition(this.element);return this.start(a.x,a.y)}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=$type(this.options.handle);this.handles=(a=="array"||a=="collection")?$$(this.options.handle):$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach()},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this},start:function(c){if(this.options.preventDefault){c.preventDefault()}this.fireEvent("beforeStart",this.element);this.mouse.start=c.page;var a=this.options.limit;this.limit={x:[],y:[]};for(var b in this.options.modifiers){if(!this.options.modifiers[b]){continue}if(this.options.style){this.value.now[b]=this.element.getStyle(this.options.modifiers[b]).toInt()}else{this.value.now[b]=this.element[this.options.modifiers[b]]}if(this.options.invert){this.value.now[b]*=-1}this.mouse.pos[b]=c.page[b]-this.value.now[b];if(a&&a[b]){for(var d=2;d--;d){if($chk(a[b][d])){this.limit[b][d]=$lambda(a[b][d])()}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop)},check:function(a){if(this.options.preventDefault){a.preventDefault()}var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",this.element).fireEvent("snap",this.element)}},drag:function(a){if(this.options.preventDefault){a.preventDefault()}this.mouse.now=a.page;for(var b in this.options.modifiers){if(!this.options.modifiers[b]){continue}this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.options.invert){this.value.now[b]*=-1}if(this.options.limit&&this.limit[b]){if($chk(this.limit[b][1])&&(this.value.now[b]>this.limit[b][1])){this.value.now[b]=this.limit[b][1]}else{if($chk(this.limit[b][0])&&(this.value.now[b]<this.limit[b][0])){this.value.now[b]=this.limit[b][0]}}}if(this.options.grid[b]){this.value.now[b]-=(this.value.now[b]%this.options.grid[b])}if(this.options.style){this.element.setStyle(this.options.modifiers[b],this.value.now[b]+this.options.unit)}else{this.element[this.options.modifiers[b]]=this.value.now[b]}}this.fireEvent("drag",this.element)},cancel:function(a){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element)}},stop:function(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(a){this.fireEvent("complete",this.element)}}});Element.implement({makeResizable:function(a){return new Drag(this,$merge({modifiers:{x:"width",y:"height"}},a))}});var Slider=new Class({Implements:[Events,Options],options:{onTick:function(a){if(this.options.snap){a=this.toPosition(this.step)}this.knob.setStyle(this.property,a)},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(c,a,d){this.setOptions(d);this.element=$(c);this.knob=$(a);this.previousChange=this.previousEnd=this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bind(this));if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement.bindWithEvent(this))}var b,g={},e={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";b="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";b="offsetWidth"}this.half=this.knob[b]/2;this.full=this.element[b]-this.knob[b]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);e[this.axis]=this.property;g[this.axis]=[-this.options.offset,this.full-this.options.offset];this.drag=new Drag(this.knob,{snap:0,limit:g,modifiers:e,onDrag:this.draggedKnob.bind(this),onStart:this.draggedKnob.bind(this),onComplete:function(){this.draggedKnob();this.end()}.bind(this)});if(this.options.snap){this.drag.options.grid=Math.ceil(this.stepWidth);this.drag.options.limit[this.axis][1]=this.full}},set:function(a){if(!((this.range>0)^(a<this.min))){a=this.min}if(!((this.range>0)^(a>this.max))){a=this.max}this.step=Math.round(a);this.checkStep();this.end();this.fireEvent("tick",this.toPosition(this.step));return this},clickedElement:function(b){var c=this.range<0?-1:1;var a=b.page[this.axis]-this.element.getPosition()[this.axis]-this.half;a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+c*this.toStep(a));this.checkStep();this.end();this.fireEvent("tick",a)},scrolledElement:function(a){var b=(this.options.mode=="horizontal")?(a.wheel<0):(a.wheel>0);this.set(b?this.step-this.stepSize:this.step+this.stepSize);a.stop()},draggedKnob:function(){var b=this.range<0?-1:1;var a=this.drag.value.now[this.axis];a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+b*this.toStep(a));this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"")}},toStep:function(a){var b=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(b-=b%this.stepSize):b},toPosition:function(a){return(this.full*Math.abs(this.min-a))/(this.steps*this.stepSize)-this.options.offset}});var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);
/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/
return { w3cdom: l, pv: t, webkit: r, ie: i, win: q, mac: m}
} (); var e = function() { if (!a.w3cdom) { return } J(I); if (a.ie && a.win) { try { g.write("<script id=__ie_ondomload defer=true src=//:><\/script>"); var i = c("__ie_ondomload"); if (i) { i.onreadystatechange = function() { if (this.readyState == "complete") { this.parentNode.removeChild(this); V() } } } } catch (j) { } } if (a.webkit && typeof g.readyState != Z) { Q = setInterval(function() { if (/loaded|complete/.test(g.readyState)) { V() } }, 10) } if (typeof g.addEventListener != Z) { g.addEventListener("DOMContentLoaded", V, null) } M(V) } (); function V() { if (S) { return } if (a.ie && a.win) { var m = Y("span"); try { var l = g.getElementsByTagName("body")[0].appendChild(m); l.parentNode.removeChild(l) } catch (n) { return } } S = true; if (Q) { clearInterval(Q); Q = null } var j = f.length; for (var k = 0; k < j; k++) { f[k]() } } function J(i) { if (S) { i() } else { f[f.length] = i } } function M(j) { if (typeof G.addEventListener != Z) { G.addEventListener("load", j, false) } else { if (typeof g.addEventListener != Z) { g.addEventListener("load", j, false) } else { if (typeof G.attachEvent != Z) { G.attachEvent("onload", j) } else { if (typeof G.onload == "function") { var i = G.onload; G.onload = function() { i(); j() } } else { G.onload = j } } } } } function I() { var l = H.length; for (var j = 0; j < l; j++) { var m = H[j].id; if (a.pv[0] > 0) { var k = c(m); if (k) { H[j].width = k.getAttribute("width") ? k.getAttribute("width") : "0"; H[j].height = k.getAttribute("height") ? k.getAttribute("height") : "0"; if (O(H[j].swfVersion)) { if (a.webkit && a.webkit < 312) { U(k) } X(m, true) } else { if (H[j].expressInstall && !C && O("6.0.65") && (a.win || a.mac)) { D(H[j]) } else { d(k) } } } } else { X(m, true) } } } function U(m) { var k = m.getElementsByTagName(P)[0]; if (k) { var p = Y("embed"), r = k.attributes; if (r) { var o = r.length; for (var n = 0; n < o; n++) { if (r[n].nodeName.toLowerCase() == "data") { p.setAttribute("src", r[n].nodeValue) } else { p.setAttribute(r[n].nodeName, r[n].nodeValue) } } } var q = k.childNodes; if (q) { var s = q.length; for (var l = 0; l < s; l++) { if (q[l].nodeType == 1 && q[l].nodeName.toLowerCase() == "param") { p.setAttribute(q[l].getAttribute("name"), q[l].getAttribute("value")) } } } m.parentNode.replaceChild(p, m) } } function F(i) { if (a.ie && a.win && O("8.0.0")) { G.attachEvent("onunload", function() { var k = c(i); if (k) { for (var j in k) { if (typeof k[j] == "function") { k[j] = function() { } } } k.parentNode.removeChild(k) } }) } } function D(j) { C = true; var o = c(j.id); if (o) { if (j.altContentId) { var l = c(j.altContentId); if (l) { L = l; T = j.altContentId } } else { L = b(o) } if (!(/%$/.test(j.width)) && parseInt(j.width, 10) < 310) { j.width = "310" } if (!(/%$/.test(j.height)) && parseInt(j.height, 10) < 137) { j.height = "137" } g.title = g.title.slice(0, 47) + " - Flash Player Installation"; var n = a.ie && a.win ? "ActiveX" : "PlugIn", k = g.title, m = "MMredirectURL=" + G.location + "&MMplayerType=" + n + "&MMdoctitle=" + k, p = j.id; if (a.ie && a.win && o.readyState != 4) { var i = Y("div"); p += "SWFObjectNew"; i.setAttribute("id", p); o.parentNode.insertBefore(i, o); o.style.display = "none"; G.attachEvent("onload", function() { o.parentNode.removeChild(o) }) } R({ data: j.expressInstall, id: K, width: j.width, height: j.height }, { flashvars: m }, p) } } function d(j) { if (a.ie && a.win && j.readyState != 4) { var i = Y("div"); j.parentNode.insertBefore(i, j); i.parentNode.replaceChild(b(j), i); j.style.display = "none"; G.attachEvent("onload", function() { j.parentNode.removeChild(j) }) } else { j.parentNode.replaceChild(b(j), j) } } function b(n) { var m = Y("div"); if (a.win && a.ie) { m.innerHTML = n.innerHTML } else { var k = n.getElementsByTagName(P)[0]; if (k) { var o = k.childNodes; if (o) { var j = o.length; for (var l = 0; l < j; l++) { if (!(o[l].nodeType == 1 && o[l].nodeName.toLowerCase() == "param") && !(o[l].nodeType == 8)) { m.appendChild(o[l].cloneNode(true)) } } } } } return m } function R(AE, AC, q) { var p, t = c(q); if (typeof AE.id == Z) { AE.id = q } if (a.ie && a.win) { var AD = ""; for (var z in AE) { if (AE[z] != Object.prototype[z]) { if (z == "data") { AC.movie = AE[z] } else { if (z.toLowerCase() == "styleclass") { AD += ' class="' + AE[z] + '"' } else { if (z != "classid") { AD += " " + z + '="' + AE[z] + '"' } } } } } var AB = ""; for (var y in AC) { if (AC[y] != Object.prototype[y]) { AB += '<param name="' + y + '" value="' + AC[y] + '" />' } } t.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + AD + ">" + AB + "</object>"; F(AE.id); p = c(AE.id) } else { if (a.webkit && a.webkit < 312) { var AA = Y("embed"); AA.setAttribute("type", W); for (var x in AE) { if (AE[x] != Object.prototype[x]) { if (x == "data") { AA.setAttribute("src", AE[x]) } else { if (x.toLowerCase() == "styleclass") { AA.setAttribute("class", AE[x]) } else { if (x != "classid") { AA.setAttribute(x, AE[x]) } } } } } for (var w in AC) { if (AC[w] != Object.prototype[w]) { if (w != "movie") { AA.setAttribute(w, AC[w]) } } } t.parentNode.replaceChild(AA, t); p = AA } else { var s = Y(P); s.setAttribute("type", W); for (var v in AE) { if (AE[v] != Object.prototype[v]) { if (v.toLowerCase() == "styleclass") { s.setAttribute("class", AE[v]) } else { if (v != "classid") { s.setAttribute(v, AE[v]) } } } } for (var u in AC) { if (AC[u] != Object.prototype[u] && u != "movie") { E(s, u, AC[u]) } } t.parentNode.replaceChild(s, t); p = s } } return p } function E(k, i, j) { var l = Y("param"); l.setAttribute("name", i); l.setAttribute("value", j); k.appendChild(l) } function c(i) { return g.getElementById(i) } function Y(i) { return g.createElement(i) } function O(k) { var j = a.pv, i = k.split("."); i[0] = parseInt(i[0], 10); i[1] = parseInt(i[1], 10); i[2] = parseInt(i[2], 10); return (j[0] > i[0] || (j[0] == i[0] && j[1] > i[1]) || (j[0] == i[0] && j[1] == i[1] && j[2] >= i[2])) ? true : false } function A(m, j) { if (a.ie && a.mac) { return } var l = g.getElementsByTagName("head")[0], k = Y("style"); k.setAttribute("type", "text/css"); k.setAttribute("media", "screen"); if (!(a.ie && a.win) && typeof g.createTextNode != Z) { k.appendChild(g.createTextNode(m + " {" + j + "}")) } l.appendChild(k); if (a.ie && a.win && typeof g.styleSheets != Z && g.styleSheets.length > 0) { var i = g.styleSheets[g.styleSheets.length - 1]; if (typeof i.addRule == P) { i.addRule(m, j) } } } function X(k, i) { var j = i ? "visible" : "hidden"; if (S) { c(k).style.visibility = j } else { A("#" + k, "visibility:" + j) } } return { registerObject: function(l, i, k) { if (!a.w3cdom || !l || !i) { return } var j = {}; j.id = l; j.swfVersion = i; j.expressInstall = k ? k : false; H[H.length] = j; X(l, false) }, getObjectById: function(l) { var i = null; if (a.w3cdom && S) { var j = c(l); if (j) { var k = j.getElementsByTagName(P)[0]; if (!k || (k && typeof j.SetVariable != Z)) { i = j } else { if (typeof k.SetVariable != Z) { i = k } } } } return i }, embedSWF: function(n, u, r, t, j, m, k, p, s) { if (!a.w3cdom || !n || !u || !r || !t || !j) { return } r += ""; t += ""; if (O(j)) { X(u, false); var q = (typeof s == P) ? s : {}; q.data = n; q.width = r; q.height = t; var o = (typeof p == P) ? p : {}; if (typeof k == P) { for (var l in k) { if (k[l] != Object.prototype[l]) { if (typeof o.flashvars != Z) { o.flashvars += "&" + l + "=" + k[l] } else { o.flashvars = l + "=" + k[l] } } } } J(function() { R(q, o, u); if (q.id == u) { X(u, true) } }) } else { if (m && !C && O("6.0.65") && (a.win || a.mac)) { X(u, false); J(function() { var i = {}; i.id = i.altContentId = u; i.width = r; i.height = t; i.expressInstall = m; D(i) }) } } }, getFlashPlayerVersion: function() { return { major: a.pv[0], minor: a.pv[1], release: a.pv[2]} }, hasFlashPlayerVersion: O, createSWF: function(k, j, i) { if (a.w3cdom && S) { return R(k, j, i) } else { return undefined } }, createCSS: function(j, i) { if (a.w3cdom) { A(j, i) } }, addDomLoadEvent: J, addLoadEvent: M, getQueryParamValue: function(m) { var l = g.location.search || g.location.hash; if (m == null) { return l } if (l) { var k = l.substring(1).split("&"); for (var j = 0; j < k.length; j++) { if (k[j].substring(0, k[j].indexOf("=")) == m) { return k[j].substring((k[j].indexOf("=") + 1)) } } } return "" }, expressInstallCallback: function() { if (C && L) { var i = c(K); if (i) { i.parentNode.replaceChild(L, i); if (T) { X(T, true); if (a.ie && a.win) { L.style.display = "block" } } L = null; T = null; C = false } } } }
} (); if (typeof deconcept == "undefined") { var deconcept = {} } if (typeof deconcept.util == "undefined") { deconcept.util = {} } if (typeof deconcept.SWFObjectUtil == "undefined") { deconcept.SWFObjectUtil = {} } deconcept.SWFObject = function(g, d, p, k, m, o, r, l, a, e) { if (!document.getElementById) { return } this.DETECT_KEY = e ? e : "detectflash"; this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY); this.params = {}; this.variables = {}; this.attributes = []; if (g) { this.setAttribute("swf", g) } if (d) { this.setAttribute("id", d) } if (p) { this.setAttribute("width", p) } if (k) { this.setAttribute("height", k) } if (m) { this.setAttribute("version", new deconcept.PlayerVersion(m.toString().split("."))) } this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(); if (!window.opera && document.all && this.installedVer.major > 7) { if (!deconcept.unloadSet) { deconcept.SWFObjectUtil.prepUnload = function() { __flash_unloadHandler = function() { }; __flash_savedUnloadHandler = function() { }; window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs) }; window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload); deconcept.unloadSet = true } } if (o) { this.addParam("bgcolor", o) } var b = r ? r : "high"; this.addParam("quality", b); this.setAttribute("useExpressInstall", false); this.setAttribute("doExpressInstall", false); var n = (l) ? l : window.location; this.setAttribute("xiRedirectUrl", n); this.setAttribute("redirectUrl", ""); if (a) { this.setAttribute("redirectUrl", a) } }; deconcept.SWFObject.prototype = { useExpressInstall: function(a) { this.xiSWFPath = !a ? "expressinstall.swf" : a; this.setAttribute("useExpressInstall", true) }, setAttribute: function(a, b) { this.attributes[a] = b }, getAttribute: function(a) { return this.attributes[a] || "" }, addParam: function(a, b) { this.params[a] = b }, getParams: function() { return this.params }, addVariable: function(a, b) { this.variables[a] = b }, getVariable: function(a) { return this.variables[a] || "" }, getVariables: function() { return this.variables }, getVariablePairs: function() { var a = []; var b; var c = this.getVariables(); for (b in c) { a[a.length] = b + "=" + c[b] } return a }, getSWFHTML: function() { var d = ""; if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); this.setAttribute("swf", this.xiSWFPath) } d = '<embed type="application/x-shockwave-flash" src="' + this.getAttribute("swf") + '" width="' + this.getAttribute("width") + '" height="' + this.getAttribute("height") + '" style="' + (this.getAttribute("style") || "") + '"'; d += ' id="' + this.getAttribute("id") + '" name="' + this.getAttribute("id") + '" '; var c = this.getParams(); for (var a in c) { d += [a] + '="' + c[a] + '" ' } var b = this.getVariablePairs().join("&"); if (b.length > 0) { d += 'flashvars="' + b + '"' } d += "/>" } else { if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); this.setAttribute("swf", this.xiSWFPath) } d = '<object id="' + this.getAttribute("id") + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.getAttribute("width") + '" height="' + this.getAttribute("height") + '" style="' + (this.getAttribute("style") || "") + '">'; d += '<param name="movie" value="' + this.getAttribute("swf") + '" />'; var c = this.getParams(); for (var a in c) { d += '<param name="' + a + '" value="' + c[a] + '" />' } var b = this.getVariablePairs().join("&"); if (b.length > 0) { d += '<param name="flashvars" value="' + b + '" />' } d += "</object>" } return d }, write: function(a) { if (this.getAttribute("useExpressInstall")) { var b = new deconcept.PlayerVersion([6, 0, 65]); if (this.installedVer.versionIsValid(b) && !this.installedVer.versionIsValid(this.getAttribute("version"))) { this.setAttribute("doExpressInstall", true); this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl"))); document.title = document.title.slice(0, 47) + " - Flash Player Installation"; this.addVariable("MMdoctitle", document.title) } } if (this.skipDetect || this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) { var c = (typeof a == "string") ? document.getElementById(a) : a; c.innerHTML = this.getSWFHTML(); return true } else { if (this.getAttribute("redirectUrl") != "") { document.location.replace(this.getAttribute("redirectUrl")) } } return false } }; deconcept.SWFObjectUtil.getPlayerVersion = function() { var c = new deconcept.PlayerVersion([0, 0, 0]); if (navigator.plugins && navigator.mimeTypes.length) { var a = navigator.plugins["Shockwave Flash"]; if (a && a.description) { c = new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")) } } else { if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0) { var d = 1; var b = 3; while (d) { try { b++; d = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + b); c = new deconcept.PlayerVersion([b, 0, 0]) } catch (g) { d = null } } } else { try { var d = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7") } catch (g) { try { var d = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); c = new deconcept.PlayerVersion([6, 0, 21]); d.AllowScriptAccess = "always" } catch (g) { if (c.major == 6) { return c } } try { d = new ActiveXObject("ShockwaveFlash.ShockwaveFlash") } catch (g) { } } if (d != null) { c = new deconcept.PlayerVersion(d.GetVariable("$version").split(" ")[1].split(",")) } } } return c }; deconcept.PlayerVersion = function(a) { this.major = a[0] != null ? parseInt(a[0]) : 0; this.minor = a[1] != null ? parseInt(a[1]) : 0; this.rev = a[2] != null ? parseInt(a[2]) : 0 }; deconcept.PlayerVersion.prototype.versionIsValid = function(a) { if (this.major < a.major) { return false } if (this.major > a.major) { return true } if (this.minor < a.minor) { return false } if (this.minor > a.minor) { return true } if (this.rev < a.rev) { return false } return true }; deconcept.util = { getRequestParameter: function(e) { var d = document.location.search || document.location.hash; if (e == null) { return d } if (d) { var c = d.substring(1).split("&"); for (var a = 0; a < c.length; a++) { if (c[a].substring(0, c[a].indexOf("=")) == e) { var b = c[a].substring((c[a].indexOf("=") + 1)); return String.format("{0}/{1}", b.substring(0, 3), b.substring(3, 6)) } } } return "" } }; deconcept.SWFObjectUtil.cleanupSWFs = function() { var c = document.getElementsByTagName("OBJECT"); for (var b = c.length - 1; b >= 0; b--) { c[b].style.display = "none"; for (var a in c[b]) { if (typeof c[b][a] == "function") { c[b][a] = function() { } } } } }; if (!document.getElementById && document.all) { document.getElementById = function(a) { return document.all[a] } } var getQueryParamValue = deconcept.util.getRequestParameter; var FlashObject = deconcept.SWFObject; var SWFObject = deconcept.SWFObject; var hoverButton = new Class({ initialize: function(a) { this.options = a; this.buttonElement = this.options.buttonElement; this.offState = this.buttonElement.src; this.hoverState = this.offState.replace("_off.", "_hover."); this.preloadImage([this.hoverState]) }, setState: function(a) { this.buttonElement.src = a }, preloadImage: function(c) { var b = this; var a = new Asset.images(c, { onComplete: function() { b.addListeners() } }) }, addListeners: function() { this.buttonElement.addEvent("mouseover", this.setState.pass(this.hoverState, this)); this.buttonElement.addEvent("mouseleave", this.setState.pass(this.offState, this)) } }); var hoverButtonHandler = { arrHoverButtons: [], arrHoverInputs: [], init: function() { var b = $$("img.hover_button"); var a = $$("input.hover_button"); for (i = 0; i < b.length; i++) { hoverButtonHandler.arrHoverButtons[i] = new hoverButton({ buttonElement: b[i] }) } for (i = 0; i < a.length; i++) { hoverButtonHandler.arrHoverInputs[i] = new hoverButton({ buttonElement: a[i] }) } } }; window.addEvent("domready", hoverButtonHandler.init); var mainDropNav = { timeOut: 500, closeTimer: 0, init: function() { $("primary_nav_home_drop_link").addEvent("click", mainDropNav.openNav); $("primary_nav_home_drop_link").addEvent("mouseout", mainDropNav.closeTime); $("primary_nav_home_drop").addEvent("mouseover", mainDropNav.cancelCloseTime); $("primary_nav_home_drop").addEvent("mouseout", mainDropNav.closeTime) }, openNav: function() { mainDropNav.cancelCloseTime(); $("primary_nav_home_drop").addClass("open") }, cancelCloseTime: function() { if (mainDropNav.closeTimer) { window.clearTimeout(mainDropNav.closeTimer); mainDropNav.closeTimer = null } }, closeTime: function() { mainDropNav.closeTimer = window.setTimeout(mainDropNav.closeNav, mainDropNav.timeOut) }, closeNav: function() { $("primary_nav_home_drop").removeClass("open") } }; var utilityDropNav = { timeOut: 100, closeTimer: 0, init: function() { var a = $("master_container").getElements(".drop_nav"); a.addEvent("mouseover", utilityDropNav.openNav); a.addEvent("mouseout", utilityDropNav.closeTime) }, openNav: function() { var a = $("master_container").getElements(".drop_nav"); a.removeClass("open"); utilityDropNav.cancelCloseTime(); $(this.id).addClass("open") }, cancelCloseTime: function() { if (utilityDropNav.closeTimer) { window.clearTimeout(utilityDropNav.closeTimer); utilityDropNav.closeTimer = null } }, closeTime: function() { utilityDropNav.closeTimer = window.setTimeout(String.format('utilityDropNav.closeNav("{0}")', this.id), utilityDropNav.timeOut) }, closeNav: function(a) { $(a).removeClass("open") } }; window.addEvent("domready", utilityDropNav.init); var accountLoginPanel = { triggerdByEnter: false, show: function(c, b) { var a = $("account_login_panel"); a.setStyles({ top: b, left: c, display: "block" }) }, closePanel: function() { var a = $("account_login_panel"); a.setStyle("display", "none") }, hideLoginInfo: function() { document.getElementById("userid").disabled = true; document.getElementById("userpass").disabled = true; document.getElementById("rememberme").disabled = true; document.getElementById("useridLabel").style.color = "#a1b2c5"; document.getElementById("userid").style.backgroundColor = "#a1b2c5"; document.getElementById("userpass").style.backgroundColor = "#a1b2c5"; document.getElementById("passLabel").style.color = "#a1b2c5"; document.getElementById("rememberme").style.backgroundColor = "#a1b2c5"; document.getElementById("rememberLabel").style.color = "#a1b2c5" }, showLoginInfo: function() { document.getElementById("userid").disabled = false; document.getElementById("userpass").disabled = false; document.getElementById("rememberme").disabled = false; document.getElementById("useridLabel").style.color = "#ffffff"; document.getElementById("passLabel").style.color = "#ffffff"; document.getElementById("userid").style.backgroundColor = "#ffffff"; document.getElementById("userpass").style.backgroundColor = "#ffffff"; document.getElementById("rememberme").style.backgroundColor = "#ffffff"; document.getElementById("rememberLabel").style.color = "#ffffff" } }; var popLayer = { popLayerFade: null, popLayerContent: null, shim: null, center: false, shimYOffset: 0, shimXOffset: 0, show: function(popLayerContent) { var d = $(popLayer.popLayerFade); var a = $(popLayer.popLayerContent); var k = $(popLayer.shim); var g = window.getScrollSize(); var b = window.getSize(); a.setStyles({ display: "block", visibility: "hidden" }); var h = a.getSize(); d.setStyles({ opacity: 0.6, height: $("iefix").getScrollSize().y, display: "block" }); var e = (b.x / 2) - (h.x / 2); var c = ((b.y) / 2) - (h.y / 2); var i = /msie|MSIE 6/.test(navigator.userAgent); if (i) { a.setStyles({ top: c, left: e, visibility: 'visible' }); k.setStyles({ top: c + (popLayer.shimYOffset), left: e + (popLayer.shimXOffset), height: h.y - (popLayer.shimYOffset * 2), display: 'block' }) } else { a.setStyles({ top: c, left: e, visibility: "visible", position: "fixed", float: "left" }); k.setStyles({ top: c + (popLayer.shimYOffset), left: e + (popLayer.shimXOffset), height: h.y - (popLayer.shimYOffset * 2), display: "block", position: "fixed", float: "left" }) } }, hide: function() { var b = $(popLayer.popLayerFade); var a = $(popLayer.popLayerContent); var c = $(popLayer.shim); b.setStyle("display", "none"); a.setStyle("display", "none"); c.setStyle("display", "none") } }; var HoverRows = new Class({ initialize: function(a) { if ($(a) !== null) { this.tableID = a; this.arrRows = $(this.tableID).getElements("tr"); this.arrRows.addEvent("mouseover", this.toggleRow); this.arrRows.addEvent("mouseout", this.toggleRow) } }, toggleRow: function() { var a = this; if (a.hasClass("hover")) { a.removeClass("hover") } else { a.addClass("hover") } } }); var allPairsDropDown = { init: function() { $("all_pairs_drop_down_link").addEvent("click", allPairsDropDown.openNav); $("all_pairs_drop_down").addEvent("mouseenter", allPairsDropDown.openNav); $("all_pairs_drop_down").addEvent("mouseleave", allPairsDropDown.closeNav) }, openNav: function() { $("all_pairs_drop_down").addClass("open") }, closeNav: function() { $("all_pairs_drop_down").removeClass("open") } }; var HoverRows = new Class({ initialize: function(a) { if ($(a) !== null) { this.tableID = a; this.arrRows = $(this.tableID).getElements("tr"); this.arrRows.addEvent("mouseover", this.toggleRow); this.arrRows.addEvent("mouseout", this.toggleRow) } }, toggleRow: function() { var a = this; if (a.hasClass("hover")) { a.removeClass("hover") } else { a.addClass("hover") } } }); var TableRowsHighliter = new Class({ initialize: function(a) { var b = $(a).getElements("tr"); defaultChartRow = b[1]; defaultChartRow.addClass("active"); TableRowsHighliter.currChartRow = defaultChartRow; b.addEvent("mouseover", this.setHover); b.addEvent("mouseout", this.clearHover); b.addEvent("click", this.setActive) }, setHover: function() { if (!this.hasClass("headings")) { this.addClass("hover") } }, clearHover: function() { if (!this.hasClass("headings")) { this.removeClass("hover") } }, setActive: function() { if (!this.hasClass("headings")) { TableRowsHighliter.currChartRow.removeClass("active"); TableRowsHighliter.currChartRow = $(this.id); TableRowsHighliter.currChartRow.addClass("active") } } }); function clearText(a) { if (a.value == a.defaultValue) { a.value = "" } } function displayPhoneNumber() { var a = $("country"); var b = a.options[a.selectedIndex].value; $("phone_number_display").set("html", b) } function sms_providers(b, a) { if (b == "att") { document.getElementById(a).innerHTML = "1234567890@txt.att.net" } else { if (b == "metropcs") { document.getElementById(a).innerHTML = "1234567890@mymetropcs.com" } else { if (b == "nextel") { document.getElementById(a).innerHTML = "1234567890@mymetropcs.com" } else { if (b == "sprint") { document.getElementById(a).innerHTML = "1234567890@messaging.sprintpcs.com" } else { if (b == "tmobile") { document.getElementById(a).innerHTML = "1234567890@tmomail.net" } else { if (b == "verizon") { document.getElementById(a).innerHTML = "1234567890@vtext.com" } else { if (b == "virgin") { document.getElementById(a).innerHTML = "1234567890@vmobl.com" } else { if (b == "selected") { document.getElementById(a).innerHTML = "Select a Provider" } } } } } } } } } var quickdock = { defaultPanel: "panel_oco", currPanel: null, currLink: null, currState: null, currAnimating: false, animation: null, EditingOrder: null, initialized: false, panelLinkList: { panel_oco: "link_place_new_order", panel_place_limit_stop: "link_place_new_order", panel_transaction_update: "link_place_new_order", panel_ORDER_update: "link_place_new_order2", panel_market_order: "link_place_new_order", panel_orders: "link_orders", panel_positions: "link_positions", panel_account: "link_account", error_panel: "link_place_new_order" }, init: function() { quickdock.animation = new Fx.Tween("quickdock_content", { duration: 500, transition: "cubic:in:out" }); quickdock.animation.addEvent("doneAnimating", function() { quickdock.currAnimating = false }); quickdock.retrieveDockState(); if (quickdock.currPanel == null || quickdock.currPanel == "null") { quickdock.currPanel = quickdock.defaultPanel } if (quickdock.currState == "open") { var b = $(quickdock.currPanel); var c = $("quickdock_content"); b.setStyle("display", "block"); c.setStyle("height", "auto"); quickdock.currHeight = b.getSize().y; $("quickdock").addClass("open"); arrowIndicator = $("quickdock").getElement(".logo_container .arrow"); arrowIndicator.src = arrowIndicator.src.replace("_up.gif", "_down.gif"); quickdock.setCurrentLink() } var a = $("quickdock").getElement(".dock_nav"); a.addEvent("click", quickdock.toggleDock); if (Browser.Engine.trident4) { quickdock.ieResizeDock(); window.addEvent("resize", quickdock.ieResizeDock) } }, showPanel: function(a) { if (!quickdock.initialized) { a = "dock_transaction_initializing_ticket" } if (quickdock.currAnimating != true) { if (quickdock.currState != "open") { quickdock.currPanel = a; quickdock.openDock() } else { if (quickdock.currPanel != a) { quickdock.changePanel(a) } } } }, closeDock: function() { if (!quickdock.currAnimating) { arrowIndicator = $("quickdock").getElement(".logo_container .arrow"); quickdock.currAnimating = true; $("quickdock_content").setStyle("height", quickdock.currHeight); quickdock.animation.start("height", 0).chain(function() { $("quickdock").removeClass("open"); this.callChain() }, function() { arrowIndicator.src = arrowIndicator.src.replace("_down.gif", "_up.gif"); this.callChain() }, function() { quickdock.currState = "closed"; this.callChain() }, function() { this.fireEvent("doneAnimating") }) } }, openDock: function() { if (!quickdock.initialized) { return } if (!quickdock.currAnimating && quickdock.currState != "open") { var a = $("quickdock_content").getElements(".panel"); var c = $(quickdock.currPanel); a.setStyle("display", "none"); c.setStyle("display", "block"); var b = c.getSize().y; arrowIndicator = $("quickdock").getElement(".logo_container .arrow"); quickdock.currAnimating = true; $("quickdock").addClass("open"); arrowIndicator.src = arrowIndicator.src.replace("_up.gif", "_down.gif"); quickdock.animation.start("height", 0, b).chain(function() { quickdock.currHeight = b; $("quickdock_content").setStyle("height", "auto"); this.callChain() }, function() { quickdock.currState = "open"; this.callChain() }, function() { quickdock.setCurrentLink(); this.callChain() }, function() { this.fireEvent("doneAnimating") }) } }, toggleDock: function() { if (!quickdock.currAnimating) { if (quickdock.currState == "open") { quickdock.closeDock() } else { quickdock.openDock() } } }, changePanel: function(b) { if (!quickdock.initialized) { return } if (!quickdock.currAnimating) { var c = $(quickdock.currPanel); var a = $(b); quickdock.currAnimating = true; quickdock.animation.start("opacity", 0).chain(function() { c.setStyle("display", "none"); this.callChain() }, function() { a.setStyle("display", "block"); this.callChain() }, function() { $("quickdock_content").setStyle("height", quickdock.currHeight); this.callChain() }, function() { this.start("height", a.getSize().y) }, function() { this.start("opacity", 1); this.callChain() }, function() { quickdock.currHeight = a.getSize().y; $("quickdock_content").setStyle("height", "auto"); this.callChain() }, function() { quickdock.currPanel = b; this.callChain() }, function() { quickdock.setCurrentLink(); this.callChain() }, function() { this.fireEvent("doneAnimating") }) } }, setCurrentLink: function() { currLinkID = eval("quickdock.panelLinkList." + quickdock.currPanel); if (quickdock.currLink != null) { $(quickdock.currLink).removeClass("active") } if ($(currLinkID) !== null) { $(currLinkID).addClass("active"); quickdock.currLink = currLinkID } }, saveDockState: function() { Cookie.write("dockState", quickdock.currState); Cookie.write("dockPanel", quickdock.currPanel) }, retrieveDockState: function() { quickdock.currState = null; quickdock.currPanel = "dock_transaction_initializing_ticket" }, ieResizeDock: function() { windowWidth = $(iefix).getScrollSize().x; $("quickdock").setStyle("width", windowWidth) }, initOrderPanel: function() { aTradingManager.initEditOrder(); this.EditingOrder = aTradingManager.EditingOrder }, dockInitialized: function() { quickdock.initialized = true; quickdock.currPanel = "panel_ExecOrder"; if (quickdock.currState == "open") { quickdock.showPanel("panel_ExecOrder") } } }; window.addEvent("unload", quickdock.saveDockState); function Querystring(a) { this.params = new Object(); this.get = Querystring_get; if (a == null) { a = location.search.substring(1, location.search.length) } if (a.length == 0) { return } a = a.replace(/\+/g, " "); var c = a.split("&"); for (var d = 0; d < c.length; d++) { var e; var g = c[d].split("="); var b = unescape(g[0]); if (g.length == 2) { e = unescape(g[1]) } else { e = b } this.params[b] = e } } function Querystring_get(a, b) { if (b == null) { b = null } var c = this.params[a]; if (c == null) { c = b } return c } var expDays = 365; function SetCookie(c, e) { var a = SetCookie.arguments; var k = SetCookie.arguments.length; var b = (k > 2) ? a[2] : null; var h = (k > 3) ? a[3] : null; var d = (k > 4) ? a[4] : null; var g = (k > 5) ? a[5] : false; document.cookie = c + "=" + escape(e) + ((b == null) ? "" : ("; expires=" + b.toGMTString())) + ((h == null) ? "" : ("; path=" + h)) + ((d == null) ? "" : ("; domain=" + d)) + ((g == true) ? "; secure" : "") } function DeleteCookie(a) { var c = new Date(); c.setTime(c.getTime() - 1); var b = GetCookie(a); document.cookie = a + "=" + b + "; expires=" + c.toGMTString() } var exp = new Date(); exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000)); function amt() { var b = GetCookie("count"); if (b == null) { SetCookie("count", "1"); return 1 } else { var a = parseInt(b) + 1; DeleteCookie("count"); SetCookie("count", a, exp); return b } } function getCookieVal(b) { var a = document.cookie.indexOf(";", b); if (a == -1) { a = document.cookie.length } return unescape(document.cookie.substring(b, a)) } var qs = new Querystring(); var src = qs.get("src"); if (src != null) { SetCookie("adv", src, exp, "/", "development.local") } var aid = qs.get("adused"); if (aid != null) { SetCookie("aid", aid, exp) } var QuickPairs = new Class({ initialize: function(b, a, c) { this.maxPairs = (b == null) ? 6 : b; this.minPairs = (a == null) ? 1 : a; this.quickPairsChooser = $("quick_pairs_chooser"); this.arrCheckboxes = this.quickPairsChooser.getElements(".pairs_check"); this.arrQuickPairs = []; this.animation = new Fx.Tween(this.quickPairsChooser, { duration: 500, transition: Fx.Transitions.Quad.easeOut }); this.currAnimating = false; this.openHeight = $(c).getHeight() + 80; this.openState = false; this.parseCookie(); this.loadQuickPairs(); if ($("edit_quick_pairs_link")) { $("edit_quick_pairs_link").addEvent("click", this.toggleChooser.bind(this)) } $("quick_pairs_close_link").addEvent("click", this.toggleChooser.bind(this)); $("save_pairs").addEvent("click", this.saveCookie.bind(this)); this.arrCheckboxes.addEvent("click", this.togglePair.bind(this)) }, parseCookie: function() { var g = Cookie.read("quickpairs"); var e = ""; for (var d = 0, h = this.arrCheckboxes.length; d < h; d++) { this.arrCheckboxes[d].checked = false; if (g) { var b = g.split("|"); for (var c = 0; c < b.length; c++) { if (this.arrCheckboxes[d].id.replace("_check", "") == b[c].toLowerCase()) { e = e + b[c] + "|"; break } } } } if (e != "") { this.arrQuickPairs = e.split("|"); this.arrQuickPairs.erase("") } }, saveCookie: function() { var e = Ext.get("minMaxQuickPairMsg"); e.setVisible(false); if (this.arrQuickPairs.length > this.maxPairs) { e.update("Max pairs are restricted to 6."); e.setVisible(true, { duration: 0.5, scope: this, animType: "motion" }); return false } if (this.arrQuickPairs.length < this.minPairs) { e.update("You are required to have at least one pair."); e.setVisible(true, { duration: 0.5, scope: this, animType: "motion" }); return false } var l = ""; for (var g = 0, k = this.arrQuickPairs.length; g < k; g++) { l = l + this.arrQuickPairs[g] + "|" } var h = Cookie.read("quickpairs"); if (h) { var c = h.split("|"); for (var d = 0; d < c.length; d++) { if (l.indexOf(c[d].toLowerCase()) < 0) { this.hidePair(c[d].toLowerCase()) } } } l = l.substring(0, (l.length - 1)); if (l) { var c = l.split("|"); for (var d = 0; d < c.length; d++) { if (h.indexOf(c[d].toLowerCase()) < 0) { this.showPair(c[d].toLowerCase()) } } } userQuickPairSave(l); var b = Cookie.write("quickpairs", l, { duration: 14 }); Ext.get("save_success_message").setStyle("display", "inline"); Ext.get("save_pairs").setStyle("display", "none"); this.toggleChooser(); }, loadQuickPairs: function() { for (var a = 0, b = this.arrQuickPairs.length; a < b; a++) { var c = this.arrQuickPairs[a].toLowerCase(); this.showPair(c) } }, togglePair: function(b) { Ext.get("save_success_message").setStyle("display", "none"); Ext.get("save_pairs").setStyle("display", "inline"); var a = b.target; var d = a.id; var c = d.replace("_check", ""); if (a.checked) { this.arrQuickPairs.include(c.toLowerCase()) } else { this.arrQuickPairs.erase(c.toLowerCase()) } }, showPair: function(d) { var b = "link_" + d; var a = $(b); var c = $(d + "_check"); if (c) { if (a) { a.inject("quick_pair_links", "bottom"); a.setStyle("display", "block"); c.checked = true } } }, hidePair: function(d) { var b = "link_" + d; var a = $(b); var c = $(d + "_check"); if (a) { a.setStyle("display", "none"); c.checked = false } }, toggleChooser: function() { if (this.openState) { var e = Ext.get("minMaxQuickPairMsg"); e.setVisible(false); this.animation.start("height", 0).chain(function() { this.openState = false; this.animation.callChain() } .bind(this), function() { $("edit_quick_pairs_link").getParent().removeClass("open"); this.animation.callChain() } .bind(this)); } else { var b = Cookie.read("quickpairs"); if (this.arrCheckboxes && this.arrCheckboxes.length > 0) { this.arrQuickPairs = []; for (var a = 0; a < this.arrCheckboxes.length; a++) { if (b.indexOf(this.arrCheckboxes[a].id.replace("_check", "")) < 0) { this.arrCheckboxes[a].checked = false } else { this.arrCheckboxes[a].checked = true; this.arrQuickPairs[this.arrQuickPairs.length] = this.arrCheckboxes[a].id.replace("_check", ""); } } } this.animation.start("height", this.openHeight).chain(function() { this.openState = true } .bind(this)); $("edit_quick_pairs_link").getParent().addClass("open") } return false } }); var LinkedField = new Class({ initialize: function(a, b) { this.sourceFieldID = a; this.arrLinkedFields = b; this.source = $(this.sourceFieldID); this.source.addEvent("keyup", function(c) { this.updateLinkedFields(c.key) } .bind(this)); this.source.addEvent("valueChange", this.updateLinkedFields.bind(this, null)) }, updateLinkedFields: function(e) { if (e != "tab") { for (i = 0; i < this.arrLinkedFields.length; i++) { var linkedField = $(this.arrLinkedFields[i][0]); var calculation = this.arrLinkedFields[i][1]; var newLinkedFieldValue = eval(calculation); linkedField.value = newLinkedFieldValue } } } }); var SpinnerControl = new Class({ initialize: function(b, d, c, h, k, a, g) { this.fieldID = b; this.changeAmount = d; this.decimalPlaces = c; this.disabled = false; this.minValue = h; this.maxValue = k; this.defaultValue = a; this.field = $(this.fieldID); this.field.value = this.defaultValue; var e = $(this.field.id + '_spin_div'); if (e == null) { e = new Element("div"); } else { e.dispose(); e = new Element("div"); } e.set("id", this.field.id + "_spin_div"); e.set("class", "spinner_buttons"); this.upIMG = new Element("img"); this.upIMG.set("alt", "+"); this.upIMG.set("class", "spin_up"); this.upIMG.set("src", "/resources/images/buttons/btn_spinner_control_up_off.gif"); e.grab(this.upIMG); this.downIMG = new Element("img"); this.downIMG.set("alt", "-"); this.downIMG.set("class", "spin_down"); this.downIMG.set("src", "/resources/images/buttons/btn_spinner_control_down_off.gif"); e.grab(this.downIMG); e.inject(this.field, "after"); if (g == null) { g = true } if (g) { this.downIMG.addEvent("click", this.decrementValue.bind(this)); this.upIMG.addEvent("click", this.incrementValue.bind(this)) } }, incrementValue: function() { if (!this.disabled) { var a = this.field.value.toFloat() + this.changeAmount.toFloat(); if (this.maxValue == null || a <= this.maxValue) { if (this.decimalPlaces != null) { a = a.toFixed(this.decimalPlaces) } this.field.value = a; this.field.fireEvent("valueChange") } } }, decrementValue: function() { if (!this.disabled) { var a = this.field.value.toFloat() - this.changeAmount.toFloat(); if (this.minValue == null || a >= this.minValue) { if (this.decimalPlaces != null) { a = a.toFixed(this.decimalPlaces) } this.field.value = a; this.field.fireEvent("valueChange") } } } }); var Carousel = new Class({ initialize: function(a) { this.carouselID = a; this.carouselWindow = $(a).getElement(".carousel_window"); this.arrSlides = $(a).getElements(".carousel_item"); this.nextButton = $(a).getElement(".next_button a"); this.prevButton = $(a).getElement(".prev_button a"); this.currSlideNum = null; this.carouselWindowWidth = this.carouselWindow.getSize().x; this.arrSlides[0].setStyle("right", 0); this.arrSlides.set("morph", { duration: 900, transition: "cubic:in:out" }); this.currSlideNum = 0; this.nextButton.addEvent("click", this.goNext.bind(this)); this.prevButton.addEvent("click", this.goPrevious.bind(this)) }, goTo: function(a) { if (!this.Animating) { if (a > this.currSlideNum) { currEndPos = this.carouselWindowWidth; nextStartPos = (this.carouselWindowWidth * -1); if (a > (this.arrSlides.length - 1)) { a = 0 } } else { currEndPos = (this.carouselWindowWidth * -1); nextStartPos = this.carouselWindowWidth; if (a < 0) { a = (this.arrSlides.length - 1) } } this.arrSlides[a].setStyles({ right: nextStartPos, opacity: 0 }); this.arrSlides[this.currSlideNum].morph({ right: currEndPos, opacity: 0 }); this.arrSlides[a].morph({ right: 0, opacity: 1 }); this.currSlideNum = a } }, goNext: function() { slideNum = this.currSlideNum + 1; this.goTo(slideNum); return false }, goPrevious: function() { slideNum = this.currSlideNum - 1; this.goTo(slideNum); return false } }); var ContentToggle = new Class({ initialize: function(c, d) { this.toggleID = c; this.defaultContentLinkID = d; this.currContentLinkID = null; this.currAnimating = false; this.arrToggleLinks = $(this.toggleID).getElements(".toggle_link"); this.contentContainer = $(this.toggleID).getElement(".toggle_content_container"); this.animation = new Fx.Tween(this.contentContainer, { duration: 350, transition: Fx.Transitions.Quad.easeOut }); this.animation.addEvent("doneAnimating", function() { this.currAnimating = false } .bind(this)); if (this.defaultContentLinkID != null) { var a = $(this.defaultContentLinkID) } else { var a = this.arrToggleLinks[0] } var b = $(a.id + "_content"); a.getParent().addClass("active"); b.setStyle("display", "block"); this.currContentLinkID = a.id; this.arrToggleLinks.addEvent("click", this.clickChange.bind(this)) }, clickChange: function(b) { var c = null; var a = $(b.target); if (a.hasClass("toggle_link")) { c = a.id } else { c = a.getParent().id } this.change(c); return false }, change: function(d) { if (!this.currAnimating && this.currContentLinkID != d) { this.currAnimating = true; var c = $(d); var b = $(d + "_content"); var e = $(this.currContentLinkID); var a = $(this.currContentLinkID + "_content"); contentContainerRef = this.contentContainer; e.getParent().removeClass("active"); c.getParent().addClass("active"); this.animation.start("opacity", 0).chain(function() { contentContainerRef.setStyle("height", a.getSize().y); this.callChain() }, function() { a.setStyle("display", "none"); this.callChain() }, function() { b.setStyle("display", "block"); this.callChain() }, function() { this.start("height", b.getSize().y) }, function() { this.start("opacity", 1); this.callChain() }, function() { this.fireEvent("doneAnimating") }); this.currContentLinkID = d } } }); var imageZoom = { imgFullSize: null, imgThumb: null, zoomShadow: null, fullSizePath: null, animation: null, shadowAnimation: null, fadeAnimation: null, animating: false, thumbCoords: null, fullSizeCoords: null, fullSizeTopPos: null, fullSizeLeftPos: null, init: function() { imageZoom.imgFullSize = $("ZoomImage"); imageZoom.zoomShadow = $("ZoomShadow"); imageZoom.zoomFade = $("ZoomFade"); imageZoom.animation = new Fx.Morph(imageZoom.imgFullSize, { duration: 500, transition: Fx.Transitions.Quad.easeOut }); imageZoom.shadowAnimation = new Fx.Morph(imageZoom.zoomShadow, { duration: 500, transition: Fx.Transitions.Quad.easeOut }); imageZoom.fadeAnimation = new Fx.Morph(imageZoom.zoomFade, { duration: 500, transition: Fx.Transitions.Quad.easeOut }); imageZoom.animation.addEvent("start", function() { imageZoom.animating = true }); imageZoom.animation.addEvent("complete", function() { imageZoom.animating = false }); imageZoom.shadowAnimation.addEvent("start", function() { imageZoom.animating = true }); imageZoom.shadowAnimation.addEvent("complete", function() { imageZoom.animating = false }); imageZoom.fadeAnimation.addEvent("start", function() { imageZoom.animating = true }); imageZoom.fadeAnimation.addEvent("complete", function() { imageZoom.animating = false }); imageZoom.imgFullSize.addEvent("click", imageZoom.closeImage) }, zoom: function(a, b) { if (!imageZoom.animating) { imageZoom.imgThumb = $(a); imageZoom.fullSizePath = b; imageZoom.loadImage() } }, loadImage: function() { var a = new Asset.image(imageZoom.fullSizePath, { onload: imageZoom.showImage }) }, showImage: function() { var a = (Browser.Engine.trident4) ? $("iefix").getSize() : window.getSize(); var b = (Browser.Engine.trident4) ? $("iefix").getScroll() : window.getScroll(); imageZoom.imgFullSize.src = imageZoom.fullSizePath; imageZoom.thumbCoords = (Browser.Engine.trident4) ? imageZoom.imgThumb.getCoordinates("iefix") : imageZoom.imgThumb.getCoordinates(); imageZoom.fullSizeCoords = imageZoom.imgFullSize.getCoordinates(); imageZoom.fullSizeTopPos = (a.y / 2) - (imageZoom.fullSizeCoords.height / 2); imageZoom.fullSizeTopPos = (imageZoom.fullSizeTopPos < 30) ? 30 : imageZoom.fullSizeTopPos; imageZoom.fullSizeTopPos = imageZoom.fullSizeTopPos + b.y; imageZoom.fullSizeLeftPos = (a.x / 2) - (imageZoom.fullSizeCoords.width / 2); imageZoom.fullSizeLeftPos = (imageZoom.fullSizeLeftPos < 30) ? 30 : imageZoom.fullSizeLeftPos; imageZoom.imgFullSize.setStyles({ width: imageZoom.thumbCoords.width, height: imageZoom.thumbCoords.height, top: imageZoom.thumbCoords.top, left: imageZoom.thumbCoords.left, opacity: 0, visibility: "visible" }); imageZoom.animation.start({ height: imageZoom.fullSizeCoords.height, width: imageZoom.fullSizeCoords.width, top: imageZoom.fullSizeTopPos + 26, left: imageZoom.fullSizeLeftPos, opacity: 1 }).chain(imageZoom.showShadow); imageZoom.zoomFade.setStyles({ height: (Browser.Engine.trident4) ? $("iefix").getScrollSize().y : window.getScrollSize().y, width: a.x, opacity: 0, visibility: "visible" }) }, showShadow: function() { imageZoom.zoomShadow.setStyles({ height: imageZoom.fullSizeCoords.height + 54, width: imageZoom.fullSizeCoords.width + 54, top: imageZoom.fullSizeTopPos - 20, left: imageZoom.fullSizeLeftPos - 27, opacity: 0 }); $("ZoomShadowSpacer").setStyles({ height: imageZoom.fullSizeCoords.height, width: imageZoom.fullSizeCoords.width }); imageZoom.shadowAnimation.start({ opacity: 1 }); imageZoom.fadeAnimation.start({ opacity: 0.6 }) }, closeImage: function() { if (!imageZoom.animating) { imageZoom.zoomShadow.setStyle("opacity", 0); $("ZoomShadowSpacer").setStyles({ height: "", width: "" }); imageZoom.animation.start({ height: imageZoom.thumbCoords.height, width: imageZoom.thumbCoords.width, top: imageZoom.thumbCoords.top, left: imageZoom.thumbCoords.left, opacity: 0 }).chain(imageZoom.resetSize); imageZoom.fadeAnimation.start({ opacity: 0 }); imageZoom.thumbCoords = null, imageZoom.fullSizeCoords = null } }, resetSize: function() { imageZoom.imgFullSize.setStyles({ width: "", height: "", top: "-1000000px", left: "-1000000px" }) } }; var GuidedTourStep = new Class({ initialize: function(c, d, b, a) { this.tourStepID = c; this.tourStep = $(this.tourStepID); this.xPos = d; this.yPos = b; this.notchPos = a; this.animation = new Fx.Morph(this.tourStep, { duration: 300, transition: "cubic:in:out" }); if (this.notchPos == "right") { this.tourStep.addClass("right") } else if (this.notchPos == "none") { } else { this.tourStep.addClass("left") } this.tourStep.setStyles({ opacity: 0, top: this.yPos, left: this.xPos }) }, hide: function() { this.animation.start({ opacity: 0, top: this.yPos + 50 }); $("iframe_shim").setStyles({ top: -1000000, left: -1000000 }) }, show: function() { this.tourStep.setStyle("display", "block"); this.tourStep.setStyle("left", this.xPos); if (Browser.Engine.trident4) { $("iefix").scrollTo(0, (this.yPos - 150)) } else { window.scrollTo(0, (this.yPos - 150)) } this.animation.start({ opacity: 1, top: [this.yPos - 50, this.yPos] }); $("iframe_shim").setStyles({ top: this.yPos, left: this.xPos, height: this.tourStep.getSize().y - 4, width: this.tourStep.getSize().x - 4 }) } }); var GuidedTour = new Class({ initialize: function(a) { this.arrTourSteps = a; this.tourLength = this.arrTourSteps.length; this.currStepNum = null }, start: function() { this.arrTourSteps[0].show(); this.currStepNum = 0 }, end: function() { this.arrTourSteps[this.currStepNum].hide(); this.currStepNum = null }, nextStep: function() { if (this.currStepNum + 1 < this.tourLength) { var b = this.arrTourSteps[this.currStepNum]; var a = this.arrTourSteps[this.currStepNum + 1]; b.hide(); a.show(); this.currStepNum = this.currStepNum + 1 } }, previousStep: function() { if (this.currStepNum - 1 >= 0) { var b = this.arrTourSteps[this.currStepNum]; var a = this.arrTourSteps[this.currStepNum - 1]; b.hide(); a.show(); this.currStepNum = this.currStepNum - 1 } } }); Ext.namespace("GAIN"); GAIN.messageDealProcessing = "Deal request is processing."; GAIN.messageOrderProcessing = "Order request is processing."; GAIN.messageAnotherDealProcessing = "Another Deal request is processing. Please wait."; GAIN.messageAnotherOrderProcessing = "Another Order request is processing. Please wait."; GAIN.TrailingStopPipErrorMessage = "Pip specified in your trailling stop order is out of acceptable range"; GAIN.LABELS_ORDERRATE_OrderDefaultText = 'Order Rate'; GAIN.LABELS_ORDERRATE_TrailingStopText = 'Live Rate'; GAIN.TradingObject = function(d) { this.url = ""; this.refreshInterval = 1000; this.data = null; this.jsonPara = {}; this.status = { requesting: false, dataReady: false, init: false, repeatable: true, dataInit: false, enabled: true }; GAIN.TradingObject.superclass.constructor.call(this); Ext.apply(this, d); this.aConnection = new Ext.data.Connection(); this.addEvents({ dataInit: true, Updating: true, Loaded: true, LoadFailed: true }); function c(g, h) { var e; switch (h) { case "/UIService.asmx/GetUserRates3": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Bid":').replace(/\"C\":/g, '"Offer":'); case "/UIService.asmx/GetUserRates4": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Bid":').replace(/\"C\":/g, '"Offer":').replace(/\"D\":/g, '"ChangeInPoints":'); break; case "/UIService.asmx/GetUserRates3_3": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Bid":').replace(/\"C\":/g, '"Offer":').replace(/\"D\":/g, '"ClosingBid":').replace(/\"E\":/g, '"High":').replace(/\"F\":/g, '"Low":'); break; case "/UIService.asmx/GetUserRates5": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Bid":').replace(/\"D\":/g, '"ChangeInPoints":').replace(/\"E\":/g, '"High":').replace(/\"F\":/g, '"Low":'); break; case "/UIService.asmx/GetUserRates6": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Bid":').replace(/\"C\":/g, '"Offer":').replace(/\"D\":/g, '"ChangeInPoints":').replace(/\"E\":/g, '"High":').replace(/\"F\":/g, '"Low":').replace(/\"G\":/g, '"cPercent":'); break; case "/UIService.asmx/GetProductSettings2": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"IDecimals":'); break; case "/UIService.asmx/GetProductSettings3": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"IDecimals":').replace(/\"F\":/g, '"Notation":'); break; case "/UIService.asmx/GetProductSettings6": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"IDecimals":').replace(/\"C\":/g, '"MaxOrderLots":').replace(/\"D\":/g, '"OrderSize":').replace(/\"E\":/g, '"DefaultOrderLots":').replace(/\"F\":/g, '"Notation":').replace(/\"G\":/g, '"CounterProduct":').replace(/\"H\":/g, '"MarginFactor":').replace(/\"I\":/g, '"MaxOrderPips":').replace(/\"J\":/g, '"PipDifference":').replace(/\"K\":/g, '"DefaultTradeLots":').replace(/\"L\":/g, '"TradeSize":'); break; case "/UIService.asmx/GetMargins3": e = g.replace(/\"A\":/g, '"MarginBalance":').replace(/\"B\":/g, '"UnrealizedProfit":').replace(/\"C\":/g, '"RealizedProfit":').replace(/\"D\":/g, '"USDPostedMargin":').replace(/\"E\":/g, '"USDRealizedProfit":').replace(/\"F\":/g, '"PostedMargin":'); break; case "/UIService.asmx/GetPositions4": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Contract":').replace(/\"C\":/g, '"Unrealized":').replace(/\"D\":/g, '"AverageRate":').replace(/\"E\":/g, '"USDValue":'); break; case "/UIService.asmx/GetPositions8": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Contract":').replace(/\"C\":/g, '"Unrealized":').replace(/\"D\":/g, '"AverageRate":').replace(/\"E\":/g, '"USDValue":').replace(/\"F\":/g, '"LimitRate":').replace(/\"G\":/g, '"StopRate":').replace(/\"H\":/g, '"ProfitLoss":'); break; case "/UIService.asmx/GetProductDeals6": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Dealsequence":').replace(/\"C\":/g, '"Contract":').replace(/\"D\":/g, '"Rate":').replace(/\"E\":/g, '"BuySell":').replace(/\"F\":/g, '"Status":'); break; case "/UIService.asmx/GetOrders4": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Legs":').replace(/\"W\":/g, '"Amount":').replace(/\"X\":/g, '"Rate":').replace(/\"Y\":/g, '"Basis":').replace(/\"Z\":/g, '"BuySell":'); break; case "/UIService.asmx/GetOrdersC": e = g.replace(/\"A\":/g, '"Product":').replace(/\"B\":/g, '"Legs":').replace(/\"C\":/g, '"Type":').replace(/\"D\":/g, '"ReferenceNumber":').replace(/\"E\":/g, '"Expiry":').replace(/\"F\":/g, '"Assp":').replace(/\"G\":/g, '"TrailingPoints":').replace(/\"W\":/g, '"Amount":').replace(/\"X\":/g, '"Rate":').replace(/\"Y\":/g, '"Basis":').replace(/\"Z\":/g, '"BuySell":').replace(/\"T\":/g, '"Seq":').replace(/\"U\":/g, '"Status":').replace(/\"V\":/g, '"TSP":'); break; default: return g; break } return e } var b = function(e, g) { if (g || (this.status.enabled == true && (this.status.repeatable == true || this.status.dataInit != true) && !this.status.requesting)) { this.status.requesting = true; this.fireEvent("Updating"); this.aConnection.request({ url: this.url, method: "POST", headers: { "Content-Type": "application/json" }, scope: this, jsonData: this.jsonPara, callback: function(m, o, l) { this.status.requesting = false; if (o) { var h = c(l.responseText, this.url); var k = Ext.util.JSON.decode(h); if (k.d == null) { this.fireEvent("LoadFailed") } else { if (this.data != null && this.data.clear) { this.status.dataReady = false; this.data.clear(); var n = 0; for (n = 0; n < k.d.length; n++) { this.data.replace(k.d[n]) } this.status.dataReady = true } else { this.status.dataReady = false; this.data = k.d; this.status.dataReady = true } if (this.status.dataInit == false) { this.status.dataInit = true; this.fireEvent("dataInit") } this.fireEvent("Loaded") } } else { this.fireEvent("LoadFailed") } } }) } }; var a; this.init = function() { a = { run: b.createDelegate(this), interval: this.refreshInterval }; b.call(this); var e = new Ext.util.TaskRunner(); e.start(a); this.status.init = true }; this.requestData = b.createDelegate(this) }; Ext.extend(GAIN.TradingObject, Ext.util.Observable, {}); GAIN.CheckStatus = function(a) { GAIN.CheckStatus.superclass.constructor.call(this); Ext.apply(this, a); this.data = null; this.init() }; Ext.extend(GAIN.CheckStatus, GAIN.TradingObject, {}); GAIN.Rates = function(a) { GAIN.Rates.superclass.constructor.call(this); Ext.apply(this, a); this.data = new Ext.util.MixedCollection(false, function(b) { return b.Product }); this.init() }; Ext.extend(GAIN.Rates, GAIN.TradingObject, {}); GAIN.Positions = function(a) { GAIN.Positions.superclass.constructor.call(this); this.hasPLPip = false; this.hasUnRealizedPL = false; Ext.apply(this, a); this.data = new Ext.util.MixedCollection(false, function(b) { return b.Product }); this.init() }; Ext.extend(GAIN.Positions, GAIN.TradingObject, {}); GAIN.Deals = function(a) { GAIN.Deals.superclass.constructor.call(this); this.status.enabled = false; Ext.apply(this, a); this.data = new Ext.util.MixedCollection(false, function(b) { return b.Dealsequence }); this.init() }; Ext.extend(GAIN.Deals, GAIN.TradingObject, {}); GAIN.Margin = function(a) { GAIN.Margin.superclass.constructor.call(this); Ext.apply(this, a); this.data = null; this.init() }; Ext.extend(GAIN.Margin, GAIN.TradingObject, {}); GAIN.Orders = function(a) { GAIN.Orders.superclass.constructor.call(this); Ext.apply(this, a); this.data = new Ext.util.MixedCollection(false, function(b) { return b.ReferenceNumber }); this.init() }; Ext.extend(GAIN.Orders, GAIN.TradingObject, {}); GAIN.ProductSettings = function(a) { GAIN.ProductSettings.superclass.constructor.call(this); this.status.repeatable = false; Ext.apply(this, a); this.data = new Ext.util.MixedCollection(false, function(b) { return b.Product }); this.init() }; Ext.extend(GAIN.ProductSettings, GAIN.TradingObject, {}); GAIN.AccountSettings = function(a) { GAIN.AccountSettings.superclass.constructor.call(this); this.status.repeatable = false; Ext.apply(this, a); this.data = null; this.init() }; Ext.extend(GAIN.AccountSettings, GAIN.TradingObject, {}); GAIN.EconodayResearch = function(a) { GAIN.EconodayResearch.superclass.constructor.call(this); this.status.repeatable = false; Ext.apply(this, a); this.data = null; this.init() }; Ext.extend(GAIN.EconodayResearch, GAIN.TradingObject, {}); GAIN.DealData = function() { this.Dealsequence = ""; this.Product = ""; this.BuySell = ""; this.BankConfirmation = ""; this.DealDate = ""; this.Rate = ""; this.Contract = ""; this.Counter = ""; this.Reference = ""; this.Sequence = ""; this.Status = "" }; GAIN.OrderLegData = function() { this.BuySell = ""; this.Amount = ""; this.Basis = ""; this.Rate = ""; this.TPS = 0; this.Status = ""; this.Seq = 0; this.ConfirmationNumber = ""; this.Type = "" }; GAIN.OrderData = function() { this.Assp = ""; this.DealReference = ""; this.Expiry = ""; this.OrderDate = ""; this.Product = ""; this.ReferenceNumber = ""; this.TrailingPoints = ""; this.Type = ""; this.Legs = [] }; GAIN.Expires = { EOD: { text: "End of Day", value: "EOD" }, GTC: { text: "Good Till Cancelled", value: "GTC"} }; GAIN.BuySell = { B: { text: "Buy", value: "B" }, S: { text: "Sell", value: "S"} }; GAIN.BuySell = { T: { text: "Limit", value: "T" }, S: { text: "Stop", value: "S"} }; GAIN.OrderType = { MARKET_ORDER: { text: "Market", value: "MARKET_ORDER" }, SINGLE_ORDER: { text: "Single", value: "SINGLE_ORDER" }, SINGLE_ORDER_LIMIT: { text: 'Limit', value: 'SINGLE_ORDER_LIMIT' }, SINGLE_ORDER_STOP: { text: 'Stop', value: 'SINGLE_ORDER_STOP' }, OCO_ORDER: { text: "One Cancels Other", value: "OCO_ORDER" }, IF_THEN: { text: "If Then", value: "IF_THEN" }, IF_THEN_OCO: { text: "If Then OCO", value: "IF_THEN_OCO" }, TRAILINGSTOP: { text: "Trailing Stop", value: "TRAILINGSTOP" }, SINGLE_ASSP: { text: "Single", value: "SINGLE_ASSP" }, SINGLE_ASSP_LIMIT: { text: 'Limit', value: 'SINGLE_ASSP_LIMIT' }, SINGLE_ASSP_STOP: { text: 'Stop', value: 'SINGLE_ASSP_STOP' }, OCO_ASSP: { text: "One Cancels Other", value: "OCO_ASSP" }, TRAILINGSTOP_ASSP: { text: "Trailing Stop", value: "TRAILINGSTOP_ASSP"} }; GAIN.ActionType = { PLACE: "PLACE", MODIFY: "MODIFY", CANCEL: "CANCEL" }; GAIN.OrderDropDown = { PLACE_true: ["SINGLE_ASSP_LIMIT", "SINGLE_ASSP_STOP", "OCO_ASSP", "TRAILINGSTOP_ASSP"], PLACE_false: ["MARKET_ORDER", "SINGLE_ORDER_LIMIT", "SINGLE_ORDER_STOP", "OCO_ORDER", "IF_THEN", "IF_THEN_OCO", "TRAILINGSTOP"], MODIFY_true: ["SINGLE_ASSP_LIMIT", "SINGLE_ASSP_STOP", "OCO_ASSP", "TRAILINGSTOP_ASSP"], MODIFY_false: ["SINGLE_ORDER_LIMIT", "SINGLE_ORDER_STOP", "OCO_ORDER", "IF_THEN", "IF_THEN_OCO", "TRAILINGSTOP"], Cancel_true: ["SINGLE_ASSP_LIMIT", "SINGLE_ASSP_STOP", "OCO_ASSP", "TRAILINGSTOP_ASSP"], Cancel_false: ["SINGLE_ORDER_LIMIT", "SINGLE_ORDER_STOP", "OCO_ORDER", "IF_THEN", "IF_THEN_OCO", "TRAILINGSTOP"] }; GAIN.ORDERUI = { PLACE_false_SINGLE_ORDER: { orderlabel: { visible: true }, product: { visible: true, enable: true }, orderType: { visible: true, enable: true }, ASSP: { visible: false, enable: true }, Expiry: { visible: true, enable: true }, Legs: 1, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_false_SINGLE_ORDER_LIMIT: { orderlabel: { visible: true }, product: { visible: true, enable: true }, orderType: { visible: true, enable: true }, ASSP: { visible: false, enable: true }, Expiry: { visible: true, enable: true }, Legs: 1, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: false, value: 'T' }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_false_SINGLE_ORDER_STOP: { orderlabel: { visible: true }, product: { visible: true, enable: true }, orderType: { visible: true, enable: true }, ASSP: { visible: false, enable: true }, Expiry: { visible: true, enable: true }, Legs: 1, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: false, value: 'S' }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_false_MARKET_ORDER: { orderlabel: { visible: false }, product: { visible: true, enable: true }, orderType: { visible: true, enable: true }, ASSP: { visible: false, enable: false }, Expiry: { visible: false }, Legs: 1, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: false }, Rate: { visible: true, enable: false }, Pip: { visible: false, enable: false} }, PLACE_false_OCO_ORDER: { orderlabel: { visible: true }, product: { visible: true, enable: true }, orderType: { visible: true, enable: true }, ASSP: { visible: false, enable: true }, Expiry: { visible: true, enable: true }, Legs: 2, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_false_IF_THEN: { orderlabel: { visible: true }, product: { visible: true, enable: true }, orderType: { visible: true, enable: true }, ASSP: { visible: false, enable: true }, Expiry: { visible: true, enable: true }, Legs: 2, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_false_IF_THEN_OCO: { orderlabel: { visible: true }, product: { visible: true, enable: true }, orderType: { visible: true, enable: true }, ASSP: { visible: false, enable: true }, Expiry: { visible: true, enable: true }, Legs: 3, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_false_TRAILINGSTOP: { orderlabel: { visible: true }, product: { visible: true, enable: true }, orderType: { visible: true, enable: true }, ASSP: { visible: false, enable: true }, Expiry: { visible: true, enable: true }, Legs: 1, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: false, value: "S" }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: true} }, PLACE_true_SINGLE_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false, value: "GTC" }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_true_SINGLE_ASSP_LIMIT: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false, value: 'GTC' }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false, value: 'T' }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_true_SINGLE_ASSP_STOP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false, value: 'GTC' }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false, value: 'S' }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_true_OCO_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false, value: "GTC" }, Legs: 2, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, PLACE_true_TRAILINGSTOP_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false, value: "GTC" }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false, value: "S" }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: true} }, MODIFY_false_SINGLE_ORDER: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: false, enable: false }, Expiry: { visible: true, enable: true }, Legs: 1, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_false_SINGLE_ORDER_LIMIT: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: false, enable: false }, Expiry: { visible: true, enable: true }, Legs: 1, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: false, value: 'T' }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_false_SINGLE_ORDER_STOP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: false, enable: false }, Expiry: { visible: true, enable: true }, Legs: 1, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: false, value: 'S' }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_false_OCO_ORDER: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: false, enable: false }, Expiry: { visible: true, enable: true }, Legs: 2, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_false_IF_THEN: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: false, enable: false }, Expiry: { visible: true, enable: true }, Legs: 2, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_false_IF_THEN_OCO: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: false, enable: false }, Expiry: { visible: true, enable: true }, Legs: 3, BuySell: { visible: true, enable: true }, Contract: { visible: true, enable: true }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_true_SINGLE_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: true }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_true_SINGLE_ASSP_LIMIT: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false, value: 'T' }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_true_SINGLE_ASSP_STOP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false, value: 'S' }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_true_OCO_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 2, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: true }, Pip: { visible: true, enable: true} }, MODIFY_true_TRAILINGSTOP_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: true }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false, value: "GTC" }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false, value: "S" }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: true} }, CANCEL_false_SINGLE_ORDER: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_false_SINGLE_ORDER_LIMIT: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_false_SINGLE_ORDER_STOP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_false_OCO_ORDER: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 2, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_false_IF_THEN: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 2, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_false_IF_THEN_OCO: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 3, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_false_TRAILINGSTOP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_true_SINGLE_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_true_SINGLE_ASSP_LIMIT: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_true_SINGLE_ASSP_STOP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_true_OCO_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 2, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false} }, CANCEL_true_TRAILINGSTOP_ASSP: { orderlabel: { visible: true }, product: { visible: true, enable: false }, orderType: { visible: true, enable: false }, ASSP: { visible: true, enable: false }, Expiry: { visible: true, enable: false }, Legs: 1, BuySell: { visible: true, enable: false }, Contract: { visible: true, enable: false }, Basis: { visible: true, enable: false }, Rate: { visible: true, enable: false }, Pip: { visible: true, enable: false}} }; GAIN.Utility = {}; GAIN.Utility.populateDropDown = function(g, c, a) { g.options.length = 0; var b = 0; if (a != null) { if (c != null) { for (b = 0; b < a.length; b++) { try { g.options[b] = new Option(c[a[b]].text, a[b]) } catch (d) { } } } else { for (b = 0; b < a.length; b++) { try { g.options[b] = new Option(a[b], a[b]) } catch (d) { } } } } else { b = 0; for (key in c) { g.options[b] = new Option(c[key].text, c[key].value); b++ } } }; GAIN.Utility.setDropDownValue = function(c, b) { if (isNaN(b)) { if (b >= -1 && b < c.options.length) { c.selectedIndex = b } } else { var a; for (a = 0; a < c.options.length; a++) { if (c.options[a].value == b) { c.selectedIndex = a; break } } } }; GAIN.Utility.cutRateIn3Parts = function(e, b) { var a = e.indexOf("."); if (a == 0) { e = "0" + e; a++ } else { if (a == -1) { a = e.length; e = e + "." } } var d = b - (e.length - (a + 1)); for (var c = 0; c < d; c++) { e = e + "0" } if (b == 5 || b == 3) { return { first: e.substr(0, e.length - 3), second: e.substr(e.length - 3, 2), third: e.substr(e.length - 1, 1)} } else { return { first: e.substr(0, e.length - 2), second: e.substr(e.length - 2, 2), third: ""} } }; GAIN.TradingManager = function(A, d) { GAIN.TradingManager.superclass.constructor.call(this); this.addEvents({ RatesUpdating: true, PositionUpdating: true, OrderUpdating: true, MarginUpdating: true, AccountSettingUpdating: true, ProductSettingUpdating: true, RatesUpdated: true, PositionUpdated: true, OrderUpdated: true, MarginUpdated: true, AccountSettingUpdated: true, ProductSettingUpdated: true, RatesUpdateFailed: true, PositionUpdateFailed: true, OrderUpdateFailed: true, MarginUpdateFailed: true, AccountSettingUpdateFailed: true, ProductSettingUpdateFailed: true, DealUpdateFailed: true, EditOrder: true, Logout: true, NetworkFailure: true, Initialized: true }); this.defaultOrderPip = 30; this.defaultTrailingPip = 10; this.isPlacingDeal = false; this.isPlacingOrder = false; this.LoginStatus = false; this.NetworkFailureThrehold = 15; this.EditingOrder = null; var c = null; this.Rates = null; this.Positions = null; this.Margin = null; this.Orders = null; this.Deals = null; Ext.apply(this, A); var k = 0; this.LoginStatus = (d.LoginStatus) ? d.LoginStatus : this.LoginStatus; this.NetworkFailureThrehold = (d.NetworkFailureThrehold) ? d.NetworkFailureThrehold : this.NetworkFailureThrehold; function u() { k = 0 } this.isInitialized = function() { try { if (this.AccountSettingObject.status.enabled && !this.AccountSettingObject.status.dataInit) { return false } if (this.ProductSettingObject.status.enabled && !this.ProductSettingObject.status.dataInit) { return false } if (this.RateObject.status.enabled && (!this.RateObject.status.dataInit || this.Rates == null)) { return false } if (this.DealsObject.status.enabled && !this.DealsObject.status.dataInit) { return false } if (this.PositionsObject.status.enabled && (!this.PositionsObject.status.dataInit || this.Positions == null)) { return false } if (this.MarginObject.status.enabled && (!this.MarginObject.status.dataInit || this.Margin == null)) { return false } if (this.OrdersObject.status.enabled && (!this.OrdersObject.status.dataInit || this.Orders == null)) { return false } return true } catch (C) { return false } }; function t() { if (this.isInitialized()) { this.fireEvent("Initialized") } } var a = function() { if (this.RateObject.data.getcount == 0) { return } c = this.Rates; var H = (this.Rates == null); this.Rates = this.RateObject.data.clone(); if (H) { t.call(this) } if (c == null) { for (var E = 0; E < this.Rates.getCount; E++) { this.Rates.get(E).upDown = 0 } } else { for (var E = 0; E < this.Rates.getCount(); E++) { var D = this.Rates.getKey(this.Rates.get(E)); if (!c.get(D)) { this.Rates.get(E).upDown = 0 } else { var F = 0; try { var C = parseFloat(this.Rates.get(D).Bid) - parseFloat(c.get(D).Bid); if (isNaN(C)) { F = 0 } else { if (C > 0) { F = 1 } if (C == 0) { F = 0 } if (C < 0) { F = -1 } } } catch (G) { } this.Rates.get(E).upDown = F; F = 0; try { var C = parseFloat(this.Rates.get(D).Offer) - parseFloat(c.get(D).Offer); if (isNaN(C)) { F = 0 } else { if (C > 0) { F = 1 } if (C == 0) { F = 0 } if (C < 0) { F = -1 } } } catch (G) { } this.Rates.get(E).OfferupDown = F; try { if (this.Rates.get(D).ChangeInPoints) { this.Rates.get(D).ChangeInPip = this.getPipDifference(D, 0, this.Rates.get(D).ChangeInPoints) } } catch (G) { } } } } this.fireEvent("RatesUpdated"); v.call(this, false); o.call(this, false); return true }; var v = function(J) { if (this.PositionsObject.status.enabled == false && !J) { return false } var D; if (J) { D = this.PositionsObject.data.clone(); for (var F = 0; F < D.getCount(); F++) { D.get(F).Deals = [] } } else { if (this.Positions == null) { return false } else { D = this.Positions } } var C = this.Rates; for (var F = 0; F < D.getCount(); F++) { var I = D.get(F); try { var E = D.getKey(D.get(F)); if (C.get(E)) { I.LRate = C.get(E).Bid; I.upDown = C.get(E).upDown; if (this.PositionsObject.hasPLPip) { if (parseInt(I.Contract) > 0) { I.PLPip = this.getPipDifference(E, I.AverageRate, C.get(E).Bid) } else { I.PLPip = this.getPipDifference(E, C.get(E).Offer, I.AverageRate) } } } } catch (G) { } try { if (this.PositionsObject.hasUnRealizedPL) { this.getUnRealizedPnl(I) } } catch (G) { } } var H = (this.Positions == null); this.Positions = D; if (H) { t.call(this) } if (s.call(this, J) == false) { this.fireEvent("PositionUpdated") } l.call(this, false); return true }; var e = function() { if (!this.DealsObject.jsonPara.product || this.DealsObject.jsonPara.product == "") { return false } var G; G = this.DealsObject.data.clone(); var C = this.Rates; for (var E = 0; E < G.getCount(); E++) { try { var D = G.get(E).Product; if (C.get(D)) { G.get(E).LRate = C.get(D).Bid; G.get(E).upDown = C.get(D).upDown } } catch (H) { } } this.Deals = G; try { for (var E = 0; E < this.Positions.getCount(); E++) { this.Positions.get(E).Deals = [] } for (var E = 0; E < G.getCount(); E++) { var F = G.get(E).Product; this.Positions.get(F).Deals.push(G.get(E)) } } catch (H) { } this.fireEvent("PositionUpdated"); return true }; var s = function(H) { if (!this.DealsObject.jsonPara.product || this.DealsObject.jsonPara.product == null || this.DealsObject.jsonPara.product == "") { return false } if (!H) { var C = this.Rates; for (var F = 0; F < this.Positions.getCount(); F++) { if (this.Positions.get(F).Deals && this.Positions.get(F).Deals.length > 0) { var E = this.Positions.getKey(this.Positions.get(F)); if (C.get(E)) { try { for (var D; D < this.Positions.get(F).Deals.length; D++) { this.Positions.get(E).Deals[D].LRate = C.get(E).Bid; this.Positions.get(E).Deals[D].upDown = C.get(E).upDown } } catch (G) { } } } } this.fireEvent("PositionUpdated"); return true } else { this.DealsObject.requestData(1, true); return true } }; var l = function(C) { if (this.MarginObject.status.enabled == false) { return false } if (C) { var H = (this.Margin == null); this.Margin = this.MarginObject.data; if (H) { t.call(this) } } try { var M = this.Positions; var L = 0; var D = 0; var F = 0; var E = parseFloat(this.AccountSettingObject.data.BlowOutLevel); for (var G = 0; G < M.getCount(); G++) { L = L + parseFloat(M.get(G).Unrealized); D = D + M.get(G).UnrealizedinUSD; var K = this.ProductSettingObject.data.get(M.get(G).Product).MarginFactor; F = F + Math.abs(parseFloat(M.get(G).USDValue)) * K / 100 } this.Margin[0].UnrealizedProfit = L.toFixed(2); var I = parseFloat(this.Margin[0].USDPostedMargin) + parseFloat(this.Margin[0].USDRealizedProfit) + D; if (I > 0) { this.Margin[0].Meter = 100 * (1 - F * E / 100 / I) } else { this.Margin[0].Meter = 0 } } catch (J) { } this.fireEvent("MarginUpdated"); return true }; var o = function(C) { if (this.OrdersObject.status.enabled == false) { return false } var H; if (C) { H = this.OrdersObject.data.clone() } else { if (this.Orders == null) { return false } else { H = this.Orders } } var D = this.Rates; if (D != null) { for (var G = 0; G < H.getCount(); G++) { var F = H.get(G).Product; if (D.get(F)) { H.get(G).LRate = D.get(F).Bid; H.get(G).upDown = D.get(F).upDown; for (var E = 0; E < H.get(G).Legs.length; E++) { H.get(G).Legs[E].RDiff = this.getRateDifference(F, H.get(G).Legs[E].Rate, D.get(F).Bid) } } } } var I = (this.Orders == null); this.Orders = H; if (I) { t.call(this) } this.fireEvent("OrderUpdated"); return true }; function q() { this.fireEvent("AccountSettingUpdated") } function w() { this.fireEvent("ProductSettingUpdated") } function y() { this.CheckStatusObject.status.enabled = false; this.AccountSettingObject.status.enabled = false; this.ProductSettingObject.status.enabled = false; this.RateObject.status.enabled = false; this.DealsObject.status.enabled = false; this.PositionsObject.status.enabled = false; this.MarginObject.status.enabled = false; this.OrdersObject.status.enabled = false } function z(C) { if (C.indexOf("Failed" > -1)) { k++; if (k > this.NetworkFailureThrehold) { u(); this.fireEvent("NetworkFailure") } } this.fireEvent(C) } function r() { u(); if (this.LoginStatus == true && this.CheckStatusObject.data != true) { y.call(this); this.fireEvent("Logout") } } this.CheckStatusObject = new GAIN.CheckStatus({ url: "/UIService.asmx/GetStatus", refreshInterval: 30000 }); this.CheckStatusObject.addListener("Loaded", r.createDelegate(this)); this.CheckStatusObject.addListener("LoadFailed", z.createDelegate(this, ["CheckStatusUpdateFailed"])); var h = d.AccountSettings; if (!h) { h = { url: "/UIService.asmx/GetAccountSettings", refreshInterval: 2000, status: { requesting: false, dataReady: false, init: false, repeatable: false, dataInit: false, enabled: true}} } this.AccountSettingObject = new GAIN.AccountSettings(h); this.AccountSettingObject.addListener("dataInit", t.createDelegate(this)); this.AccountSettingObject.addListener("Loaded", q.createDelegate(this)); this.AccountSettingObject.addListener("Loaded", u); this.AccountSettingObject.addListener("Updating", z.createDelegate(this, ["AccountSettingUpdating"])); this.AccountSettingObject.addListener("LoadFailed", z.createDelegate(this, ["AccountSettingUpdateFailed"])); var n = d.ProductSettings; if (!n) { n = { url: "/UIService.asmx/GetProductSettings", refreshInterval: 2000, status: { requesting: false, dataReady: false, init: false, repeatable: false, dataInit: false, enabled: true}} } this.ProductSettingObject = new GAIN.ProductSettings(n); this.ProductSettingObject.addListener("dataInit", t.createDelegate(this)); this.ProductSettingObject.addListener("Loaded", w.createDelegate(this)); this.ProductSettingObject.addListener("Loaded", u); this.ProductSettingObject.addListener("Updating", z.createDelegate(this, ["ProductSettingUpdating"])); this.ProductSettingObject.addListener("LoadFailed", z.createDelegate(this, ["ProductSettingUpdateFailed"])); var p = d.Rates; if (!p) { p = { url: "/UIService.asmx/GetUserRates", refreshInterval: 2000} } this.RateObject = new GAIN.Rates(p); this.RateObject.addListener("dataInit", t.createDelegate(this)); this.RateObject.addListener("Loaded", a.createDelegate(this)); this.RateObject.addListener("Loaded", u); this.RateObject.addListener("Updating", z.createDelegate(this, ["RatesUpdating"])); this.RateObject.addListener("LoadFailed", z.createDelegate(this, ["RatesUpdateFailed"])); var m = d.Deals; if (!p) { m = { url: "/UIService.asmx/GetProductDeals", refreshInterval: 30000, status: { requesting: false, dataReady: false, init: false, repeatable: false, dataInit: false, enabled: false }, jsonPara: { product: ""}} } this.DealsObject = new GAIN.Deals(m); this.DealsObject.addListener("dataInit", t.createDelegate(this)); this.DealsObject.addListener("Loaded", e.createDelegate(this)); this.DealsObject.addListener("Loaded", u); this.DealsObject.addListener("LoadFailed", z.createDelegate(this, ["DealUpdateFailed"])); var b = d.Positions; if (!b) { b = { url: "/UIService.asmx/GetPositions", refreshInterval: 30000} } this.PositionsObject = new GAIN.Positions(b); this.PositionsObject.addListener("dataInit", t.createDelegate(this)); this.PositionsObject.addListener("Loaded", v.createDelegate(this, [true])); this.PositionsObject.addListener("Loaded", u); this.PositionsObject.addListener("Updating", z.createDelegate(this, ["PositionUpdating"])); this.PositionsObject.addListener("LoadFailed", z.createDelegate(this, ["PositionUpdateFailed"])); var B = d.Margin; if (!B) { B = { url: "/UIService.asmx/GetMargins", refreshInterval: 30000} } this.MarginObject = new GAIN.Margin(B); this.MarginObject.addListener("dataInit", t.createDelegate(this)); this.MarginObject.addListener("Loaded", l.createDelegate(this, [true])); this.MarginObject.addListener("Loaded", u); this.MarginObject.addListener("Updating", z.createDelegate(this, ["MarginUpdating"])); this.MarginObject.addListener("LoadFailed", z.createDelegate(this, ["MarginUpdateFailed"])); var x = d.Orders; if (!x) { x = { url: "/UIService.asmx/GetOrders", refreshInterval: 30000} } this.OrdersObject = new GAIN.Orders(x); this.OrdersObject.addListener("dataInit", t.createDelegate(this)); this.OrdersObject.addListener("Loaded", o.createDelegate(this, [true])); this.OrdersObject.addListener("Loaded", u); this.OrdersObject.addListener("Updating", z.createDelegate(this, ["OrderUpdating"])); this.OrdersObject.addListener("LoadFailed", z.createDelegate(this, ["OrderUpdateFailed"])); this.PlaceDeal = function(D, G, C, E) { if (!this.isPlacingDeal) { this.isPlacingDeal = true; var F = new Ext.data.Connection(); F.request({ url: "/UIService.asmx/PlaceDeal", method: "POST", headers: { "Content-Type": "application/json" }, scope: this, jsonData: { aType: D, aDeal: G, isClose: C }, callback: function(J, K, I) { var H = null; this.isPlacingDeal = false; if (K) { H = Ext.util.JSON.decode(I.responseText); this.PositionsObject.requestData(1, true); this.OrdersObject.requestData(1, true) } E(K, H) } }); return { success: true, message: GAIN.messageDealProcessing} } else { return { success: false, message: GAIN.messageAnotherDealProcessing} } }; this.PlaceOrder = function g(G, F, C) { if (!this.isPlacingOrder) { if (G != "CANCEL" && (F.Type == "TRAILINGSTOP" || F.Type == "TRAILINGSTOP_ASSP")) { var E = this.ProductSettingObject.data.get(F.Product); if (parseFloat(F.TrailingPoints) < E.PipDifference || parseFloat(F.TrailingPoints) > E.MaxOrderPips) { return { success: false, message: GAIN.TrailingStopPipErrorMessage + "(" + E.PipDifference + " - " + E.MaxOrderPips + " )"} } } this.isPlacingOrder = true; var D = new Ext.data.Connection(); D.request({ url: "/UIService.asmx/OrderRequest", method: "POST", headers: { "Content-Type": "application/json" }, scope: this, jsonData: { aAction: G, aOrder: F }, callback: function(J, K, I) { this.isPlacingOrder = false; var H = null; if (K) { H = Ext.util.JSON.decode(I.responseText); this.PositionsObject.requestData(1, true); this.OrdersObject.requestData(1, true) } C(K, H) } }); return { success: true, message: GAIN.messageOrderProcessing} } else { return { success: false, message: GAIN.messageAnotherOrderProcessing} } }; this.EditOrderInDock = function(D, E, M, K, F, L) { if (this.isPlacingDeal || this.isPlacingOrder) { return } var N = null; if (E == null && M == true) { var G; try { G = this.Positions.get(K) } catch (I) { } if (L) { N = 'OCO_ASSP' } else { if (G) { if (G.LimitRate != 0 || G.StopRate != 0) { D = "MODIFY"; var C = this.Orders; try { var H; for (H = 0; H < C.getCount(); H++) { if (C.get(H).Product == K && C.get(H).Assp == "True") { var J = C.get(H); E = J.ReferenceNumber; if (J.Type == "TRAILINGSTOP_ASSP") { D = "CANCEL"; N = "TRAILINGSTOP_ASSP"; break } if ((J.Type == "SINGLE_ASSP" || J.Type == 'SINGLE_ASSP_LIMIT' || J.Type == 'SINGLE_ASSP_STOP') && J.Legs[0].Basis != F) { N = "OCO_ASSP"; break } } } } catch (I) { } } else { N = 'OCO_ASSP'; } } else { N = 'OCO_ASSP'; } } } this.EditingOrder = { action: D, orderID: E, isASSP: M, product: K, LimitStop: F, OrderType: N }; this.fireEvent("EditOrder") }; this.updateDealListingPair = function(D) { this.DealsObject.jsonPara.product = D; if (D == "") { for (var C = 0; C < this.Positions.getCount(); C++) { this.Positions.get(C).Deals = [] } this.fireEvent("PositionUpdated") } else { this.DealsObject.requestData(1, true) } }; this.getOrderSpinnerInfoModify = function(F, E) { var H = this.Orders.get(F); var C = H.Type; /*if (newOrderType != null){C = newOrderType;}*/if (!H) { return null } var G = H.Legs[E]; if (!G) { G = {}; if (H.Type == "SINGLE_ASSP" || aOrder.Type == 'SINGLE_ASSP_LIMIT' || aOrder.Type == 'SINGLE_ASSP_STOP') { G.BuySell = H.Legs[0].BuySell; if (H.Legs[0].Basis == "T") { G.Basis = "S" } else { /*G.Basis = "T"*/ } G.Rate = null; G.TSP = 0; G.Amount = H.Legs[0].Amount; C = "OCO_ASSP" } else { return null } } var D = null; if (G.TSP != 0) { D = G.TSP } return this.getOrderSpinnerInfoNew(H.Product, G.BuySell, G.Basis, G.Rate, D, C, G.Amount, H.Legs[0].Rate, E) }; this.getOrderSpinnerInfoNew = function(E, U, P, I, F, K, R, H, L) { var T; var C; var D; var M; var J; var O; var N; var G = null; try { G = this.Positions.get(E) } catch (Q) { } var S = this.Rates.get(E); if (!S) { return null } N = this.getNoOfDemicalPlace(E); if (!N) { return null } T = 1 / Math.pow(10, N); switch (K) { case "MARKET_ORDER": if (U == "B") { return { BuySell: U, LimitStop: null, Rate: S.Offer, Pip: 0, increment: T, size: O, decimalPlaces: N} } else { return { BuySell: U, LimitStop: null, Rate: S.Bid, Pip: 0, increment: T, size: O, decimalPlaces: N} } break; case "SINGLE_ORDER": case "SINGLE_ORDER_STOP": case "SINGLE_ORDER_LIMIT": case "OCO_ORDER": C = I; M = P; J = U; if (J == "B") { if (I) { D = this.getPipDifference(E, S.Offer, I) } else { if (F) { D = F } else { if (P == "T") { D = this.defaultOrderPip * -1 } else { D = this.defaultOrderPip } } C = this.getRatePlusPip(E, S.Offer, D) } } else { if (I) { D = this.getPipDifference(E, S.Bid, I) } else { if (F) { D = F } else { if (P == "T") { D = this.defaultOrderPip } else { D = this.defaultOrderPip * -1 } } C = this.getRatePlusPip(E, S.Bid, D) } } if (R != null) { O = R.replace("-", "") } break; case "IF_THEN": case "IF_THEN_OCO": C = I; M = P; J = U; if (J == "B") { if (I) { if (L != 0) { D = this.getPipDifference(E, H, I) } else { D = this.getPipDifference(E, S.Offer, I) } } else { if (F) { D = F } else { if (P == "T") { D = this.defaultOrderPip * -1 } else { D = this.defaultOrderPip } } if (L != 0) { C = this.getRatePlusPip(E, H, D) } else { C = this.getRatePlusPip(E, S.Offer, D) } } } else { if (I) { if (L != 0) { D = this.getPipDifference(E, H, I) } else { D = this.getPipDifference(E, S.Bid, I) } } else { if (F) { D = F } else { if (P == "T") { D = this.defaultOrderPip } else { D = this.defaultOrderPip * -1 } } if (L != 0) { C = this.getRatePlusPip(E, H, D) } else { C = this.getRatePlusPip(E, S.Bid, D) } } } if (R != null) { O = R.replace("-", "") } break; case "SINGLE_ASSP": case "SINGLE_ASSP_STOP": case "SINGLE_ASSP_LIMIT": case "OCO_ASSP": if (!G) { return null } if (parseInt(G.Contract) >= 0) { J = "S" } else { J = "B" } C = I; M = P; O = Math.abs(G.Contract); if (J == "B") { if (I) { D = this.getPipDifference(E, G.AverageRate, I) } else { if (F) { D = F } else { if (P == "T") { D = this.defaultOrderPip * -1 } else { D = this.defaultOrderPip } } C = this.getRatePlusPip(E, G.AverageRate, D) } } else { if (I) { D = this.getPipDifference(E, G.AverageRate, I) } else { if (F) { D = F } else { if (P == "T") { D = this.defaultOrderPip } else { D = this.defaultOrderPip * -1 } } C = this.getRatePlusPip(E, G.AverageRate, D) } } break; case "TRAILINGSTOP_ASSP": if (!G) { return null } if (parseInt(G.Contract) >= 0) { J = "S" } else { J = "B" } M = "S"; O = Math.abs(G.Contract); if (F) { D = F } else { D = this.defaultTrailingPip } if (J == "B") { C = S.Offer } else { C = S.Bid } break; case "TRAILINGSTOP": J = U; M = P; O = R; if (J == "B") { C = S.Offer } else { C = S.Bid } if (F) { D = F } else { D = this.defaultTrailingPip } if (J == "B") { C = S.Offer } else { C = S.Bid } break; default: return null; break } return { BuySell: J, LimitStop: M, Rate: C, Pip: D, increment: T, size: O, decimalPlaces: N} }; this.getRateDifference = function(E, D, C) { var F = this.getNoOfDemicalPlace(E); if (F) { return (parseFloat(C) - parseFloat(D)).toFixed(F) } else { return null } }; this.getPipDifference = function(G, F, E) { var C = this.getNoOfDemicalPlace(G); if (C) { var D; if (C == 3 || C == 5) { D = C - 1 } else { D = C } return ((parseFloat(E) - parseFloat(F)) * Math.pow(10, D)).toFixed(1) } else { return null } }; this.getRatePlusPip = function(G, F, D) { var C = this.getNoOfDemicalPlace(G); if (C) { var E; if (C == 3 || C == 5) { E = C - 1 } else { E = C } return ((parseFloat(F) + D / Math.pow(10, E))).toFixed(C) } else { return null } }; this.getNoOfDemicalPlace = function(D) { var C = this.ProductSettingObject.data.get(D); if (C != null) { return C.IDecimals } else { return null } }; this.getRateIncrement = function(D) { var C = this.getNoOfDemicalPlace(D); if (C) { return 1 / Math.pow(10, C) } else { return null } }; this.getUnRealizedPnl = function(D) { var C = this.AccountSettingObject.data.BasePair; var E = (C == "USD/USD") ? "USD" : C.replace("USD", "").replace("/", ""); var F; var G = this.Rates; if (parseInt(D.Contract) > 0) { F = parseFloat(G.get(D.Product).Bid) - parseFloat(D.AverageRate) } else { F = parseFloat(G.get(D.Product).Offer) - parseFloat(D.AverageRate) } CurrencyPnL = parseInt(D.Contract) * F; var M = null; if (D.Product.substr(4, 3) == E) { M = CurrencyPnL } else { } var J; if (D.Product.substr(0, 3) == "USD") { if (CurrencyPnL > 0) { J = parseFloat(G.get(D.Product).Offer) } else { J = parseFloat(G.get(D.Product).Bid) } } var L; if (D.Product.substr(4, 3) == "USD") { L = CurrencyPnL } else { if (D.Product.substr(0, 3) == "USD") { L = CurrencyPnL / J } else { var H = this.ProductSettingObject.data.get(D.Product).CounterProduct; var I = this.ProductSettingObject.data.get(H).Notation; if (I == "E") { if (CurrencyPnL > 0) { L = CurrencyPnL / parseFloat(G.get(H).Offer) } else { L = CurrencyPnL / parseFloat(G.get(H).Bid) } } else { if (CurrencyPnL > 0) { L = CurrencyPnL * parseFloat(G.get(H).Bid) } else { L = CurrencyPnL * parseFloat(G.get(H).Offer) } } } } D.UnrealizedinUSD = L; if (M == null) { if (C != "USD/USD") { var K = this.ProductSettingObject.data.get(C).Notation; if (K == "E") { if (L < 0) { M = L * parseFloat(G.get(C).Offer) } else { M = L * parseFloat(G.get(C).Bid) } } else { if (L < 0) { M = L / parseFloat(G.get(C).Bid) } else { M = L / parseFloat(G.get(C).Offer) } } } else { M = L } } D.Unrealized = M.toFixed(2) }; this.initEditOrder = function() { var C = this.ProductSettingObject.data.get(0).Product; this.EditingOrder = { action: "PLACE", orderID: null, isASSP: false, product: C} } }; Ext.extend(GAIN.TradingManager, Ext.util.Observable, {});
var mobileDetect = { init: function() { this.userAgent = navigator.userAgent.toLowerCase(); }, isIphone: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent["iphone"].productFamily) == -1) ? false : true; return this.isBrowser; }, isIpod: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent["ipod"].productFamily) == -1) ? false : true; return this.isBrowser; }, isBlackberry: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent["blackberry"].productFamily) == -1) ? false : true; return this.isBrowser; }, isAndroid: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent["android"].productFamily) == -1) ? false : true; return this.isBrowser; }, isIemobile: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent["iemobile"].productFamily) == -1) ? false : true; return this.isBrowser; }, isPalmPre: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent["palm pre"].productFamily) == -1) ? false : true; return this.isBrowser; }, getMobileAgent: function() { var strMobile; for (property in this.mobileAgent) { if (this.userAgent.indexOf(this.mobileAgent[property].productFamily) != -1) { strMobile = property; if (this.mobileAgent[property].model) { var tempProp = property; for (property in this.mobileAgent[tempProp].model) { for (i = 0; i < this.mobileAgent[tempProp].model[property].length; i++) { if (this.userAgent.indexOf(this.mobileAgent[tempProp].model[property][i]) != -1) { strMobile += ", " + property; } } } } return strMobile; } } return null; }, mobileAgent: { "iphone": { "productFamily": "iphone" }, "ipod": { "productFamily": "ipod" }, "blackberry": { "productFamily": "blackberry", "model": { "tour": ["blackberry9630"], "storm": ["blackberry9500", "blackberry9530"], "bold": ["blackberry9000", "blackberry9100"], "88XX": ["blackberry8800", "blackberry8820", "blackberry8830"], "electron": ["blackberry8700", "blackberry8700c", "blackberry8700f", "blackberry8700g", "blackberry8700r", "blackberry8700v", "blackberry8703", "blackberry8703e", "blackberry8705g", "blackberry8707", "blackberry8707v"], "curve": ["blackberry8300", "blackberry8310", "blackberry8320", "blackberry8330", "blackberry8350i", "blackberry8900"], "pearl flip": ["blackberry8220", "blackberry8230"], "pearl": ["blackberry8100", "blackberry8110", "blackberry8120", "blackberry8130"]} }, "palm pre": { "productFamily": "pre/1.0" }, "android": { "productFamily": "android" }, "iemobile": { "productFamily": "iemobile"}} };
mobileDetect.init();if (mobileDetect.isIphone() || mobileDetect.isIpod() || mobileDetect.isAndroid() || mobileDetect.isPalmPre()) { window.location.href = "/mobile/Index.aspx"; } else if (mobileDetect.isBlackberry() || mobileDetect.isIemobile() || /midp/.test(mobileDetect.getMobileAgent())) { window.location.href = "http://wap.forex.com"; } var Pnl_State = 0; Ext.onReady(function() { addHandler("click", doOnDocumentClick) }); function doOnDocumentClick(e) { if (Pnl_State == 1) { e = e || event; var target = e.target || e.srcElement; var box = document.getElementById("account_login_panel"); do { if (box == target) { return } target = target.parentNode } while (target); if (accountLoginPanel.triggerdByEnter) { accountLoginPanel.triggerdByEnter = false; return false; } accountLoginPanel.closePanel(); Pnl_State = 0; } } function addHandler(eventName, handler) { if (window.addEventListener) { window.addEventListener(eventName, handler, false) } else { if (window.attachEvent) { $("master_body").addEvent("click", function() { doOnDocumentClick() }) } else { var origHandler = window["on" + eventName]; if (origHandler) { var h = new object(); h.origHandler = origHandler; h.newHandler = handler; h.both = new function(e) { this.origHandler(e); this.handler(e) }; window["on" + eventName] = h.both } else { window["on" + eventName] = handler } } } };function openWin() { window.open("https://secure.efxnow.com/NewOLS_FRXC_EN/agreement.aspx", "popWin", "status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0,width=568, height=500") } function numbersFilter(b, c) { var a = (b.which) ? b.which : event.keyCode; b = (b.target) ? b.target : b.srcElement; if (c && b.maxLength == b.value.length) { if (a == 8 || (a > 47 && a < 58)) { c.focus() } return false } if (a == 8 || (a > 47 && a < 58)) { return true } return false } var mobileDetect = { init: function() { this.userAgent = navigator.userAgent.toLowerCase() }, isIphone: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent.iphone.productFamily) == -1) ? false : true; return this.isBrowser }, isIpod: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent.ipod.productFamily) == -1) ? false : true; return this.isBrowser }, isBlackberry: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent.blackberry.productFamily) == -1) ? false : true; return this.isBrowser }, isAndroid: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent.android.productFamily) == -1) ? false : true; return this.isBrowser }, isIemobile: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent.iemobile.productFamily) == -1) ? false : true; return this.isBrowser }, isPalmPre: function() { this.isBrowser = (this.userAgent.indexOf(this.mobileAgent["palm pre"].productFamily) == -1) ? false : true; return this.isBrowser }, getMobileAgent: function() { var b; for (property in this.mobileAgent) { if (this.userAgent.indexOf(this.mobileAgent[property].productFamily) != -1) { b = property; if (this.mobileAgent[property].model) { var a = property; for (property in this.mobileAgent[a].model) { for (i = 0; i < this.mobileAgent[a].model[property].length; i++) { if (this.userAgent.indexOf(this.mobileAgent[a].model[property][i]) != -1) { b += ", " + property } } } } return b } } return null }, mobileAgent: { iphone: { productFamily: "iphone" }, ipod: { productFamily: "ipod" }, blackberry: { productFamily: "blackberry", model: { tour: ["blackberry9630"], storm: ["blackberry9500", "blackberry9530"], bold: ["blackberry9000", "blackberry9100"], "88XX": ["blackberry8800", "blackberry8820", "blackberry8830"], electron: ["blackberry8700", "blackberry8700c", "blackberry8700f", "blackberry8700g", "blackberry8700r", "blackberry8700v", "blackberry8703", "blackberry8703e", "blackberry8705g", "blackberry8707", "blackberry8707v"], curve: ["blackberry8300", "blackberry8310", "blackberry8320", "blackberry8330", "blackberry8350i", "blackberry8900"], "pearl flip": ["blackberry8220", "blackberry8230"], pearl: ["blackberry8100", "blackberry8110", "blackberry8120", "blackberry8130"]} }, "palm pre": { productFamily: "pre/1.0" }, android: { productFamily: "android" }, iemobile: { productFamily: "iemobile"}} }; mobileDetect.init(); var expDays = 365; var exp = new Date(); exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000)); function SetCookie(c, e) { var a = SetCookie.arguments; var h = SetCookie.arguments.length; var b = (h > 2) ? a[2] : null; var g = (h > 3) ? a[3] : null; var d = (h > 4) ? a[4] : null; var f = (h > 5) ? a[5] : false; document.cookie = c + "=" + escape(e) + ((b == null) ? "" : ("; expires=" + b.toGMTString())) + ((g == null) ? "" : ("; path=" + g)) + ((d == null) ? "" : ("; domain=" + d)) + ((f == true) ? "; secure" : "") } function DeleteCookie(a) { var c = new Date(); c.setTime(c.getTime() - 1); var b = GetCookie(a); document.cookie = a + "=" + b + "; expires=" + c.toGMTString() } function getCookieVal(b) { var a = document.cookie.indexOf(";", b); if (a == -1) { a = document.cookie.length } return unescape(document.cookie.substring(b, a)) } function GetCookie(d) { var b = d + "="; var f = b.length; var a = document.cookie.length; var e = 0; while (e < a) { var c = e + f; if (document.cookie.substring(e, c) == b) { return getCookieVal(c) } e = document.cookie.indexOf(" ", e) + 1; if (e == 0) { break } } return null } function getRootDomain(c) { var d = (c == null) ? location.href : c; var b = ""; if (d.indexOf("/", 7) < 1) { b = d } else { if ((d.indexOf("https://")) > -1) { b = d.substring(0, d.indexOf("/", 8)) } else { b = d.substring(0, d.indexOf("/", 7)) } } if (d.indexOf("localhost") == -1) { if (b.indexOf("http://") == 0) { b = b.substring(7) } if (b.indexOf("https://") == 0) { b = b.substring(8) } while (b.split(".").length > 2) { var a = b.indexOf(".", 1) + 1; b = b.substring(a) } return b } else { return b + d.substring(d.indexOf("/", 8), d.indexOf("/", d.indexOf("/", 8) + 1)) + "/" } } function setwsEntityHigh(a) { var b = getRootDomain(); SetCookie("wsEntity", a, exp, "/", b) } function setwsEntityLow(a) { if (!GetCookie("wsEntity")) { var b = getRootDomain(); SetCookie("wsEntity", a, exp, "/", b) } } function setwsLang(c) { if (document.getElementsByName("language_pref")[0] != null) { var b = { "Chinese Simplified": "zh-CN", "Chinese Traditional": "zh-TW", English: "en-US", "English US": "en-US", "English UK": "en-GB", Arabic: "ar", Russian: "ru-RU", Spanish: "es-ES", French: "fr-FR", German: "de-DE", Polish: "pl-PL", Japanese: "ja-JP", Portuguese: "pt", Hindi: "hi-IN", Urdu: "ur-PK", Greek: "el-GR", Mandarin: "zh-CN", Cantonese: "zh-TW" }; b.English = (c == "EU") ? "en-GB" : "en-US"; var a = (b[document.demo_account_form.language_pref.value]) ? (b[document.demo_account_form.language_pref.value]) : "en-US"; var d = getRootDomain(); SetCookie("wsLang", a, exp, "/", d) } } function getEntityByCountry(a) { switch (true) { case /Australia|Rep\. of South Africa|Belgium|Canada|Czech Republic|Denmark|Finland|France|Germany|Hungary|Italy|Netherlands|Norway|Portugal|Spain|Sweden|Switzerland|Georgia|Andorra|Austria|Brazil|Bulgaria|Croatia|Estonia|Greece|Iceland|Ireland|Israel|Lithuania|Luxembourg|Monaco|Poland|Romania|Slovakia|Albania|Antilles Netherland|Antigua \(WI\)|Arab Rep\. Egypt|Argentina|Armenia|Aruba|Azerbaijan|Bahamas|Bangladesh|Barbados|Belize|Benin|Bermuda|Bhutan|Bolivia|Bosnia\-Herzegovina|Botswana|British Virgin|Brunei Darussalam|Burkina Faso|Cambodia|Cameroon|Canary Islands|Cayman Islands|Central African|Chad|Chile|Colombia|Cook Islands|Costa Rica|Cyprus|Djibouti|Dominica|Dominican Republic|East Timor|Ecuador|El Salvador|Equatorial Guin|Ethiopia|Faroe Is.|Fiji|French Guiana|Gabon Republic|Gambia|Ghana|Gibraltar|Greenland|Grenada|Guadeloupe|Guatemala|^Guinea$|Guyana|Haiti|Honduras|India|Indonesia|Jamaica|Kazakhstan|Kenya|Kyrghyzstan|Laos|Latvia|Lesotho|Liechtenstein|Macau|Macedonia|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Martinique|Mauritania|Mauritius|Mexico|Moldova|Mongolia|Montenegro|Mozambique|Myanma\, Union Of|Namibia|Nauru|Nepal|New Caledonia|New Zealand|Nicaragua|^Niger$|Nigeria|Pakistan|Panama|Papua\-New Guinea|Paraguay|Peru|Philippines|Reunion Is.|Russia|Rwanda|Samoa \(Western\)|San Marino|Senegal|Serbia|Seychelles|Sierra Leone|Slovenia|Solomon Islands|Somalia|South Africa|Sri Lanka|St\. Kitts|St\. Lucia|St\. Pierre|St\. Vincent|Surinam|Swaziland|Tadjikistan|Tahiti|Tanzania|Thailand|Togo|Tonga|Trinidad|Tunisia|Turkey|Uganda|Ukraine|United Kingdom|Uruguay|Uzbekistan|Vanuatu|Vatican City|Venezuela|Vietnam|Zaire|Zambia/.test(a): return "EU"; break; case /Chinese Taipei|Taiwan ROC|Hong Kong|South Korea|China|Peoples Rep Korea|Singapore|United States|Lebanon|Algeria|Bahrain|Egypt|Jordan|Kuwait|Morocco|Oman|Qatar|Saudi Arabia|United Arab Emirates|Yemen/.test(a): return "NA"; break; case /Japan/.test(a): return "JP"; break; default: return "EU"; break } } var expDays = 365; function SetCookie(c, e) { var a = SetCookie.arguments; var h = SetCookie.arguments.length; var b = (h > 2) ? a[2] : null; var g = (h > 3) ? a[3] : null; var d = (h > 4) ? a[4] : null; var f = (h > 5) ? a[5] : false; document.cookie = c + "=" + escape(e) + ((b == null) ? "" : ("; expires=" + b.toGMTString())) + ((g == null) ? "" : ("; path=" + g)) + ((d == null) ? "" : ("; domain=" + d)) + ((f == true) ? "; secure" : "") } function DeleteCookie(a) { var c = new Date(); c.setTime(c.getTime() - 1); var b = GetCookie(a); document.cookie = a + "=" + b + "; expires=" + c.toGMTString() } var exp = new Date(); exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000)); function amt() { var b = GetCookie("count"); if (b == null) { SetCookie("count", "1"); return 1 } else { var a = parseInt(b) + 1; DeleteCookie("count"); SetCookie("count", a, exp); return b } } function getCookieVal(b) { var a = document.cookie.indexOf(";", b); if (a == -1) { a = document.cookie.length } return unescape(document.cookie.substring(b, a)) } function GetCookie(d) { var b = d + "="; var f = b.length; var a = document.cookie.length; var e = 0; while (e < a) { var c = e + f; if (document.cookie.substring(e, c) == b) { return getCookieVal(c) } e = document.cookie.indexOf(" ", e) + 1; if (e == 0) { break } } return null } function Querystring(a) { this.params = new Object(); this.get = Querystring_get; if (a == null) { a = location.search.substring(1, location.search.length) } if (a.length == 0) { return } a = a.replace(/\+/g, " "); var c = a.split("&"); for (var d = 0; d < c.length; d++) { var e; var f = c[d].split("="); var b = unescape(f[0]); if (f.length == 2) { e = unescape(f[1]) } else { e = b } this.params[b] = e } } function Querystring_get(a, b) { if (b == null) { b = null } var c = this.params[a]; if (c == null) { c = b } return c } function getRootDomain(c) { var d = (c == null) ? location.href : c; var b = ""; if (d.indexOf("/", 7) < 1) { b = d } else { if ((d.indexOf("https://")) > -1) { b = d.substring(0, d.indexOf("/", 8)) } else { b = d.substring(0, d.indexOf("/", 7)) } } if (d.indexOf("localhost") == -1) { if (b.indexOf("http://") == 0) { b = b.substring(7) } if (b.indexOf("https://") == 0) { b = b.substring(8) } while (b.split(".").length > 2) { var a = b.indexOf(".", 1) + 1; b = b.substring(a) } return b } else { return b + d.substring(d.indexOf("/", 8), d.indexOf("/", d.indexOf("/", 8) + 1)) + "/" } } function detectGeo(d) { var b = GetCookie("geo"); var a = new Querystring(); var c = a.get("redir"); if (c == "0") { SetCookie("redir", "0") } if (GetCookie("redir") != "0") { if (GetCookie("wsEntity") == "NA") { return } if (GetCookie("wsEntity") == "EU") { document.location = "http://www.forex.com/uk/" + d } if (GetCookie("wsEntity") == "JP") { document.location = "http://jp.forex.com/jp/" } switch (b) { case "GB": document.location = "http://www.forex.com/uk/" + d; break } } } function detectGeoDemo(d) { var c = GetCookie("geo"); var a = new Querystring(); var b = (a.get("v") == null) ? "" : "?v=" + a.get("v"); if (GetCookie("wsEntity") == "NA") { return } if (GetCookie("wsEntity") == "EU") { document.location = "http://www.forex.com/uk/" + d + b } if (GetCookie("wsEntity") == "JP") { document.location = "http://jp.forex.com/jp/services/forextrader_open_demo.shtml" } switch (true) { case /AL|AD|AG|AN|AR|AM|AW|AU|AT|AZ|BS|BD|BB|BE|BZ|BJ|BM|BT|BO|BA|BW|BR|VG|BN|BG|BF|KH|CM|CA|CV|KY|CF|TD|CL|CO|CK|CR|HR|CY|CZ|DK|DJ|DM|DO|TL|EC|SV|GQ|EE|ET|FO|FJ|FI|FR|GF|GB|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GT|GW|GY|HT|HN|HU|IS|IN|ID|IE|IL|IT|JM|KZ|KE|KG|LA|LV|LS|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MQ|MR|MU|MX|MD|MC|MN|ME|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NO|PK|PA|PG|PY|PE|PH|PL|PT|ZA|RE|RO|RU|RW|WS|SM|SN|RS|SC|SL|SK|SI|SB|SO|ZA|ES|LK|KN|LC|PM|VC|SR|SZ|SE|CH|TJ|TA|TZ|TH|TG|TO|TT|TN|TR|UG|UA|UY|UZ|VU|VA|VE|N|ZM|ZW/.test(c): document.location = "http://www.forex.com/uk/" + d + b; break } } function grabGeo() { var a = GetCookie("geo"); if (a == null) { document.write('<script type="text/javascript" src="https://secure.efxnow.com/zipproxy/keyfield.asp"><\/script>') } } function assignGeoDemo(c) { var a = GetCookie("geo"); if (typeof (cc) != "undefined") { if ((cc != "") && (a == null)) { var b = getRootDomain(); SetCookie("geo", cc, exp, "/", b) } } detectGeoDemo(c) } function assignGeo(c) { var a = GetCookie("geo"); if (typeof (cc) != "undefined") { if ((cc != "") && (a == null)) { var b = getRootDomain(); SetCookie("geo", cc, exp, "/", b) } } detectGeo(c) } function assignGeoDemoBeta() { var a = GetCookie("geo"); if (typeof (cc) != "undefined") { if ((cc != "") && (a == null)) { var b = getRootDomain(); SetCookie("geo", cc, exp, "/", b) } } detectGeoDemoBeta() } function detectGeoDemoBeta() { var b = GetCookie("geo"); var a = window.location.pathname; var c = a.substring(a.lastIndexOf("/") + 1) + location.search; if (GetCookie("wsEntity") == "NA") { return } if (GetCookie("wsEntity") == "EU") { document.location = "http://www.forex.com/uk/" + c } if (GetCookie("wsEntity") == "JP") { document.location = "http://jp.forex.com/jp/services/forextrader_open_demo.shtml" } switch (true) { case /AL|AD|AG|AN|AR|AM|AW|AU|AT|AZ|BS|BD|BB|BE|BZ|BJ|BM|BT|BO|BA|BW|BR|VG|BN|BG|BF|KH|CM|CA|CV|KY|CF|TD|CL|CO|CK|CR|HR|CY|CZ|DK|DJ|DM|DO|TL|EC|SV|GQ|EE|ET|FO|FJ|FI|FR|GF|GB|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GT|GW|GY|HT|HN|HU|IS|IN|ID|IE|IL|IT|JM|KZ|KE|KG|LA|LV|LS|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MQ|MR|MU|MX|MD|MC|MN|ME|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NO|PK|PA|PG|PY|PE|PH|PL|PT|ZA|RE|RO|RU|RW|WS|SM|SN|RS|SC|SL|SK|SI|SB|SO|ZA|ES|LK|KN|LC|PM|VC|SR|SZ|SE|CH|TJ|TA|TZ|TH|TG|TO|TT|TN|TR|UG|UA|UY|UZ|VU|VA|VE|N|ZM|ZW/.test(b): document.location = "http://www.forex.com/uk/" + c; break } } function Querystring(a) { this.params = new Object(); this.get = Querystring_get; if (a == null) { a = location.search.substring(1, location.search.length) } if (a.length == 0) { return } a = a.replace(/\+/g, " "); var c = a.split("&"); for (var d = 0; d < c.length; d++) { var e; var f = c[d].split("="); var b = unescape(f[0]); if (f.length == 2) { e = unescape(f[1]) } else { e = b } this.params[b] = e } } function Querystring_get(a, b) { if (b == null) { b = null } var c = this.params[a]; if (c == null) { c = b } return c } var expDays = 365; function SetCookie(c, e) { var a = SetCookie.arguments; var h = SetCookie.arguments.length; var b = (h > 2) ? a[2] : null; var g = (h > 3) ? a[3] : null; var d = (h > 4) ? a[4] : null; var f = (h > 5) ? a[5] : false; document.cookie = c + "=" + escape(e) + ((b == null) ? "" : ("; expires=" + b.toGMTString())) + ((g == null) ? "" : ("; path=" + g)) + ((d == null) ? "" : ("; domain=" + d)) + ((f == true) ? "; secure" : "") } function DeleteCookie(a) { var c = new Date(); c.setTime(c.getTime() - 1); var b = GetCookie(a); document.cookie = a + "=" + b + "; expires=" + c.toGMTString() } var exp = new Date(); exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000)); function amt() { var b = GetCookie("count"); if (b == null) { SetCookie("count", "1"); return 1 } else { var a = parseInt(b) + 1; DeleteCookie("count"); SetCookie("count", a, exp); return b } } function getCookieVal(b) { var a = document.cookie.indexOf(";", b); if (a == -1) { a = document.cookie.length } return unescape(document.cookie.substring(b, a)) } function getRootDomain(c) { var d = (c == null) ? location.href : c; var b = ""; if (d.indexOf("/", 7) < 1) { b = d } else { if ((d.indexOf("https://")) > -1) { b = d.substring(0, d.indexOf("/", 8)) } else { b = d.substring(0, d.indexOf("/", 7)) } } if (d.indexOf("localhost") == -1) { if (b.indexOf("http://") == 0) { b = b.substring(7) } if (b.indexOf("https://") == 0) { b = b.substring(8) } while (b.split(".").length > 2) { var a = b.indexOf(".", 1) + 1; b = b.substring(a) } return b } else { return b + d.substring(d.indexOf("/", 8), d.indexOf("/", d.indexOf("/", 8) + 1)) + "/" } } var qs = new Querystring(); var src = qs.get("src"); var rURL = getRootDomain(); if (src != null) { SetCookie("adv", src, exp, "/", rURL) } var aid = qs.get("adused"); if (aid != null) { SetCookie("aid", aid, exp, "/", rURL) } function openLandingHome() { window.open("index.html", "FOREXcom", "status=yes,toolbar=yes,directories=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=0,top=0,width=700, height=600") } function openLandingLearn() { window.open("/learn", "FOREXcom", "status=yes,toolbar=yes,directories=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=50,top=50,width=700, height=600") } function openLandingTrade() { window.open("trade.html", "FOREXcom", "status=yes,toolbar=yes,directories=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=50,top=50,width=700, height=600") } function openLandingResearch() { window.open("resources.html", "FOREXcom", "status=yes,toolbar=yes,directories=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=50,top=50,width=700, height=600") } function openLandingProducts() { window.open("products.html", "FOREXcom", "status=yes,toolbar=yes,directories=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=50,top=50,width=700, height=600") } function openLandingAbout() { window.open("about.html", "FOREXcom", "status=yes,toolbar=yes,directories=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=50,top=50,width=700, height=600") } function openLandingPrivacy() { window.open("privacy-policy.html", "FOREXcom", "status=yes,toolbar=yes,directories=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=0,top=0,width=700, height=600") };var expDays = 365; var exp = new Date(); exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000)); function SetCookie(name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape(value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "") } function DeleteCookie(name) { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval = GetCookie(name); document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString() } function getCookieVal(offset) { var endstr = document.cookie.indexOf(";", offset); if (endstr == -1) { endstr = document.cookie.length } return unescape(document.cookie.substring(offset, endstr)) } function GetCookie(name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) { return getCookieVal(j) } i = document.cookie.indexOf(" ", i) + 1; if (i == 0) { break } } return null } function getRootDomain(url) { var baseURL = (url == null) ? location.href : url; var rootURL = ""; if (baseURL.indexOf("/", 7) < 1) { rootURL = baseURL } else { if ((baseURL.indexOf("https://")) > -1) { rootURL = baseURL.substring(0, baseURL.indexOf("/", 8)) } else { rootURL = baseURL.substring(0, baseURL.indexOf("/", 7)) } } if (baseURL.indexOf("localhost") == -1) { if (rootURL.indexOf("http://") == 0) { rootURL = rootURL.substring(7) } if (rootURL.indexOf("https://") == 0) { rootURL = rootURL.substring(8) } while (rootURL.split(".").length > 2) { var index = rootURL.indexOf(".", 1) + 1; rootURL = rootURL.substring(index) } return rootURL } else { return rootURL + baseURL.substring(baseURL.indexOf("/", 8), baseURL.indexOf("/", baseURL.indexOf("/", 8) + 1)) + "/" } } function setwsEntityHigh(region) { var rURL = getRootDomain(); SetCookie("wsEntity", region, exp, "/", rURL) } function setwsEntityLow(region) { if (!GetCookie("wsEntity")) { var rURL = getRootDomain(); SetCookie("wsEntity", region, exp, "/", rURL) } } function setwsLang(region) { if (document.getElementsByName("language_pref")[0] != null) { var langCodes = { "Chinese Simplified": "zh-CN", "Chinese Traditional": "zh-TW", English: "en-US", "English US": "en-US", "English UK": "en-GB", Arabic: "ar", Russian: "ru-RU", Spanish: "es-ES", French: "fr-FR", German: "de-DE", Polish: "pl-PL", Japanese: "ja-JP", Portuguese: "pt", Hindi: "hi-IN", Urdu: "ur-PK", Greek: "el-GR", Mandarin: "zh-CN", Cantonese: "zh-TW" }; langCodes.English = (region == "EU") ? "en-GB" : "en-US"; var wslangCode = (langCodes[document.demo_account_form.language_pref.value]) ? (langCodes[document.demo_account_form.language_pref.value]) : "en-US"; var rURL = getRootDomain(); SetCookie("wsLang", wslangCode, exp, "/", rURL) } } function getEntityByCountry(country) { switch (true) { case /Australia|Rep\. of South Africa|Belgium|Canada|Czech Republic|Denmark|Finland|France|Germany|Hungary|Italy|Netherlands|Norway|Portugal|Spain|Sweden|Switzerland|Georgia|Andorra|Austria|Brazil|Bulgaria|Croatia|Estonia|Greece|Iceland|Ireland|Israel|Lithuania|Luxembourg|Monaco|Poland|Romania|Slovakia|Albania|Antilles Netherland|Antigua \(WI\)|Arab Rep\. Egypt|Argentina|Armenia|Aruba|Azerbaijan|Bahamas|Bangladesh|Barbados|Belize|Benin|Bermuda|Bhutan|Bolivia|Bosnia\-Herzegovina|Botswana|British Virgin|Brunei Darussalam|Burkina Faso|Cambodia|Cameroon|Canary Islands|Cayman Islands|Central African|Chad|Chile|Colombia|Cook Islands|Costa Rica|Cyprus|Djibouti|Dominica|Dominican Republic|East Timor|Ecuador|El Salvador|Equatorial Guin|Ethiopia|Faroe Is.|Fiji|French Guiana|Gabon Republic|Gambia|Ghana|Gibraltar|Greenland|Grenada|Guadeloupe|Guatemala|^Guinea$|Guyana|Haiti|Honduras|India|Indonesia|Jamaica|Kazakhstan|Kenya|Kyrghyzstan|Laos|Latvia|Lesotho|Liechtenstein|Macau|Macedonia|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Martinique|Mauritania|Mauritius|Mexico|Moldova|Mongolia|Montenegro|Mozambique|Myanma\, Union Of|Namibia|Nauru|Nepal|New Caledonia|New Zealand|Nicaragua|^Niger$|Nigeria|Pakistan|Panama|Papua\-New Guinea|Paraguay|Peru|Philippines|Reunion Is.|Russia|Rwanda|Samoa \(Western\)|San Marino|Senegal|Serbia|Seychelles|Sierra Leone|Slovenia|Solomon Islands|Somalia|South Africa|Sri Lanka|St\. Kitts|St\. Lucia|St\. Pierre|St\. Vincent|Surinam|Swaziland|Tadjikistan|Tahiti|Tanzania|Thailand|Togo|Tonga|Trinidad|Tunisia|Turkey|Uganda|Ukraine|United Kingdom|Uruguay|Uzbekistan|Vanuatu|Vatican City|Venezuela|Vietnam|Zaire|Zambia/.test(country): return "EU"; break; case /Chinese Taipei|Taiwan ROC|Hong Kong|South Korea|China|Peoples Rep Korea|Singapore|United States|Lebanon|Algeria|Bahrain|Egypt|Jordan|Kuwait|Morocco|Oman|Qatar|Saudi Arabia|United Arab Emirates|Yemen/.test(country): return "NA"; break; case /Japan/.test(country): return "JP"; break; case /^$/.test(country): break; default: return "EU"; break } };