/* Ext Js */
Ext={};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),isChrome=navigator.userAgent.toLowerCase().indexOf('chrome')>-1,isIE=ua.indexOf("msie")>-1,isIE7=ua.indexOf("msie 7")>-1,isIE8 = !isOpera && ua.indexOf("msie 8") > -1,isGecko=!isSafari&&ua.indexOf("gecko")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=false; 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]}};return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=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==Object.prototype.constructor){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,overrides);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(ov instanceof Array){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(a instanceof Array){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){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},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(as.dom){as.removeAllListeners();as.remove();continue}if(typeof as.purgeListeners=="function"){as.purgeListeners()}if(typeof as.destroy=="function"){as.destroy()}}}},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)},isOpera:isOpera,isSafari:isSafari,isChrome:isChrome,isIE:isIE,isIE6:isIE&&!isIE7&&!isIE8,isIE7:isIE7,isGecko:isGecko,isBorderBox:isBorderBox,isWindows:isWindows,isLinux:isLinux,isMac:isMac,useShims:((isIE&&!isIE7)||(isGecko&&isMac))})})();Ext.namespace("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===null||C===undefined||C===""){C=" "}while(A.length<B){A=C+A}return A},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};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)}}});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(){var E=self.innerHeight;var F=document.compatMode;if((F||Ext.isIE)&&!Ext.isOpera){E=(F=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return E},getViewportWidth:function(){var E=self.innerWidth;var F=document.compatMode;if(F||Ext.isIE){E=(F=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth}return E},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;G=Ext.getDom(G);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 P(Ext.lib.Event.getEvent(R))};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){this.initHeader("Content-Type","text/xml",false);K="POST";J=F.xmlData}}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",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.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&&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)},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(E instanceof Array){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){this.run(H,F,I,J,E,G,Ext.lib.Scroll)},motion:function(H,F,I,J,E,G){this.run(H,F,I,J,E,G,Ext.lib.Motion)},color:function(H,F,I,J,E,G){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&&!(O[0] instanceof Array)){O=[O]}else{var N=[];for(P=0,R=O.length;P<R;++P){N[P]=O[P]}O=N}Ext.fly(K).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 P="";if(!T.tag){T.tag="div"}P+="<"+T.tag;for(var O in T){if(O=="tag"||O=="children"||O=="cn"||O=="html"||typeof T[O]=="function"){continue}if(O=="style"){var S=T["style"];if(typeof S=="function"){S=S.call()}if(typeof S=="string"){P+=" style=\""+S+"\""}else{if(typeof S=="object"){P+=" style=\"";for(var R in S){if(typeof S[R]!="function"){P+=R+":"+S[R]+";"}}P+="\""}}}else{if(O=="cls"){P+=" class=\""+T["cls"]+"\""}else{if(O=="htmlFor"){P+=" for=\""+T["htmlFor"]+"\""}else{P+=" "+O+"=\""+T[O]+"\""}}}}if(F.test(T.tag)){P+="/>"}else{P+=">";var U=T.children||T.cn;if(U){if(U instanceof Array){for(var Q=0,N=U.length;Q<N;Q++){P+=A(U[Q],P)}}else{P+=A(U,P)}}if(T.html){P+=T.html}P+="</"+T.tag+">"}return P};var M=function(T,P){var S=document.createElement(T.tag||"div");var Q=S.setAttribute?true:false;for(var O in T){if(O=="tag"||O=="children"||O=="cn"||O=="html"||O=="style"||typeof T[O]=="function"){continue}if(O=="cls"){S.className=T["cls"]}else{if(Q){S.setAttribute(O,T[O])}else{S[O]=T[O]}}}Ext.DomHelper.applyStyles(S,T.style);var U=T.children||T.cn;if(U){if(U instanceof Array){for(var R=0,N=U.length;R<N;R++){M(U[R],S)}}else{M(U,S)}}if(T.html){S.innerHTML=T.html}if(P){P.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")},doInsert:function(Q,S,R,T,P){Q=Ext.getDom(Q);var O;if(this.useDom){O=M(S,null);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(A){if(A instanceof Array){A=A.join("")}else{if(arguments.length>1){A=Array.prototype.join.call(arguments,"")}}this.html=A};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(A){A=Ext.getDom(A);return new Ext.Template(A.value||A.innerHTML)};
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=(el instanceof Array);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)},"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(){var A=this.events[arguments[0].toLowerCase()];if(typeof A=="object"){return A.fire.apply(A,Array.prototype.slice.call(arguments,1))}else{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(A){if(!this.events){this.events={}}Ext.applyIf(this.events,A)},hasListener:function(A){var B=this.events[A];return typeof B=="object"&&B.listeners.length>0}};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(H,G,E){var I=E||{};G=G||this.obj;if(!this.isListening(H,G)){var D={fn:H,scope:G,options:I};var F=H;if(I.delay){F=A(F,I,G)}if(I.single){F=C(F,this,H,G)}if(I.buffer){F=B(F,I,G)}D.fireFn=F;if(!this.firing){this.listeners.push(D)}else{this.listeners=this.listeners.slice(0);this.listeners.push(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={wrap:function(U,E,D){return function(V){Ext.EventObject.setEvent(V);U.call(D?E||window:window,Ext.EventObject,E)}},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",function(){if(Ext.isIE){S.delay(50)}else{K.fire(N.getViewWidth(),N.getViewHeight())}})}K.addListener(U,E,D)},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.get(document.body);if(!B){return }var A=[Ext.isIE?"ext-ie":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.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):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)},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},calcOffsetsTo:function(el){el=Ext.get(el);var d=el.dom;var restorePos=false;if(el.getStyle("position")=="static"){el.position("relative");restorePos=true}var x=0,y=0;var op=this.dom;while(op&&op!=d&&op.tagName!="HTML"){x+=op.offsetLeft;y+=op.offsetTop;op=op.offsetParent}if(restorePos){el.position("static")}return[x,y]},scrollIntoView:function(container,hscroll){var c=Ext.getDom(container)||document.body;var el=this.dom;var o=this.calcOffsetsTo(c),l=o[0],t=o[1],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(t<ct){c.scrollTop=t}else{if(b>cb){c.scrollTop=b-ch}}if(hscroll!==false){if(l<cl){c.scrollLeft=l}else{if(r>cr){c.scrollLeft=r-c.clientWidth}}}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(className instanceof Array){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(className instanceof Array){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)},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;return contentHeight!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb")},getWidth:function(contentWidth){var w=this.dom.offsetWidth||0;return contentWidth!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr")},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)}},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")}}},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);var d=this.dom;if(!el.dom){throw"Element.alignTo with an element that doesn't exist"}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 me = this;return me.setXY(me.getAlignToXY(element, position, offsets),me.preanim && !!animate ? me.preanim(arguments, 3) : false);},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)},beginMeasure:function(){var el=this.dom;if(el.offsetWidth||el.offsetHeight){return this}var changed=[];var p=this.dom,b=document.body;while((!el.offsetWidth&&!el.offsetHeight)&&p&&p.tagName&&p!=b){var pe=Ext.get(p);if(pe.getStyle("display")=="none"){changed.push({el:p,visibility:pe.getStyle("visibility")});p.style.visibility="hidden";p.style.display="block"}p=p.parentNode}this._measureChanged=changed;return this},endMeasure:function(){var changed=this._measureChanged;if(changed){for(var i=0,len=changed.length;i<len;i++){var r=changed[i];r.el.style.visibility=r.visibility;r.el.style.display="none"}this._measureChanged=null}return this},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){el.parentNode.removeChild(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},load:function(){var um=this.getUpdateManager();um.update.apply(um,arguments);return this},getUpdateManager:function(){if(!this.updateManager){this.updateManager=new Ext.UpdateManager(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}}}return val},createProxy:function(config,renderTo,matchBox){if(renderTo){renderTo=Ext.getDom(renderTo)}else{renderTo=document.body}config=typeof config=="object"?config:{tag:"div",cls:config};var proxy=Ext.DomHelper.append(renderTo,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._mask){this._mask=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask"},true)}this.addClass("x-masked");this._mask.setDisplayed(true);if(typeof msg=="string"){if(!this._maskMsg){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.setHeight(this.getHeight())}return this._mask},unmask:function(removeEl){if(this._mask){if(removeEl===true){this._mask.remove();delete this._mask;if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg}}else{this._mask.setDisplayed(false);if(this._maskMsg){this._maskMsg.setDisplayed(false)}}}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(){if(this.dom.parentNode){this.dom.parentNode.removeChild(this.dom)}delete El.cache[this.dom.id]},addClassOnOver:function(className,preventFlicker){this.on("mouseover",function(){Ext.fly(this,"_internal").addClass(className)},this.dom);var removeFn=function(e){if(preventFlicker!==true||!e.within(this,true)){Ext.fly(this,"_internal").removeClass(className)}};this.on("mouseout",removeFn,this.dom);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.get(document);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(eventName instanceof Array){for(var i=0,len=eventName.length;i<len;i++){this.on(eventName[i],fn)}return this}this.on(eventName,fn);return this},fitToParentDelegate:Ext.emptyFn,fitToParent:function(monitorResize,targetParent){Ext.EventManager.removeResizeListener(this.fitToParentDelegate);this.fitToParentDelegate=Ext.emptyFn;if(monitorResize===true&&!this.dom.parentNode){return }var p=Ext.get(targetParent||this.dom.parentNode);this.setSize(p.getComputedWidth()-p.getFrameWidth("lr"),p.getComputedHeight()-p.getFrameWidth("tb"));if(monitorResize===true){this.fitToParentDelegate=this.fitToParent.createDelegate(this,[true,targetParent]);Ext.EventManager.onWindowResize(this.fitToParentDelegate)}return this},getNextSibling:function(){var n=this.dom.nextSibling;while(n&&n.nodeType!=1){n=n.nextSibling}return n},getPrevSibling:function(){var n=this.dom.previousSibling;while(n&&n.nodeType!=1){n=n.previousSibling}return n},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){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){where=where?where.toLowerCase():"before";el=el||{};var rt,refNode=where=="before"?this.dom:this.dom.nextSibling;if(typeof el=="object"&&!el.nodeType){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),where=="before"?this.dom:this.dom.nextSibling);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},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(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"||key instanceof Array){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"||x instanceof Array){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=window.pageXOffset||doc.documentElement.scrollLeft||doc.body.scrollLeft||0;var t=window.pageYOffset||doc.documentElement.scrollTop||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]).toString(16);if(h<16){h="0"+h}color+=h}}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]}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;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(el instanceof Array){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);El.Flyweight=function(dom){this.dom=dom};El.Flyweight.prototype=El.prototype;El._flyweights={};El.fly=function(el,named){named=named||"_global";el=Ext.getDom(el);if(!el){return null}if(!El._flyweights[named]){El._flyweights[named]=new El.Flyweight()}El._flyweights[named].dom=el;return El._flyweights[named]};Ext.get=El.get;Ext.fly=El.fly;var noBoxAdjust=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){noBoxAdjust["button"]=1}Ext.EventManager.on(window,"unload",function(){delete El.cache;delete El._flyweights})})();
Ext.enableFx=true;Ext.Fx={slideIn:function(a,c){var b=this.getFxEl();c=c||{};b.queueFx(c,function(){a=a||"t";this.fixDisplay();var d=this.getFxRestore();var i=this.getBox();this.setSize(i);var f=this.fxWrap(d.pos,c,"hidden");var k=this.dom.style;k.visibility="visible";k.position="absolute";var e=function(){b.fxUnwrap(f,d.pos,c);k.width=d.width;k.height=d.height;b.afterFx(c)};var j,l={to:[i.x,i.y]},h={to:i.width},g={to:i.height};switch(a.toLowerCase()){case"t":f.setSize(i.width,0);k.left=k.bottom="0";j={height:g};break;case"l":f.setSize(0,i.height);k.right=k.top="0";j={width:h};break;case"r":f.setSize(0,i.height);f.setX(i.right);k.left=k.top="0";j={width:h,points:l};break;case"b":f.setSize(i.width,0);f.setY(i.bottom);k.left=k.top="0";j={height:g,points:l};break;case"tl":f.setSize(0,0);k.right=k.bottom="0";j={width:h,height:g};break;case"bl":f.setSize(0,0);f.setY(i.y+i.height);k.right=k.top="0";j={width:h,height:g,points:l};break;case"br":f.setSize(0,0);f.setXY([i.right,i.bottom]);k.left=k.top="0";j={width:h,height:g,points:l};break;case"tr":f.setSize(0,0);f.setX(i.x+i.width);k.left=k.bottom="0";j={width:h,height:g,points:l};break}this.dom.style.visibility="visible";f.show();arguments.callee.anim=f.fxanim(j,c,"motion",0.5,"easeOut",e)});return this},slideOut:function(a,c){var b=this.getFxEl();c=c||{};b.queueFx(c,function(){a=a||"t";var i=this.getFxRestore();var d=this.getBox();this.setSize(d);var g=this.fxWrap(i.pos,c,"visible");var f=this.dom.style;f.visibility="visible";f.position="absolute";g.setSize(d);var j=function(){if(c.useDisplay){b.setDisplayed(false)}else{b.hide()}b.fxUnwrap(g,i.pos,c);f.width=i.width;f.height=i.height;b.afterFx(c)};var e,h={to:0};switch(a.toLowerCase()){case"t":f.left=f.bottom="0";e={height:h};break;case"l":f.right=f.top="0";e={width:h};break;case"r":f.left=f.top="0";e={width:h,points:{to:[d.right,d.y]}};break;case"b":f.left=f.top="0";e={height:h,points:{to:[d.x,d.bottom]}};break;case"tl":f.right=f.bottom="0";e={width:h,height:h};break;case"bl":f.right=f.top="0";e={width:h,height:h,points:{to:[d.x,d.bottom]}};break;case"br":f.left=f.top="0";e={width:h,height:h,points:{to:[d.x+d.width,d.bottom]}};break;case"tr":f.left=f.bottom="0";e={width:h,height:h,points:{to:[d.right,d.y]}};break}arguments.callee.anim=g.fxanim(e,c,"motion",0.5,"easeOut",j)});return this},puff:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){this.clearOpacity();this.show();var f=this.getFxRestore();var d=this.dom.style;var g=function(){if(b.useDisplay){a.setDisplayed(false)}else{a.hide()}a.clearOpacity();a.setPositioning(f.pos);d.width=f.width;d.height=f.height;d.fontSize="";a.afterFx(b)};var e=this.getWidth();var c=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(e*2)},height:{to:this.adjustHeight(c*2)},points:{by:[-(e*0.5),-(c*0.5)]},opacity:{to:0},fontSize:{to:200,unit:"%"}},b,"motion",0.5,"easeOut",g)});return this},switchOff:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){this.clearOpacity();this.clip();var d=this.getFxRestore();var c=this.dom.style;var e=function(){if(b.useDisplay){a.setDisplayed(false)}else{a.hide()}a.clearOpacity();a.setPositioning(d.pos);c.width=d.width;c.height=d.height;a.afterFx(b)};this.fxanim({opacity:{to:0.3}},null,null,0.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*0.5]}},b,"motion",0.3,"easeIn",e)}).defer(100,this)})});return this},highlight:function(a,c){var b=this.getFxEl();c=c||{};b.queueFx(c,function(){a=a||"ffff9c";var d=c.attr||"backgroundColor";this.clearOpacity();this.show();var g=this.getColor(d);var h=this.dom.style[d];var f=(c.endColor||g)||"ffffff";var i=function(){b.dom.style[d]=h;b.afterFx(c)};var e={};e[d]={from:a,to:f};arguments.callee.anim=this.fxanim(e,c,"color",1,"easeIn",i)});return this},frame:function(a,c,d){var b=this.getFxEl();d=d||{};b.queueFx(d,function(){a=a||"#C3DAF9";if(a.length==6){a="#"+a}c=c||1;var g=d.duration||1;this.show();var e=this.getBox();var f=function(){var h=Ext.getBody().createChild({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+a}});var i=Ext.isBorderBox?2:1;h.animate({top:{from:e.y,to:e.y-20},left:{from:e.x,to:e.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:e.height,to:(e.height+(20*i))},width:{from:e.width,to:(e.width+(20*i))}},g,function(){h.remove();if(--c>0){f()}else{b.afterFx(d)}})};f.call(this)});return this},pause:function(c){var a=this.getFxEl();var b={};a.queueFx(b,function(){setTimeout(function(){a.afterFx(b)},c*1000)});return this},fadeIn:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility="visible";var c=b.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:c}},b,null,0.5,"easeOut",function(){if(c==1){this.clearOpacity()}a.afterFx(b)})});return this},fadeOut:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){var c=b.endOpacity||0;arguments.callee.anim=this.fxanim({opacity:{to:c}},b,null,0.5,"easeOut",function(){if(c===0){if(this.visibilityMode==Ext.Element.DISPLAY||b.useDisplay){this.dom.style.display="none"}else{this.dom.style.visibility="hidden"}this.clearOpacity()}a.afterFx(b)})});return this},scale:function(a,b,c){this.shift(Ext.apply({},c,{width:a,height:b}));return this},shift:function(b){var a=this.getFxEl();b=b||{};a.queueFx(b,function(){var e={},d=b.width,f=b.height,c=b.x,i=b.y,g=b.opacity;if(d!==undefined){e.width={to:this.adjustWidth(d)}}if(f!==undefined){e.height={to:this.adjustHeight(f)}}if(b.left!==undefined){e.left={to:b.left}}if(b.top!==undefined){e.top={to:b.top}}if(b.right!==undefined){e.right={to:b.right}}if(b.bottom!==undefined){e.bottom={to:b.bottom}}if(c!==undefined||i!==undefined){e.points={to:[c!==undefined?c:this.getX(),i!==undefined?i:this.getY()]}}if(g!==undefined){e.opacity={to:g}}if(b.xy!==undefined){e.points={to:b.xy}}arguments.callee.anim=this.fxanim(e,b,"motion",0.35,"easeOut",function(){a.afterFx(b)})});return this},ghost:function(a,c){var b=this.getFxEl();c=c||{};b.queueFx(c,function(){a=a||"b";var i=this.getFxRestore();var e=this.getWidth(),g=this.getHeight();var f=this.dom.style;var k=function(){if(c.useDisplay){b.setDisplayed(false)}else{b.hide()}b.clearOpacity();b.setPositioning(i.pos);f.width=i.width;f.height=i.height;b.afterFx(c)};var d={opacity:{to:0},points:{}},j=d.points;switch(a.toLowerCase()){case"t":j.by=[0,-g];break;case"l":j.by=[-e,0];break;case"r":j.by=[e,0];break;case"b":j.by=[0,g];break;case"tl":j.by=[-e,-g];break;case"bl":j.by=[-e,g];break;case"br":j.by=[e,g];break;case"tr":j.by=[e,-g];break}arguments.callee.anim=this.fxanim(d,c,"motion",0.5,"easeOut",k)});return this},syncFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this},sequenceFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:false,stopFx:false});return this},nextFx:function(){var a=this.fxQueue[0];if(a){a.call(this)}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0]},stopFx:function(){if(this.hasActiveFx()){var a=this.fxQueue[0];if(a&&a.anim&&a.anim.isAnimated()){this.fxQueue=[a];a.anim.stop(true)}}return this},beforeFx:function(a){if(this.hasActiveFx()&&!a.concurrent){if(a.stopFx){this.stopFx();return true}return false}return true},hasFxBlock:function(){var a=this.fxQueue;return a&&a[0]&&a[0].block},queueFx:function(c,a){if(!this.fxQueue){this.fxQueue=[]}if(!this.hasFxBlock()){Ext.applyIf(c,this.fxDefaults);if(!c.concurrent){var b=this.beforeFx(c);a.block=c.block;this.fxQueue.push(a);if(b){this.nextFx()}}else{a.call(this)}}return this},fxWrap:function(f,d,c){var b;if(!d.wrap||!(b=Ext.get(d.wrap))){var a;if(d.fixPosition){a=this.getXY()}var e=document.createElement("div");e.style.visibility=c;b=Ext.get(this.dom.parentNode.insertBefore(e,this.dom));b.setPositioning(f);if(b.getStyle("position")=="static"){b.position("relative")}this.clearPositioning("auto");b.clip();b.dom.appendChild(this.dom);if(a){b.setXY(a)}}return b},fxUnwrap:function(a,c,b){this.clearPositioning();this.setPositioning(c);if(!b.wrap){a.dom.parentNode.insertBefore(this.dom,a.dom);a.remove()}},getFxRestore:function(){var a=this.dom.style;return{pos:this.getPositioning(),width:a.width,height:a.height}},afterFx:function(a){if(a.afterStyle){this.applyStyles(a.afterStyle)}if(a.afterCls){this.addClass(a.afterCls)}if(a.remove===true){this.remove()}Ext.callback(a.callback,a.scope,[this]);if(!a.concurrent){this.fxQueue.shift();this.nextFx()}},getFxEl:function(){return Ext.get(this.dom)},fxanim:function(d,e,b,f,c,a){b=b||"run";e=e||{};var g=Ext.lib.Anim[b](this.dom,d,(e.duration||f)||0.35,(e.easing||c)||"easeOut",function(){Ext.callback(a,this)},this);e.anim=g;return g}};Ext.Fx.resize=Ext.Fx.scale;Ext.apply(Ext.Element.prototype,Ext.Fx);
Ext.CompositeElement=function(A){this.elements=[];this.addElements(A)};Ext.CompositeElement.prototype={isComposite:true,addElements:function(E){if(!E){return this}if(typeof E=="string"){E=Ext.Element.selectorFunction(E)}var D=this.elements;var B=D.length-1;for(var C=0,A=E.length;C<A;C++){D[++B]=Ext.get(E[C])}return this},fill:function(A){this.elements=[];this.add(A);return this},filter:function(A){var B=[];this.each(function(C){if(C.is(A)){B[B.length]=C.dom}});this.fill(B);return this},invoke:function(E,B){var D=this.elements;for(var C=0,A=D.length;C<A;C++){Ext.Element.prototype[E].apply(D[C],B)}return this},add:function(A){if(typeof A=="string"){this.addElements(Ext.Element.selectorFunction(A))}else{if(A.length!==undefined){this.addElements(A)}else{this.addElements([A])}}return this},each:function(E,D){var C=this.elements;for(var B=0,A=C.length;B<A;B++){if(E.call(D||C[B],C[B],this,B)===false){break}}return this},item:function(A){return this.elements[A]||null},first:function(){return this.item(0)},last:function(){return this.item(this.elements.length-1)},getCount:function(){return this.elements.length},contains:function(A){return this.indexOf(A)!==-1},indexOf:function(A){return this.elements.indexOf(Ext.get(A))},removeElement:function(D,F){if(D instanceof Array){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){if(F){var E=this.elements[B];if(E.dom){E.remove()}else{E.parentNode.removeChild(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(E instanceof Array){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);E.parentNode.removeChild(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":true,"requestcomplete":true,"requestexception":true});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(E.params)}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: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"&&C)||E.xmlData){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(){document.body.removeChild(F)},100)}Ext.EventManager.on(F,"load",G,this);D.submit();if(L){for(var I=0,K=L.length;I<K;I++){D.removeChild(L[I])}}}});Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(A){return Ext.lib.Ajax.serializeForm(A)}});
Ext.UpdateManager=function(B,A){B=Ext.get(B);if(!A&&B.updateManager){return B.updateManager}this.el=B;this.defaultUrl=null;this.addEvents({"beforeupdate":true,"update":true,"failure":true});var C=Ext.UpdateManager.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.autoRefreshProcId=null;this.refreshDelegate=this.refresh.createDelegate(this);this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=this.formUpdate.createDelegate(this);this.successDelegate=this.processSuccess.createDelegate(this);this.failureDelegate=this.processFailure.createDelegate(this);if(!this.renderer){this.renderer=new Ext.UpdateManager.BasicRenderer()}Ext.UpdateManager.superclass.constructor.call(this)};Ext.extend(Ext.UpdateManager,Ext.util.Observable,{getEl:function(){return this.el},update:function(B,E,G,C){if(this.fireEvent("beforeupdate",this.el,B,E)!==false){var F=this.method,A;if(typeof B=="object"){A=B;B=A.url;E=E||A.params;G=G||A.callback;C=C||A.discardUrl;if(G&&A.scope){G=G.createDelegate(A.scope)}if(typeof A.method!="undefined"){F=A.method}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(!C){this.defaultUrl=B}if(typeof B=="function"){B=B.call(this)}F=F||(E?"POST":"GET");if(F=="GET"){B=this.prepareUrl(B)}var D=Ext.apply(A||{},{url:B,params:E,success:this.successDelegate,failure:this.failureDelegate,callback:undefined,timeout:(this.timeout*1000),argument:{"url":B,"form":null,"callback":G,"params":E}});this.transaction=Ext.Ajax.request(D)}},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.successDelegate,failure:this.failureDelegate,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)}},prepareUrl:function(B){if(this.disableCaching){var A="_dc="+(new Date().getTime());if(B.indexOf("?")!==-1){B+="&"+A}else{B+="?"+A}}return B},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(this.el,true,A)}},processFailure:function(A){this.transaction=null;this.fireEvent("failure",this.el,A);if(typeof A.argument.callback=="function"){A.argument.callback(this.el,false,A)}},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.UpdateManager.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Ext.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:"<div class=\"loading-indicator\">Loading...</div>"};Ext.UpdateManager.updateElement=function(D,C,E,B){var A=Ext.get(D,true).getUpdateManager();Ext.apply(A,B);A.update(C,E,B?B.callback:null)};Ext.UpdateManager.update=Ext.UpdateManager.updateElement;Ext.UpdateManager.BasicRenderer=function(){};Ext.UpdateManager.BasicRenderer.prototype={render:function(C,A,B,D){C.update(A.responseText,B.loadScripts,D)}};
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.getFormatCode=function(A){switch(A){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() % 12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(A)+"' + "}};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, o, z, v;\n"+"var d = new Date();\n"+"y = d.getFullYear();\n"+"m = d.getMonth();\n"+"d = d.getDate();\n"+"var results = input.match(Date.parseRegexes["+regexNum+"]);\n"+"if (results && results.length > 0) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;regex+=String.escape(ch)}else{var obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c}}}}code+="if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"+"{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"+"}return (v && (z || o))?\n"+"    ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n"+"        v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n"+";}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$");eval(code)};Date.formatCodeToRegex=function(B,A){switch(B){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":return{g:1,c:"d = parseInt(results["+A+"], 10);\n",s:"(\\d{1,2})"};case"d":return{g:1,c:"d = parseInt(results["+A+"], 10);\n",s:"(\\d{2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:0,c:null,s:"(?:\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+A+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+A+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":return{g:1,c:"m = parseInt(results["+A+"], 10) - 1;\n",s:"(\\d{1,2})"};case"m":return{g:1,c:"m = parseInt(results["+A+"], 10) - 1;\n",s:"(\\d{2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+A+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+A+"], 10);\n"+"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+A+"] == 'am') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+A+"] == 'AM') {\n"+"if (h == 12) { h = 0; }\n"+"} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":return{g:1,c:"h = parseInt(results["+A+"], 10);\n",s:"(\\d{1,2})"};case"h":case"H":return{g:1,c:"h = parseInt(results["+A+"], 10);\n",s:"(\\d{2})"};case"i":return{g:1,c:"i = parseInt(results["+A+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+A+"], 10);\n",s:"(\\d{2})"};case"O":return{g:1,c:["o = results[",A,"];\n","var sn = o.substring(0,1);\n","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n","var mn = o.substring(3,5) % 60;\n","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n","    (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"].join(""),s:"([+-]\\d{4})"};case"T":return{g:0,c:null,s:"[A-Z]{1,4}"};case"Z":return{g:1,c:"z = results["+A+"];\n"+"z = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",s:"([+-]?\\d{1,5})"};default:return{g:0,c:null,s:String.escape(B)}}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/,"$1")};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset()/60)),2,"0")+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=this.getDayOfYear()+(4-this.getDay());var A=new Date(this.getFullYear(),0,1);var C=(7-A.getDay()+4);return String.leftPad(((B-C)/7)+1,2,"0")};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.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.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};
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()}};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":true,"add":true,"replace":true,"remove":true,"sort":true});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||E instanceof Array){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)}},removeKey:function(A){return this.removeAt(this.indexOfKey(A))},getCount:function(){return this.length},indexOf:function(C){if(!this.items.indexOf){for(var B=0,A=this.items.length;B<A;B++){if(this.items[B]==C){return B}}return -1}else{return this.items.indexOf(C)}},indexOfKey:function(C){if(!this.keys.indexOf){for(var B=0,A=this.keys.length;B<A;B++){if(this.keys[B]==C){return B}}return -1}else{return this.keys.indexOf(C)}},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(B,A){if(!A.exec){A=String(A);if(A.length==0){return this.clone()}A=new RegExp("^"+Ext.escapeRe(A),"i")}return this.filterBy(function(C){return C&&A.test(C[B])})},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},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?true:false;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("")};var 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(o instanceof Array){return encodeArray(o)}else{if(o instanceof Date){return 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 typeof value!="undefined"?value:""},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")}return"$"+whole+sub},date:function(v,format){if(!v){return""}if(!(v instanceof Date)){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,"")}}}();
Ext.util.CSS=function(){var D=null;var C=document;var B=/(-[a-z])/gi;var A=function(E,F){return F.charAt(1).toUpperCase()};return{createStyleSheet:function(G,J){var F;var E=C.getElementsByTagName("head")[0];var I=C.createElement("style");I.setAttribute("type","text/css");if(J){I.setAttribute("id",J)}if(Ext.isIE){E.appendChild(I);F=I.styleSheet;F.cssText=G}else{try{I.appendChild(C.createTextNode(G))}catch(H){I.cssText=G}E.appendChild(I);F=I.styleSheet?I.styleSheet:(I.sheet||C.styleSheets[C.styleSheets.length-1])}this.cacheStyleSheet(F);return F},removeStyleSheet:function(F){var E=C.getElementById(F);if(E){E.parentNode.removeChild(E)}},swapStyleSheet:function(G,E){this.removeStyleSheet(G);var F=C.createElement("link");F.setAttribute("rel","stylesheet");F.setAttribute("type","text/css");F.setAttribute("id",G);F.setAttribute("href",E);C.getElementsByTagName("head")[0].appendChild(F)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(F){if(!D){D={}}try{var H=F.cssRules||F.rules;for(var E=H.length-1;E>=0;--E){D[H[E].selectorText]=H[E]}}catch(G){}},getRules:function(F){if(D==null||F){D={};var H=C.styleSheets;for(var G=0,E=H.length;G<E;G++){try{this.cacheStyleSheet(H[G])}catch(I){}}}return D},getRule:function(E,G){var F=this.getRules(G);if(!(E instanceof Array)){return F[E]}for(var H=0;H<E.length;H++){if(F[E[H]]){return F[E[H]]}}return null},updateRule:function(E,H,G){if(!(E instanceof Array)){var I=this.getRule(E);if(I){I.style[H.replace(B,A)]=G;return true}}else{for(var F=0;F<E.length;F++){if(this.updateRule(E[F],H,G)){return true}}}return false}}}();
Ext.util.ClickRepeater=function(B,A){this.el=Ext.get(B);this.el.unselectable();Ext.apply(this,A);this.addEvents({"mousedown":true,"click":true,"mouseup":true});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.get(document).on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this);this.fireEvent("click",this);this.timer=this.click.defer(this.delay||this.interval,this)},click:function(){this.fireEvent("click",this);this.timer=this.click.defer(this.getInterval(),this)},getInterval:function(){if(!this.accelerate){return this.interval}var A=this.mousedownTime.getElapsed();if(A<500){return 400}else{if(A<1700){return 320}else{if(A<2600){return 250}else{if(A<3500){return 180}else{if(A<4400){return 140}else{if(A<5300){return 80}else{if(A<6200){return 50}else{return 10}}}}}}}},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.get(document).un("mouseup",this.handleMouseUp);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this)}});
Ext.KeyNav=function(B,A){this.el=Ext.get(B);Ext.apply(this,A);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,prepareEvent:function(C){var A=C.getKey();var B=this.keyToHandler[A];if(Ext.isSafari&&B&&A>=37&&A<=40){C.stopEvent()}},relay:function(C){var A=C.getKey();var B=this.keyToHandler[A];if(B&&this[B]){if(this.doRelay(C,this[B],B)!==true){C[this.defaultEventAction]()}}},doRelay:function(C,B,A){return B.call(this.scope||this,C)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},enable:function(){if(this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isAir){this.el.on("keydown",this.relay,this)}else{this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this)}this.disabled=false}},disable:function(){if(!this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isAir){this.el.un("keydown",this.relay)}else{this.el.un("keydown",this.prepareEvent);this.el.un("keypress",this.relay)}this.disabled=true}}};
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(D instanceof Array){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,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=N instanceof Array;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"&&!(B instanceof Array)){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;
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(A instanceof Date){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=function(){C.superclass.constructor.apply(this,arguments)};Ext.extend(C,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(this.data[A]==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.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(){var A=this.modified;for(var B in A){if(typeof A[B]!="function"){this.data[B]=A[B]}}this.dirty=false;delete this.modified;this.editing=false;if(this.store){this.store.afterReject(this)}},commit:function(){this.dirty=false;delete this.modified;this.editing=false;if(this.store){this.store.afterCommit(this)}},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)}};
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.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:true,metachange:true,add:true,remove:true,update:true,clear:true,beforeload:true,load:true,loadexception:true});if(this.proxy){this.relayEvents(this.proxy,["loadexception"])}this.sortToggle={};Ext.data.Store.superclass.constructor.call(this);if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}};Ext.extend(Ext.data.Store,Ext.util.Observable,{remoteSort:false,pruneModifiedRecords:false,lastOptions:null,add:function(B){B=[].concat(B);for(var D=0,A=B.length;D<A;D++){B[D].join(this)}var C=this.data.length;this.data.addAll(B);this.fireEvent("add",this,B,C)},remove:function(A){var B=this.data.indexOf(A);this.data.removeAt(B);if(this.pruneModifiedRecords){this.modified.remove(A)}this.fireEvent("remove",this,A,B)},removeAll:function(){this.data.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)}},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 C=this.sortInfo,D=C.field;var A=this.fields.get(D).sortType;var B=function(F,E){var H=A(F.data[D]),G=A(E.data[D]);return H>G?1:(H<G?-1:0)};this.data.sort(C.direction,B);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(C.direction,B)}}},setDefaultSort:function(B,A){this.sortInfo={field:B,direction:A?A.toUpperCase():"ASC"}},sort:function(C,A){var B=this.fields.get(C);if(!A){if(this.sortInfo&&this.sortInfo.field==B.name){A=(this.sortToggle[B.name]||"ASC").toggle("ASC","DESC")}else{A=B.sortDir}}this.sortToggle[B.name]=A;this.sortInfo={field:B.name,direction:A};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this)}else{this.load(this.lastOptions)}},each:function(B,A){this.data.each(B,A)},getModifiedRecords:function(){return this.modified},createFilterFn:function(B,A,C){if(!A.exec){A=String(A);if(A.length==0){return false}A=new RegExp((C===true?"":"^")+Ext.escapeRe(A),"i")}return function(D){return A.test(D.data[B])}},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(C,B,D){var A=this.createFilterFn(C,B,D);return A?this.filterBy(A):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(C,B,D){var A=this.createFilterFn(C,B,D);return A?this.queryBy(A):this.data.clone()},queryBy:function(B,A){var C=this.snapshot||this.data;return C.filterBy(B,A||this)},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.snapshot&&this.snapshot!=this.data){this.data=this.snapshot;delete this.snapshot;if(A!==true){this.fireEvent("datachanged",this)}}},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)}});
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(G instanceof Date){return G}if(A){if(A=="timestamp"){return new Date(G*1000)}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=B instanceof Array?Ext.data.Record.create(B):B};Ext.data.DataReader.prototype={};
Ext.data.DataProxy=function(){this.addEvents({beforeload:true,load:true,loadexception:true});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"}}if(o.metaData){delete this.ef;this.meta=o.metaData;this.recordType=Ext.data.Record.create(o.metaData.fields);this.onMetaChange(this.meta,this.recordType,o)}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;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)}var C=new A(B,J);C.json=L;P[O]=C}return{success:D,records:P,totalRecords:I}}});
Ext.data.ArrayReader=function(A,B){Ext.data.ArrayReader.superclass.constructor.call(this,A,B)};Ext.extend(Ext.data.ArrayReader,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);O[L.name]=N}var J=new G(O,A);J.json=D;E[E.length]=J}return{records:E,totalRecords:E.length}}});

/* define */
var HISTORY_TYPE_FRIEND = 0;
var HISTORY_TYPE_GROUP = 1;
var HISTORY_TYPE_REPLY = 2;

var HISTORY_FRIEND_INVITE = 0;
var HISTORY_FRIEND_ACCEPT = 1;
var HISTORY_FRIEND_REJECT = 2;
var HISTORY_FRIEND_DELETE = 3;

var HISTORY_GROUP_INVITE = 0;
var HISTORY_GROUP_ACCEPT = 1;
var HISTORY_GROUP_REJECT = 2;
var HISTORY_GROUP_BANNED = 3;

var HISTORY_REPLY_REPLY = 0;
var HISTORY_REPLY_REPLYREPLY = 1;

var ITEM_CLASS_MESSAGE = 5;

var CATEGORY_MESSAGE = 501;

var INVITE_TYPE_FRIEND_URL = 0;
var INVITE_TYPE_FRIEND_EMAIL = 1;
var INVITE_TYPE_GROUP_URL = 2;
var INVITE_TYPE_GROUP_EMAIL = 3;
var INVITE_TYPE_FRIEND_PHONE = 4;

var CONTENTS_NOTAGREE = 0;
var CONTENTS_AGREE = 1;
var CONTENTS_DISAGREE = 2;

/* String.js */
String.prototype.checkFormat={email :{reg :/^[_\da-z-]+(:?\.[_\da-z-]+)*@[\da-z-]+(:?\.[\da-z-]+)*$/,min : 4,max : 80},password :{reg :/(?:^[_0-9a-zA-Z-]+$)/,min : 4,max : 12},name :{reg :/(?:[^'"]+$)/,min : 2,max : 20},categoryName :{reg :/(?:[^'"]+$)/,min : 1,max : 6},domain :{reg :/(?:^[0-9a-zA-Z-]+$)/,min : 4,max : 20}};

String.prototype.check=function(type){var fm=this.checkFormat[type];if(fm.reg){var result=this.match(fm.reg);if(!result||result[0]!=this)return false;}if(typeof fm.max!="undefined"&&fm.max<this.length)return false;if(typeof fm.min!="undefined"&&this.length<fm.min)return false;return true;};String.prototype.getByte=function(){var i;var strLen;var strByte;strLen=this.length;for(i=0,strByte=0;i<strLen;i++){if(this.charAt(i)>=' '&&this.charAt(i)<='~')strByte++;else strByte+=2;}return strByte;};String.prototype.replaceUrl=function(){if(this.search('http://')==-1)return "http://".concat(this);else return this;}

String.prototype.ltrim = function()
{
	var trimRe = /^\s*(.*)\s*$/;
	return this.replace(trimRe, "$1");
};

String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}

String.prototype.trim = function()
{
 return this.replace(/(^\s*)|(\s*$)/gi, "");
};

String.prototype.stripTags = function(allowableTags){
	var regExp = (allowableTags && allowableTags.length != 0)?"<\\/?(?!("+allowableTags.join('|')+"))\\b[^>]*>":"<\/?[^>]*>";

	return this.replace(new RegExp(regExp, "gi"), "");
}

String.prototype.ellipsis = function(maxLength, mark){
		var strByte = 0;

		for(var i=0; i < this.length; i++)
		{
			if(this.charAt(i) >= ' ' && this.charAt(i) <= '~' )
			strByte++;
			else
			strByte += 2;

			if(strByte >= maxLength)
			return this.substr(0, i) + (mark ? mark : "...");
		}

    return this;
};

String.prototype.replaceLink = function ()
{
	if(this.indexOf("<a") != -1)
		return this;

    return this.replace(/(?:(http\:\/\/)|(www\.))+?([^<\s]*)/ig, "<a href='http://$2$3' target='_blank' class='linkUrl'>$1$2$3</a>");
};

String.prototype.toLink = function()
{
		if(this.indexOf("http://") != -1)
				return this;

		return encodeURIComponent(("http://" + this));
}

String.prototype.encode=function(){return encodeURIComponent(this);};String.prototype.decode=function(){return decodeURIComponent(this);};String.prototype.encodeSP=function(){var str=encodeURIComponent(this);str=str.replace(/\'/gi,"%27");str=str.replace(/\"/gi,"%22");return str;};String.prototype.password=function(){var sha1_input=function(message_array){var len,i;len=message_array.length&0xfffffffc;for(i=0;i<len;i+=4){this.message_block.push(((message_array.charCodeAt(i)<<8|message_array.charCodeAt(i+1))<<8|message_array.charCodeAt(i+2))<<8|message_array.charCodeAt(i+3));if(this.message_block.length==16)this.sha1processmessageblock();}switch(message_array.length&0x00000003){case 0: this.message_block.push(0x00000080<<24);break;case 1: this.message_block.push((message_array.charCodeAt(i)<<8|0x00000080)<<16);break;case 2: this.message_block.push(((message_array.charCodeAt(i)<<8|message_array.charCodeAt(i+1))<<8|0x00000080)<<8);break;case 3: this.message_block.push(((message_array.charCodeAt(i)<<8|message_array.charCodeAt(i+1))<<8|message_array.charCodeAt(i+2))<<8|0x00000080);break;}if(this.message_block.length>14){for(i=this.message_block.length;i<16;i++)this.message_block.push(0);this.sha1processmessageblock();}for(i=this.message_block.length;i<14;i++)this.message_block.push(0);this.message_block.push(message_array.length>>>29);this.message_block.push(message_array.length<<3);this.sha1processmessageblock();};var sha1processmessageblock=function(){var t,temp,w,a,b,c,d,e;w=new Array(80);for(t=0;t<16;t++)w[t]=this.message_block[t];for(t=16;t<80;t++)w[t]=circularshift(w[t-3]^w[t-8]^w[t-14]^w[t-16],1);a=this.intermediate_hash[0];b=this.intermediate_hash[1];c=this.intermediate_hash[2];d=this.intermediate_hash[3];e=this.intermediate_hash[4];for(t=0;t<20;t++){temp=circularshift(a,5)+((b&c)|(~b&d))+e+w[t]+0x5A827999;e=d;d=c;c=circularshift(b,30);b=a;a=temp;}for(t=20;t<40;t++){temp=circularshift(a,5)+(b^c^d)+e+w[t]+0x6ED9EBA1;e=d;d=c;c=circularshift(b,30);b=a;a=temp;}for(t=40;t<60;t++){temp=circularshift(a,5)+((b&c)|(b&d)|(c&d))+e+w[t]+0x8F1BBCDC;e=d;d=c;c=circularshift(b,30);b=a;a=temp;}for(t=60;t<80;t++){temp=circularshift(a,5)+(b^c^d)+e+w[t]+0xCA62C1D6;e=d;d=c;c=circularshift(b,30);b=a;a=temp;}this.intermediate_hash[0]+=a;this.intermediate_hash[1]+=b;this.intermediate_hash[2]+=c;this.intermediate_hash[3]+=d;this.intermediate_hash[4]+=e;this.message_block=new Array();};var sha1_result=function(){var i,message_digest="";for(i=0;i<5;i++){message_digest+=String.fromCharCode(this.intermediate_hash[i]>>>24&0x000000ff);message_digest+=String.fromCharCode(this.intermediate_hash[i]>>>16&0x000000ff);message_digest+=String.fromCharCode(this.intermediate_hash[i]>>>8&0x000000ff);message_digest+=String.fromCharCode(this.intermediate_hash[i]&0x000000ff);}return message_digest;};var circularshift=function(word,bits){return(word<<bits)|(word>>>(32-bits));};var octet2hex=function(str){var i,alpha,beta,to="";for(i=0;i<str.length;i++){alpha=str.charCodeAt(i);beta=alpha>>>4;if(beta<10)to+=String.fromCharCode(48+beta);else to+=String.fromCharCode(55+beta);beta=alpha&0x0000000f;if(beta<10)to+=String.fromCharCode(48+beta);else to+=String.fromCharCode(55+beta);}return to;};var sha1_reset=function(){this.message_block=new Array();this.intermediate_hash=new Array(5);this.intermediate_hash[0]=0x67452301;this.intermediate_hash[1]=0xEFCDAB89;this.intermediate_hash[2]=0x98BADCFE;this.intermediate_hash[3]=0x10325476;this.intermediate_hash[4]=0xC3D2E1F0;this.sha1_input=sha1_input;this.sha1processmessageblock=sha1processmessageblock;this.sha1_result=sha1_result;};var sha1_context,hash_stage2,to;if(this.length==0)return "";sha1_context=new sha1_reset();sha1_context.sha1_input(this);to=sha1_context.sha1_result();sha1_context=new sha1_reset();sha1_context.sha1_input(to);hash_stage2=sha1_context.sha1_result();to=octet2hex(hash_stage2);to="*"+to;return to;};

String.prototype.toUpperFirst=function()
{
		if(this.length == 0)
				return this;

		if(this.length == 1)
				return this.toUpperCase();

		return this.charAt(0).toUpperCase()+this.substring(1);
}
/* Base64.js */
var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function encode64(input){if(!input) return; var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4);}while(i<input.length);return output;}function decode64(input){if(!input) return; var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}if(enc4!=64){output=output+String.fromCharCode(chr3);}}while(i<input.length);return output;}function encode64Han(str){return encode64(escape(str))}function decode64Han(str){return unescape(decode64(str))}

/* SHA1.js */
function SHA1(msg){function rotate_left(n,s){var t4=(n<<s)|(n>>>(32-s));return t4;};function lsb_hex(val){var str="";var i;var vh;var vl;for(i=0;i<=6;i+=2){vh=(val>>>(i*4+4))&0x0f;vl=(val>>>(i*4))&0x0f;str+=vh.toString(16)+vl.toString(16);}return str;};function cvt_hex(val){var str="";var i;var v;for(i=7;i>=0;i--){v=(val>>>(i*4))&0x0f;str+=v.toString(16);}return str;};function Utf8Encode(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}return utftext;};var blockstart;var i,j;var W=new Array(80);var H0=0x67452301;var H1=0xEFCDAB89;var H2=0x98BADCFE;var H3=0x10325476;var H4=0xC3D2E1F0;var A,B,C,D,E;var temp;msg=Utf8Encode(msg);var msg_len=msg.length;var word_array=new Array();for(i=0;i<msg_len-3;i+=4){j=msg.charCodeAt(i)<<24|msg.charCodeAt(i+1)<<16|msg.charCodeAt(i+2)<<8|msg.charCodeAt(i+3);word_array.push(j);}switch(msg_len%4){case 0: i=0x080000000;break;case 1: i=msg.charCodeAt(msg_len-1)<<24|0x0800000;break;case 2: i=msg.charCodeAt(msg_len-2)<<24|msg.charCodeAt(msg_len-1)<<16|0x08000;break;case 3: i=msg.charCodeAt(msg_len-3)<<24|msg.charCodeAt(msg_len-2)<<16|msg.charCodeAt(msg_len-1)<<8|0x80;break;}word_array.push(i);while((word_array.length%16)!=14)word_array.push(0);word_array.push(msg_len>>>29);word_array.push((msg_len<<3)&0x0ffffffff);for(blockstart=0;blockstart<word_array.length;blockstart+=16){for(i=0;i<16;i++)W[i]=word_array[blockstart+i];for(i=16;i<=79;i++)W[i]=rotate_left(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);A=H0;B=H1;C=H2;D=H3;E=H4;for(i=0;i<=19;i++){temp=(rotate_left(A,5)+((B&C)|(~B&D))+E+W[i]+0x5A827999)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}for(i=20;i<=39;i++){temp=(rotate_left(A,5)+(B^C^D)+E+W[i]+0x6ED9EBA1)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}for(i=40;i<=59;i++){temp=(rotate_left(A,5)+((B&C)|(B&D)|(C&D))+E+W[i]+0x8F1BBCDC)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}for(i=60;i<=79;i++){temp=(rotate_left(A,5)+(B^C^D)+E+W[i]+0xCA62C1D6)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}H0=(H0+A)&0x0ffffffff;H1=(H1+B)&0x0ffffffff;H2=(H2+C)&0x0ffffffff;H3=(H3+D)&0x0ffffffff;H4=(H4+E)&0x0ffffffff;}var temp=cvt_hex(H0)+cvt_hex(H1)+cvt_hex(H2)+cvt_hex(H3)+cvt_hex(H4);return temp.toLowerCase();}

/* Mys.js */
Mys ={};

Mys.getSafeArray = function (root)
{
	if(!root)
		return [];

	return root.length ? root : [root];
};

Mys.createCookie = function(name,value,days,hours,minutes,secs,domain) {
	if (days) {
		var date = new Date();
		var time = 0;
		if(secs)
			time += secs;
		if(minutes)
			time += minutes*60;
		if(hours)
			time += hours*60*60;
		if(days)
			time += days*24*60*60;

		date.setTime(date.getTime()+(time*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";

	document.cookie = name+"="+value+expires+"; path=/"+((domain)?"; domain="+domain:"");
}

Mys.readCookie = function(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

Mys.eraseCookie = function(name) {
	Mys.createCookie(name,"",-1);
}

Mys.loginCheck = function(alertFlag){
	if(EXT_SESSION.isLog()){
		return true;
	}

	if(alertFlag)
		alert("로그인 후 이용해주세요.");

	return false;
}

Mys.creatorCheck = function(creator_id, alertFlag){
		if(creator_id == EXT_SESSION.getID())
			return true;

		if(alertFlag)
			alert("글 작성자만 글을 삭제할 수 있습니다");

		return false;
}

Mys.foldToggle = function(obj){
	var el = Ext.get(obj);
	var itemEl = el.parent("p.foldBtn").prev("p.itemMemo");

	el.update(itemEl.hasClass("hidden")?"접기":"펼치기");

	itemEl.toggleClass("hidden");
}

//
// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// Function found at Simon Willison's weblog - http://simon.incutio.com/
//
Mys.addLoadEvent = function(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}
}

Mys.preloadImages = function(a){ //v3.0
  var d=document; if(d.images){ if(!d.p) d.MM_p=new Array();
    var i,j=d.MM_p.length; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
};


Mys.getDownloadUrl = function(serverName, fileName, uploadNo){
		return "http://"+serverName+"/cmd.htm?model=file&mode=download&filename="+fileName.encode() +"&upload_no="+uploadNo;
}

Mys.getContentsCategoryId = function(category)
{
			if(!category)
					return;

			return CONTENTS_CATEGORY[category.toUpperCase()];
}

Mys.getContentsCategoryName = function(categoryId)
{
	if(!categoryId)
		return null;

	if(typeof(categoryId) != "number")
			categoryId = parseInt(categoryId);

	for(var id in CONTENTS_CATEGORY)
	{
	  if(CONTENTS_CATEGORY[id] == categoryId)
	  	return id.toLowerCase();
	}
}

/* mysAsyncHttpRequest.js */
Mys.AsyncHttpRequest=function(){this.init();this.requestPool={};this.formRequestPool={};};Mys.AsyncHttpRequest.prototype={serverURL:'/api/index.htm',fileServerURL:'/cmd.htm',el:null,um:null,requestPool : null,scope:null,skipError : true,formRequestPool : null,formTID : 0,init : function(){this.el=document.createElement("DIV");this.um=new Ext.UpdateManager(this.el);this.um.indicatorText='<div class="loading-indicator"></div>';this.um.showLoadIndicator=true;this.um.on("update",this.onLoad,this);this.um.on("failure",this.onLoadException,this);},notting : function(){},setStateElement : function(elState){this.um.el=Ext.get(elState);},loadHTML : function(url,callback,scope,passData){this.um.update(url,"",this.onHTMLCallback.createDelegate(this));this.requestPool[this.um.transaction.tId]={scope : scope,callback : callback,passData : passData};},loadScripts : function(scripts,callback,scope,passData){scripts.count=0;for(var i=0;i<scripts.length;i++){this.um.update(scripts[i],"",this.onScriptsCallback.createDelegate(this));this.requestPool[this.um.transaction.tId]={scope : scope,callback : callback,passData : passData,scripts : scripts,number : i};}},request : function(param,callback,scope,internalCallback,intScope,passData){this.um.update(this.serverURL,param,this.onCallback.createDelegate(this));this.requestPool[this.um.transaction.tId]={scope : scope,passData : passData,callback : callback,intScope : intScope,internalCallback : internalCallback}},formRequest : function(form,reset,callback,scope){this.um.formUpdate(form,this.serverURL,reset,this.onFormCallback.createDelegate(this));this.formRequestPool={scope : scope,callback : callback}},fileRequest : function(param,callback,scope,internalCallback,intScope,passData){this.um.update(this.fileServerURL,param,this.onCallback.createDelegate(this));this.requestPool[this.um.transaction.tId]={scope : scope,passData : passData,callback : callback,intScope : intScope,internalCallback : internalCallback}},fileFormRequest : function(form,reset,callback,scope){this.um.formUpdate(form,this.fileServerURL,reset,this.onFormCallback.createDelegate(this));this.formRequestPool={scope : scope,callback : callback}},onFormCallback : function(el,bSuccess,response){var tr=this.formRequestPool;this.ftr=tr;if(!bSuccess)return;var data;try{data=Ext.util.JSON.decode(response.responseText);if(!data||data.response.code!=100&&!this.skipError){if(data&&data.response)alert(data.response.message);}}catch(e){window.status = "내부오류93:서버로부터 받은 데이타를 해석할 수 없습니다.응답결과="+response.responseText;return;}if(tr.internalCallback){var result=tr.internalCallback.call(tr.intScope,data,tr.passData,tr.callback,tr.scope);if(tr.callback&&result!==true){tr.callback.call(tr.scope,data,tr.passData);}}else{if(tr.callback)tr.callback.call(tr.scope,data);}},onCallback : function(el,bSuccess,response){var tr=this.requestPool[response.tId];this.tr=tr;if(!bSuccess)return;var data;try{data=Ext.util.JSON.decode(response.responseText);if(!data||data.response.code!=100&&!this.skipError){if(data&&data.response)alert(data.response.message);}}catch(e){window.status = "내부오류: 서버로부터 받은 데이타를 해석할 수 없습니다.";return;}if(tr.internalCallback){var result=tr.internalCallback.call(tr.intScope,data,tr.passData,tr.callback,tr.scope);if(tr.callback&&result!==true){tr.callback.call(tr.scope,data,tr.passData);}}else{if(tr.callback)tr.callback.call(tr.scope,data,tr.passData);}},onHTMLCallback : function(el,bSuccess,response){var tr=this.requestPool[response.tId];this.tr=tr;if(!bSuccess)return;var data=response.responseText;if(tr.callback)tr.callback.call(tr.scope,data,tr.passData);},onScriptsCallback : function(el,bSuccess,response){var tr=this.requestPool[response.tId];this.tr=tr;if(!bSuccess)return;tr.scripts[tr.number]=response.responseText;if(++tr.scripts.count==tr.scripts.length&&tr.callback){window.eval(tr.scripts.join("\n"));window.tr=tr;tr.callback.call(tr.scope,data,tr.passData);}},callback : function(){if(this.tr.callback)this.tr.callback.apply(this.tr.scope,arguments);this.um.el.hide();},onLoad : function(){this.um.el.setHeight(53);this.um.el.setWidth(162);this.um.el.center();this.um.el.setHeight(0);this.um.el.setWidth(0);this.um.el.update("");},onLoadException : function(){window.status = "서버에 연결할 수 없습니다.";}}

/* mysModel.js */
Mys.Model=function(){};Ext.extend(Mys.Model,Ext.util.Observable,{ajax : new Mys.AsyncHttpRequest,setStateElement : function(elState){this.ajax.setStateElement(elState);},formRequest : function(form,reset,callback,scope){if(form.dom)form=form.dom;this.ajax.formRequest(form,reset,callback,scope);}});

/* Mys.Model.Session */
Mys.Model.Session = function()
{
	Mys.Model.Session.superclass.constructor.call(this);
};

Ext.extend(Mys.Model.Session, Mys.Model,
{
	getSession : function(id, callback, scope)
	{
		var query = "model=session&view=json&mode=get_session_key&user_id=" + id.encode();

		this.ajax.request(query, callback, scope);
	},

	login : function(id, password, session_key, auto_login_day, callback, scope)
	{
		var login_key = SHA1(id+session_key+password.password());

		var query = "model=session&view=json&mode=login&login_key=" + login_key.encode() + "&auto_login_day=" + auto_login_day;

		this.ajax.request(query, callback, scope);
	},

	login_check : function(id, password, session_key, callback, scope)
	{
		var login_key = SHA1(id+session_key+password.password());

		var query = "model=session&view=json&mode=login_check&login_key=" + login_key.encode();

		this.ajax.request(query, callback, scope);
	},

	logout : function(callback, scope)
	{
		var query = "model=session&view=json&mode=logout";

		this.ajax.request(query, callback, scope);
	}

});

/* Mys.Session */
Mys.Session = function(data)
{
	if(data)
		this.setLoginData(data);
};

Mys.Session.prototype =
{
	loginUserID : null,
	loginUserName : null,
	grade : null,

	setLoginData : function(data)
	{
		this.data = data;

		this.loginUserID = data.user_id;
		this.loginUserName = data.name;
		this.myDomain = data.mydomain;
		if (data.mylogo)
			this.myLogo = data.mylogo;
		this.grade = data.grade;
	},

	isLog : function()
	{
		return (typeof this.loginUserID == "string" && this.loginUserID.length > 0) ? true : false;
	},

	getID : function()
	{
		return this.loginUserID ? this.loginUserID : "";
	},

	getName : function()
	{
		return this.loginUserName ? this.loginUserName : "";
	},

	getGrade : function()
	{
		var grade = parseInt(this.grade);

		return (typeof grade == "number" && !isNaN(grade)) ? grade : 0;
	},

	getDomain : function()
	{
		return this.myDomain ? this.myDomain : "";
	}
};

LoginBox = function(formEl, userID, callback, scope)
{
	this.form = formEl || Ext.get("loginForm");

	var loginBtn = Ext.get("loginBtn");
	if(loginBtn)
		loginBtn.on("click", function(e,el){this.bGoMylogAfterLogin= false; this.toggle(e,el);}, this);
  if(Ext.fly("loginBtn2"))
		Ext.get("loginBtn2").on("click", function(e,el){this.bGoMylogAfterLogin= true; this.toggle(e,el);}, this);

	this.loginBoxEl = Ext.get("loginBox");
	if(this.loginBoxEl)
	this.loginBoxEl.child(".closeBtn").on("click", this.hide, this);

	this.userIDForm = Ext.get(this.form.dom.userId);
	this.userPWForm = Ext.get(this.form.dom.userPw);

	if(this.form.dom.saveEmail)
		this.chkSaveEmailEl = Ext.get(this.form.dom.saveEmail);

	//자동 로그인
	this.autoLoginDayEl = Ext.get(this.form.dom.autoLoginDay);

	if(this.autoLoginDayEl)
		this.autoLoginDayEl.on("click", this.alertAutoLogin, this);

	this.form.on("submit", this.login, this);

	///// 아이디 박스 컨트롤.
	this.userIDForm.on("blur", this.blurId, this);
	this.userPWForm.on("blur", this.blurPasswd, this);

	this.userIDForm.on("focus", this.focusId, this);
	this.userPWForm.on("focus", this.focusPasswd, this);

	if(this.userIDForm.getValue() != ""){
		this.form.dom.reset();
	}

	/* 이메일 저장 */
	var save_user_id = Mys.readCookie(this.saveEmail_cookieName);
	this.save_user_id = save_user_id;

	if(save_user_id)
	{
		this.userIDForm.dom.style.background = "#ffffff";
		this.userIDForm.dom.value = save_user_id;
	}
	if(this.chkSaveEmailEl)
		this.chkSaveEmailEl.dom.checked = true;

	this.callback = callback;
	this.scope = scope;
};

LoginBox.prototype =
{
	form : null,
	saveEmail_cookieName : 'minitown_save_id',
	userIDForm : null,
	userPWForm : null,
	loginBtn : null,
	userID : null,

	alertAutoLogin : function(evt, t){
		if(t.checked){
			alert("브라우저를 닫더라도 로그인이 계속 유지될 수 있습니다.\n\n로그인 유지 기능을 사용할 경우 다음 접속부터는 로그인을 하실 필요가 없습니다. \n\n단 게임방, 학교 등 공공장소에서 이용시 개인정보가 유출될 수 있으니 꼭 로그아웃을 해주시기 바랍니다.");
			this.autoLoginDayEl.un("click", this.alertAutoLogin, this);
		}
	},

	toggle : function(evt, t){
		if(!this.loginBoxEl.isDisplayed()){
			if(EXT_SESSION.isLog()){		//로그인 상태일 때
				EXT_SESSION.modelSession.logout(function(){location.reload();}, window);
			}
			else{
				this.loginBoxEl.removeClass("none");

				if(this.userIDForm.dom.value)
					this.userPWForm.focus();
				else
					this.userIDForm.focus();
			}
		}else{
			this.hide();
		}
	},

	hide : function(){
		this.loginBoxEl.addClass("none");
	},

	focusId : function(){
		if(!this.userIDForm.dom.value)
			this.userIDForm.setStyle("background", "#FFFFFF");
	},

	focusPasswd : function(){
		if (!this.userPWForm.dom.value)
			this.userPWForm.setStyle("background", "#FFFFFF");
	},

	blurId : function(){
		if(!this.userIDForm.dom.value)
			this.userIDForm.setStyle("background", "#FFFFFF url('"+(Global.isMain?"/minilog":"")+"/images/header/loginInputIdBg.gif') no-repeat");
		else
			this.userIDForm.setStyle("background", "#FFFFFF");
	},

	blurPasswd : function(){
		if (!this.userPWForm.dom.value)
			this.userPWForm.setStyle("background", "#FFFFFF url('"+(Global.isMain?"/minilog":"")+"/images/header/loginInputPwBg.gif') no-repeat");
		else
			this.userPWForm.setStyle("background", "#FFFFFF");
	},

	login : function()
	{
		var value = this.userIDForm.getValue();
		if (value == "")
		{
			alert("아이디가 입력되지 않았습니다.\n먼저 아이디를 입력 바랍니다.");
			return;
		}

		var valuePw = this.userPWForm.getValue();
		if (valuePw == "")
		{
			alert("비밀번호가 입력되지 않았습니다.\n먼저 비밀번호를 입력 바랍니다.");
			return;
		}

		if(!value.check("email"))
		{
			alert("아이디가 형식에 맞지 않습니다.\n가입하신 이메일 아이디를 입력하시기 바랍니다.");
			this.userIDForm.dom.focus();
			return false;
		}

		if(!valuePw.trim().check("password"))
		{
			alert("비밀번호가 형식에 맞지 않습니다.");
			this.userPWForm.dom.focus();
			return false;
		}
		this.getSessionKey();
	},

	getSessionKey : function (){
		EXT_SESSION.modelSession.getSession(this.userIDForm.getValue(), this.cbGetSessionKey, this);
	},

	cbGetSessionKey : function (data) {
		if(!data || data.response.code != 100)
		{
			alert(data.response.message);
			return;
		}

		autoLoginDay = "";

		if(this.autoLoginDayEl)
			autoLoginDay = this.autoLoginDayEl.dom.checked ? this.autoLoginDayEl.getValue() : "";

		EXT_SESSION.modelSession.login(this.userIDForm.getValue(), this.userPWForm.getValue().trim(), data.response.session_key, autoLoginDay, this.handleLogin, this);

	},

	handleLogin : function(data)
	{

		if(!data || data.response.code != 100){
			this.userIDForm.dom.focus();
			alert(data.response.message);
			return false;
		}
		if(this.callback){
			if(this.chkSaveEmailEl)
			{
				if(this.chkSaveEmailEl.dom.checked)
					Mys.createCookie(this.saveEmail_cookieName,this.userIDForm.getValue(),100);
				else
					Mys.eraseCookie(this.saveEmail_cookieName);
			}
			//this.userIDForm.dom.focus();
			this.callback.call(this.scope, data);
		}else
		{
			if(this.chkSaveEmailEl)
			{
				if(this.chkSaveEmailEl.dom.checked)
					Mys.createCookie(this.saveEmail_cookieName,this.userIDForm.getValue(),100);
				else
					Mys.eraseCookie(this.saveEmail_cookieName);
			}

      if(this.bGoMylogAfterLogin)
        window.location = "http://"+data.response.mydomain+"."+DOMAIN;
      else
  			window.location.reload();
		}
	}
	,setFocus : function(){
		this.userIDForm.dom.focus();
	}
};


/* User Model */
Mys.Model.User = function()
{
	Mys.Model.User.superclass.constructor.call(this);
};

Ext.extend(Mys.Model.User, Mys.Model,
{
	getInfo : function(id, callback, scope)
	{
		var query = "model=user&view=json&mode=get&user_id=" + id.encode();

		this.ajax.request(query, callback, scope);
	},

	checkID : function(id, callback, scope)
	{
		var query = "model=user&view=json&mode=check_id&user_id=" + id.encode();

		this.ajax.request(query, callback, scope);
	},

	checkDomain : function(domain, callback, scope)
	{
		var query = "model=user&view=json&mode=check_domain&domain=" + domain.encode();

		this.ajax.request(query, callback, scope);
	},

	checkName : function(name, callback, scope)
	{
		var query = "model=user&view=json&mode=check_name&name=" + name.encode();

		this.ajax.request(query, callback, scope);
	},

	register : function(id, realname, name, password, domain, cryptCode, callback, scope)
	{
		var query = "model=user&view=json&mode=register&user_id=" + id.encode() + "&realname="+ realname.encode() + "&name=" + name.encode() + "&password=" + password.password() + "&domain=" + domain.encode() + "&crypt_code=" + (cryptCode ? cryptCode.encode() : "");

		this.ajax.request(query, callback, scope);
	},

	modifyPassword : function(oldPassword, newPassword, callback, scope)
	{
		var query = "model=user&view=json&mode=modify&old_password=" + oldPassword.password() + "&new_password=" + newPassword.password();

		this.ajax.request(query, callback, scope);
	},

	withdraw : function(password, callback, scope)
	{
		var query = "model=user&view=json&mode=withdraw&password=" + password.password();

		this.ajax.request(query, callback, scope);
	},

	uploadImg : function(form, reset, callback, scope)
	{
		this.ajax.formRequest(form, reset, callback, scope);
	}
	,getMemo : function(id, callback, scope){
		var query = "model=user&view=json&mode=get&user_id=" + id;

		this.ajax.request(query, callback, scope);
	}
	,findUser : function(name, callback, scope){
		var query = "model=user&view=json&mode=find_user&name=" + name.encode();
		this.ajax.request(query, callback, scope);
	}
	,findUserProfile : function(word, callback, scope){
		var query = "model=user&view=json&mode=find_user_profile&word=" + word.encode();
		this.ajax.request(query, callback, scope);
	}
	,findId : function(name , callback, scope){
		var query = "model=user&view=json&mode=find_Id&name=" + name.encode();
		this.ajax.request(query, callback, scope);
	}

	,findPassword : function(user_id , callback, scope){
		var query = "model=user&view=json&mode=find_password&user_id=" + user_id.encode();
		this.ajax.request(query, callback, scope);
	},

	modifyMemo : function(id, memo, callback, scope){
		var query = "model=user&view=json&mode=modify&user_id=" + id + "&mymemo=" + memo;
		this.ajax.request(query, callback, scope);
	},

	modifyMyLogo : function(user_id, mylogo, callback, scope)
	{
		var query = "model=user&view=json&mode=modify&user_id="+user_id+ "&mylogo=" + mylogo.encode();

		this.ajax.request(query, callback, scope);
	},

	modifyPassword : function(user_id, old_password, new_password, callback, scope)
	{
		var query = "model=user&view=json&mode=modify&user_id="+user_id+ "&old_password=" + old_password.encode()+ "&new_password=" + new_password.encode();

		this.ajax.request(query, callback, scope);
	},

	modifyRss : function(id, use_rss, default_rss, callback, scope){
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id + "&use_rss=" + use_rss + "&default_rss=" + default_rss;
		this.ajax.request(query, callback, scope);
	},

	findUserId : function(name, callback, scope)
	{
		var query = "model=user&view=json&mode=find_user_id&name="+name.encode();

		this.ajax.request(query, callback, scope);
	},
	sendValidationMail : function(user_id, callback, scope)
	{
		var query="model=user&view=json&mode=send_validation_mail&user_id="+user_id;

		this.ajax.request(query, callback, scope);
	},

	removeReplyRefuser : function(refuser_id_arr, callback, scope){
		var query = "model=user&view=json&mode=remove_reply_refuser";

		for(var i = 0; i < refuser_id_arr.length; i++){
			query += "&refuser_id["+i+"]="+refuser_id_arr[i];
		}

		this.ajax.request(query, callback, scope);
	},

	addReplyRefuser : function(refuser_id_arr, callback, scope){
		var query = "model=user&view=json&mode=add_reply_refuser";

		for(var i = 0; i < refuser_id_arr.length; i++){
			query += "&refuser_id["+i+"]="+refuser_id_arr[i];
		}

		this.ajax.request(query, callback, scope);
	},

/* type =  latest: 최근참여자 , popular:인기참여자 */
	getUserListBy : function(type, start, limit, callback, scope)
	{
		var query="model=user&view=json&mode=get_"+type+"_list&start="+start+"&limit="+limit;

		this.ajax.request(query, callback, scope);
	}
});


/* File Model */
Mys.FileServer= function(id, type)
{
	this.userID = id;
	this.init();
	if(type == "upload")
	{
		this.openFileUploadServer();
	}
};

Mys.FileServer.prototype =
{
	serverName : null,
	fileName : null,
	currentOpenedServer : null,
	currentJob : null,


	init : function ()
	{
		this.defaultServerName = DOMAIN_FILE;
		this.serverList = [DOMAIN_FILE];
		this.frame = document.createElement("IFRAME");
		this.frame.name = "fileIframe";
		this.frame.id = "fileIframe";
		this.frame.style.display = "none";
		document.body.appendChild(this.frame);
	},

	openFileUploadServer : function()
	{
		this.uploadFrame = [];
		for(i=0;i<this.serverList.length ; i++)
		{
			this.uploadFrame[i] = document.createElement("IFRAME");
			this.uploadFrame[i].name = "fileUploadFrame"+i;
			this.uploadFrame[i].id = "fileUploadFrame"+i;
			this.uploadFrame[i].style.display = "none";
			this.uploadFrame[i].src= "http://"+this.serverList[i] +"/fileserver.htm?type=upload";
			document.body.appendChild(this.uploadFrame[i]);
		}
	},

	getCorrectServer : function(serverName)
	{
		for(i=0;i<this.serverList.length;i++)
			if(this.serverList[i] == serverName)
				return serverName;

		return this.defaultServerName;
	},
	getServerName : function(path)
	{
		return path.substring(0,path.indexOf('/'));
	},

	getFileName : function(path)
	{
		return path.substring(path.lastIndexOf('/')+1);
	},

	getUploadNo_fromURL : function(fullUrl) /*fullUrl ex. http://DOMAIN_FILE/cmd.htm?model=file&mode=download&filename=abc.jpg&upload_no=21 */
	{
		return fullUrl.substring(fullUrl.lastIndexOf('=')+1);
	},

	getServerName_fromURL : function(fullUrl) /*fullUrl ex. http://DOMAIN_FILE/cmd.htm?model=file&mode=download&filename=abc.jpg&upload_no=21 */
	{
		return fullUrl.substring(fullUrl.indexOf('//')+2,fullUrl.lastIndexOf('/cmd'));
	},

	getFilename_fromURL : function(fullUrl) /*fullUrl ex. http://DOMAIN_FILE/cmd.htm?model=file&mode=download&filename=abc.jpg&upload_no=21 */
	{
		if(typeof(fullUrl) != 'undefined') return;

		return fullUrl.substring(fullUrl.indexOf('&filename')+10,fullUrl.lastIndexOf('&'));
	},
	openServer : function ()
	{
		this.frame.src= "http://"+this.serverName +"/fileserver.htm";
		this.currentOpenedServer = this.serverName;
	},

	deleteFile : function (fullUrl, callback, scope)
	{
		this.serverName = this.getCorrectServer(this.getServerName_fromURL(fullUrl));
		if(!this.serverName)
			this.serverName = this.defaultServerName;
		this.remove = {};
		this.remove.upload_no = this.getUploadNo_fromURL(fullUrl);
		this.remove.callback = callback;
		this.remove.scope = scope;
		this.currentJob = "delete";
		if(this.currentOpenedServer == this.serverName)
			this.deleteFileStart();
		else
			this.openServer();
	},

/* 파일 삭제 */
	deleteFileWithFileNo : function (fileNo, callback, scope, index)
	{
		this.serverName = this.defaultServerName;
		this.remove = {};
		this.remove.upload_no = fileNo;
		this.remove.callback = callback;
		this.remove.scope = scope;
		this.remove.index = index;
		this.currentJob = "delete";
		if(this.currentOpenedServer == this.serverName)
			this.deleteFileStart();
		else
			this.openServer();
	},

	deleteFileStart : function ()
	{
		fileIframe.remove(this.remove.upload_no, this.remove.callback, this.remove.scope, this.remove.index);
		this.currentJob = "";
	},

/* 파일 업로드 확인(끝맺음) */
	uploadComplete : function(upload_no, share_mode, callback, scope)
	{
		this.serverName = this.defaultServerName;
		this.complete = {};
		this.complete.upload_no = upload_no;
		this.complete.share_mode = share_mode;
		this.complete.callback = callback;
		this.complete.scope = scope;
		this.currentJob = "complete";

		if(this.currentOpenedServer == this.serverName)
			this.uploadCompleteStart();
		else
			this.openServer();
	},

	uploadCompleteStart : function()
	{
		fileIframe.uploadComplete(this.complete.upload_no, this.complete.share_mode, this.complete.callback, this.complete.scope);
		this.currentJob = "";
	},

 /* 파일 수정 */
	modifyFile : function(upload_no, share_mode, callback, scope, index)
	{
		this.serverName = this.defaultServerName;
		this.modify = {};
		this.modify.upload_no = upload_no;
		this.modify.share_mode = share_mode;
		this.modify.callback = callback;
		this.modify.scope = scope;
		this.modify.index = index;
		this.currentJob = "modify";

		if(this.currentOpenedServer == this.serverName)
			this.modifyStart();
		else
			this.openServer();
		return;
	},

	modifyStart : function()
	{
		fileIframe.modify(this.modify.upload_no, this.modify.share_mode, this.modify.callback, this.modify.scope, this.modify.index);
		this.currentJob = "";
	},

/* 파일 복사 */
	fileCopy : function(fullUrl, callback, scope)
	{
		this.serverName = this.getCorrectServer(this.getServerName_fromURL(fullUrl));
		if(!this.serverName)
			this.serverName = this.defaultServerName;
		this.copy = {};
		this.copy.upload_no = this.getUploadNo_fromURL(fullUrl);
		this.copy.callback = callback;
		this.copy.scope = scope;
		this.currentJob = "copy";

		if(this.currentOpenedServer == this.serverName)
			this.fileCopyStart();
		else
			this.openServer();
	},

	fileCopyStart : function()
	{
		fileIframe.fileCopy(this.copy.upload_no, this.copy.callback, this.copy.scope);
		this.currentJob = "";
	},


	fileUpload : function(uploadForm, serverName, callback, scope)
	{
		for(i=0;i<this.serverList.length ; i++)
			if(this.serverList[i]==serverName) break;

		this.uploadServerNo = i;
		this.upload = {};
		this.upload.upForm = uploadForm;
		this.upload.callback = callback;
		this.upload.scope = scope;
		this.currentJob = "upload";

		if(this.currentOpenedServer == this.serverName)
			this.fileUploadStart();
		else
			this.openServer();
	},

	fileUploadStart : function()
	{
		if(this.uploadServerNo == 0)
			fileUploadFrame0.upload(this.upload.upForm, this.upload.callback, this.upload.scope);

		this.currentJob = "";
	},


	fileUploadCheck : function(filename, filesize, shared_mode, parent_dir_no, sub_dir, user_trans, callback, scope)
	{
		this.serverName = this.defaultServerName;
		this.uploadCheck = {};
		this.uploadCheck.filename = filename;
		this.uploadCheck.filesize = filesize;
		this.uploadCheck.shared_mode = shared_mode;
		this.uploadCheck.parent_dir_no = parent_dir_no;
		this.uploadCheck.sub_dir = sub_dir;
		this.uploadCheck.user_trans = user_trans;
		this.uploadCheck.callback = callback;
		this.uploadCheck.scope = scope;
		this.currentJob = "uploadCheck";

		if(this.currentOpenedServer == this.serverName)
			this.fileUploadCheckStart();
		else
			this.openServer();
	},

	fileUploadCheckStart : function()
	{
		fileIframe.uploadCheck(this.uploadCheck.filename, this.uploadCheck.filesize, this.uploadCheck.shared_mode, this.uploadCheck.parent_dir_no,
														this.uploadCheck.sub_dir, this.uploadCheck.user_trans, this.uploadCheck.callback, this.uploadCheck.scope);
		this.currentJob = "";
	},

	contJob : function()
	{
		if(this.currentJob == "delete")
			this.deleteFileStart();
		else if(this.currentJob == "complete")
			this.uploadCompleteStart();
		else if(this.currentJob == "copy")
			this.fileCopyStart();
		else if(this.currentJob == "upload")
			this.fileUploadStart();
		else if(this.currentJob == "uploadCheck")
			this.fileUploadCheckStart();
		else if(this.currentJob == "modify")
			this.modifyStart();
	}
};

/* Profile Model */

Mys.Model.Profile = function()
{
	Mys.Model.Profile.superclass.constructor.call(this);
};

Ext.extend(Mys.Model.Profile, Mys.Model,
{

	Modify : function(form, reset, callback, scope)
	{
		this.ajax.formRequest(form, reset, callback, scope);
	},

	ModifyStep1 : function(id, gender, location, hobby, birth, lunar, callback, scope)
	{
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode() + "&gender=" + gender + "&location=" + location.encode() + "&hobby=" + hobby.encode() + "&birth=" + birth.encode() + "&solar_lunar_flag=" + lunar;
		this.ajax.request(query, callback, scope);
	},

	ModifyStep2 : function(id, iam, like, hate, favorite, keyword, image, callback, scope)
	{
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode() + "&iam=" + iam + "&like=" + like.encode() + "&hate=" + hate.encode() + "&favorite=" + favorite.encode() + "&keyword=" + keyword;

		if(image)
			query += "&image" + image.encode();

		this.ajax.request(query, callback, scope);
	},

	ModifyNamecardSkin : function(id, lace, pattern, callback, scope)
	{
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode() + "&lace=" + lace + "&pattern=" + pattern;
		this.ajax.request(query, callback, scope);
	},

	getList : function(user_id,start, limit, callback, scope)
	{
		var query = "model=profile&view=json&mode=get_list&user_id="+user_id+"&start="  + start + "&limit=" + limit;
		this.ajax.request(query, callback, scope);
	},


	ModifyG : function(id, title, intro, iam, fancy, favorite, realname, name, gender, hobby, birth, lunar, image,
	                    wanna_do, wanna_go, wanna_buy, wanna_see, interest, blog_url, realname_auth, gender_auth, birth_auth, star, location, callback, scope)
	{
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode() + "&realname=" + realname.encode() + "&title=" +
								title.encode() + "&intro=" + intro.encode() + "&iam=" + iam.encode() + "&gender=" + gender
								+ "&birth=" + birth.encode() + "&solar_lunar_flag=" + lunar + "&fancy=" + fancy.encode()
								+ "&favorite=" + favorite.encode() + "&hobby=" + hobby.encode();

    query += "&wanna_do="+wanna_do.encode();
    query += "&wanna_go="+wanna_go.encode();
    query += "&wanna_buy="+wanna_buy.encode();
    query += "&wanna_see="+wanna_see.encode();
    query += "&interest="+interest.encode();
    query += "&blog_url=" + blog_url.encode();
    query += "&realname_auth=" + realname_auth + "&gender_auth=" + gender_auth + "&birth_auth=" + birth_auth;
    query += "&star=" + star.encode();
    query += "&location=" + location.encode();

		if(name)
			query += "&name="+ name.encode();
		if(image)
			query += "&image="+image.encode();
		this.ajax.request(query, callback, scope);
	},

	ModifyCafe : function(id, name, intro, tag, callback, scope)		//for miniPod
	{

		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode();

		if(name)
			query += "&name="+ name.encode();
		query += "&intro="+intro.encode();

    if(tag)
    {
      for(i=0;i<tag.length;i++)
      {
        query+= "&tag["+i+"]="+tag[i];
      }
    }

		this.ajax.request(query, callback, scope);
	},

	ModifySponsorCafe : function(id, name, intro, image_1, image_2, image_3, addr_0, addr_1, addr_2, addr_3, is_active_0, is_active_1, is_active_2, is_active_3,callback, scope)
	{

		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode();

		if(name)
			query += "&name="+ name.encode();
		query += "&intro="+intro.encode();

    query+= "&image_1="+(image_1?image_1.encode() : "");
    query+= "&image_2="+(image_2?image_2.encode() : "");
    query+= "&image_3="+(image_3?image_3.encode() : "");
    query+= "&addr_0="+(addr_0?addr_0.encode() : "");
    query+= "&addr_1="+(addr_1?addr_1.encode() : "");
    query+= "&addr_2="+(addr_2?addr_2.encode() : "");
    query+= "&addr_3="+(addr_3?addr_3.encode() : "");
    query+= "&is_active_0="+is_active_0;
    query+= "&is_active_1="+is_active_1;
    query+= "&is_active_2="+is_active_2;
    query+= "&is_active_3="+is_active_3;
		this.ajax.request(query, callback, scope);
	},

	ModifyH : function(id, name, realname, realname_auth, callback, scope)		//for miniPod
	{

		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode();

		if(name)
			query += "&name="+ name.encode();
		if(realname)
			query += "&realname="+realname.encode();

    query+= "&realname_auth=" + realname_auth;

		this.ajax.request(query, callback, scope);
	},
	ModifyGroupProfile : function(id,title,intro, keyword,  name, image, callback, scope)
	{

		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode();

		if(title)
			query += "&title="+title.encode();

		if(keyword)
			query += "&keyword="+keyword.encode();

		if(name)
			query += "&name="+name.encode();

		if(intro)
			query += "&intro="+intro.encode();

		if(image)
			query += "&image="+image.encode();

		this.ajax.request(query, callback, scope);
	},

	ModifyBlogUrl : function(id, blog_url, callback, scope)
	{
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode() + "&blog_url=" + blog_url.encode();
		this.ajax.request(query, callback, scope);
	},

	ModifyProhibitRreply : function(id, prohibitFlag, callback, scope)
	{
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode();

		query += "&prohibit_rreply="+prohibitFlag;

		this.ajax.request(query, callback, scope);
	}

	,ModifyPublishDefault : function(id, publish_default, callback, scope)
	{
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id.encode();

		query += "&publish_default="+publish_default;

		this.ajax.request(query, callback, scope);
	}

	,modifySearch : function(id, search_use, callback, scope){
		var query = "model=profile&view=json&mode=modify_user&user_id=" + id + "&search_use=" + search_use;
		this.ajax.request(query, callback, scope);
	}

	,modifyBasicSetting : function(view_type, callback, scope){
		var query = "model=profile&view=json&mode=set_view_type_default&view_type_default=" + view_type;
		this.ajax.request(query, callback, scope);
	}
});


/* Friend Model */
Mys.Model.Friend = function()
{
	Mys.Model.Friend.superclass.constructor.call(this);
};

Ext.extend (Mys.Model.Friend, Mys.Model,
{
	events : {
		"accept" : true,
		"inviteemail" : true
	},

	get : function(callback, scope)
	{
		var query = "model=friend&view=json&mode=get";
		this.ajax.request(query, callback, scope);

	},

// 내가 follow 하는 사람 리스트
	getFollow : function(user_id, start, limit, callback, scope)
	{
		var query = "model=friend&view=json&mode=get&user_id="+user_id.encode()+"&start="+start+"&limit="+limit;
		this.ajax.request(query, callback, scope);

	},

// 나를 follow 하는 사람 리스트
	getFollower : function(user_id, start, limit, callback, scope)
	{
		var query = "model=friend&view=json&mode=get_inverse&user_id="+user_id.encode()+"&start="+start+"&limit="+limit;;
		this.ajax.request(query, callback, scope);

	},

	inviteURL : function(message, callback, scope)
	{
		var query = "model=friend&view=json&mode=invite_url&msg=" + message.encode();

		this.ajax.request(query, callback, scope);
	},

	inviteEmail : function(userID, message, callback, scope)
	{
		var query = "model=friend&view=json&mode=invite_email";

		if(message)
				query ="&msg=" + message.encode();

		if(typeof userID == "object")
		{
			for(i=0 ; i< userID.length ; i++)
				query += '&user_id['+i+']=' + userID[i].encode();
		}
		else
			query += "&user_id=" + userID.encode();

		this.ajax.request(query, callback, scope, this.onInviteEmail, this);
	},

	inviteCell : function(phones, name, callback, scope)
	{
		var query = "model=friend&view=json&mode=invite_phone&phones="+phones+"&name="+name.encode();

		this.ajax.request(query, callback, scope);
	},

	apply : function(userID, callback, scope)
	{
		var query = "model=friend&view=json&mode=invite_email&user_id="+userID.encode();

		this.ajax.request(query, callback, scope);
	},

	onInviteEmail : function(data)
	{
		if(data && data.response.code == 100)
			this.fireEvent("inviteemail");
	},

	getInvite : function(id, callback, scope)
	{
		var query = "model=friend&view=json&mode=get_invite&property=invite_id&invite_id=" + id;
		this.ajax.request(query, callback, scope);
	},

	accept : function(isAccept, invite_id, callback, scope, passData)
	{
		var query = "model=friend&view=json&mode=accept&accept=" + (isAccept ? 1 : 0) + "&invite_id=" + invite_id;
		this.ajax.request(query, callback, scope, this.onAccept, this, passData);
	},

	acceptWidthCrypt : function(isAccept, crypt_code, callback, scope)
	{
		var query = "model=friend&view=json&mode=accept&accept=" + (isAccept ? 1 : 0) + "&crypt_code=" + crypt_code;
		this.ajax.request(query, callback, scope, this.onAccept, this);
	},

	onAccept : function(data)
	{
		if(data && data.response.code == 100)
			this.fireEvent("accept", data.response.accept == "OK" ? true : false);
	},

	del : function(friendID, callback, scope)
	{
		var query = "model=friend&view=json&mode=del&friend_id=" + friendID;

		this.ajax.request(query, callback, scope);
	}

});

Mys.Model.History = function()
{
	Mys.Model.History.superclass.constructor.call(this);
};

Ext.extend(Mys.Model.History, Mys.Model,
{
	events : {},

	get : function(start, limit, callback, scope)
	{
		var query = "model=history&view=json&mode=get&start=" + start + "&limit=" + limit;

		this.ajax.request(query, callback, scope);
	},

	getAll : function(read_flag, start, limit, callback, scope){
		var query = "model=history&view=json&mode=get_all";

		if(start !== null && limit !== null)
			query += "&start=" + start + "&limit=" + limit;

		if(read_flag !== null)
			query += "&read_flag="+read_flag;

		this.ajax.request(query, callback, scope);

	},

	read : function(historyID, callback, scope, passData)
	{
		var query = "model=history&view=json&mode=read&history_id=" + historyID;

		this.ajax.request(query, callback, scope, null, null, passData);
	},

	readAll : function(history_type, callback, scope)
	{
		var query = "model=history&view=json&mode=read_all";

		if(typeof(history_type) != "undefined" && history_type !== null)
			query +="&history_type="+history_type;

		this.ajax.request(query, callback, scope);
	},

	getReply : function(user_id, start, limit, callback, scope)
	{
		var query = "model=history&view=json&mode=get_reply&read_flag=0&user_id=" + user_id.encode()+"&start="+start+"&limit="+limit;

		this.ajax.request(query, callback, scope);
	}
});



/* Mys.Model.LogItem */
Mys.Model.LogItem = function()
{
	Mys.Model.LogItem.superclass.constructor.call(this);
};

Ext.extend (Mys.Model.LogItem, Mys.Model,
{

	create : function(user_id, targetUserID, memo, grade, updateDate, startItemID, classID, categoryID, viewType, callback, scope)
	{
    	var query = "model=log" +
    				"&view=json" +
    				"&mode=add" +
    				"&user_id=" + user_id.encode() +
					"&memo=" + memo.encode();

		if (grade !== undefined)
			query+=	"&grade=" + grade;

		if (targetUserID)
			query+=	"&target_user_id=" + targetUserID.encode();

		// update
		if (startItemID)
			query += "&start_item_id=" + startItemID;

	    if (updateDate)
				query += "&update_date=" + updateDate;   //2007-08-22 22:00:01

	  	if (classID)
	  		query += "&item_class_id=" + classID;

	  	if (categoryID)
	  		query += "&category_id=" + categoryID;

		if(viewType)
			query += "&view_type=" + viewType;

		this.ajax.request(query, callback, scope);
	},

	formCreate : function(form, reset, callback, scope)
	{
		this.ajax.formRequest(form, reset, callback, scope);
	},

	createReply : function(targetItemID, memo, bPrivate, updateDate, callback, scope)
	{
		var grade = 1;

		if (bPrivate)
			grade = 0;

    	var query = "model=log" +
    				"&view=json" +
    				"&mode=add_ref" +
    				"&item_id=" + targetItemID +
					"&memo=" + memo.encodeSP() +
					"&grade=" + grade;

        if (updateDate)
    		query += "&update_date=" + updateDate;   //2007-08-22 22:00:01

		this.ajax.request(query, callback, scope);
	},

	delGrant : function(itemId, callback, scope)
	{
		var query = "model=log&view=json&mode=del_grant&item_id="+itemId;

		this.ajax.request(query, callback, scope, null, null, itemId);
	},

	get : function(property, userID, startDate, endDate, start, limit, class1, category, getType, mark_read, contentsId, callback, scope)
	{

    	var query = "model=log" +
    				"&view=json" +
    				"&mode=get" +
    				"&property=" + property +
    				"&item_class_id=" + class1;
    				//"&item_type="+ itemType +

		if(start !== undefined)
		query += "&start=" + start;

		if(limit)
		query += "&limit=" + limit;

		if(userID)
			query	+= "&user_id=" + userID.encode();

		if(getType)
			query	+= "&get_type="+ getType ;

		if(category)
			query += "&category_id=" + category;

    if(startDate)
			query += "&start_date=" + startDate;

		if(endDate)
			query += "&end_date="+ endDate;

		if(mark_read)
			query += "&mark_read="+ mark_read;

		if(contentsId)
			query += "&contents_id="+ contentsId;

		this.ajax.request(query, callback, scope);
	},

	getReply : function (targetItemID, start, limit, mark_read, callback, scope, parentItem)
	{
    	var query = "model=log" +
    				"&view=json" +
    				"&mode=get_ref" +
    				"&property=recent" +
    				"&item_id=" + targetItemID +
    				"&start=" + start +
    				"&limit=" + limit;

		if (mark_read)
			query += "&mark_read="+ mark_read;

		this.ajax.request(query, callback, scope, null, null, parentItem);
	},

	remove : function(userID, targetItemID, updateDate, startItemID, class1, category, getType,  callback, scope) //, icallback, iscope, pass)
	{
    	var query = "model=log" +
    				"&view=json" +
    				"&mode=del" +
    				"&item_id=" + targetItemID +
    				"&user_id=" + userID.encode() +
    				"&item_class_id=" + class1;

		if(getType)
			query	+= "&get_type="+ getType ;
		if(category)
			query += "&category_id=" + category;

		// update
		if (startItemID)
			query += "&start_item_id=" + startItemID;

    if (updateDate)
			query += "&update_date=" + updateDate;   //2007-08-22 22:00:01

		this.ajax.request(query, callback, scope); //, icallback, iscope, pass);
	},

	modify : function(targetItemID, memo, updateDate, startItemID, grade, category_id, callback, scope)
	{
    	var query = "model=log" +
    				"&view=json" +
    				"&mode=modify" +
    				"&item_id=" + targetItemID;

    if(memo)
			query += "&memo=" + memo.encode();
		if(grade !== undefined)
			query += "&read_grade=" + grade;
		if (startItemID)
			query += "&start_item_id=" + startItemID;
    if (updateDate)
    	query += "&update_date=" + updateDate;   //2007-08-22 22:00:01
		if(category_id)
			query += "&category_id=" + category_id;

		this.ajax.request(query, callback, scope);
	},

	addAgree : function (itemID, callback, scope, item)
	{
	    var query = "model=log" +
    				"&view=json" +
    				"&mode=agree" +
    				"&item_id=" + itemID;

		this.ajax.request(query, callback, scope, null, null, item);
	},

	getAncItemInfo : function(item_id, callback, scope){
		var query = "model=log&view=json&mode=get_anc_item_info&item_id="+item_id;

		this.ajax.request(query, callback, scope);
	},

	search : function(property, start, limit, class1, keyword, userID, getType, callback, scope)
	{
		var query = "model=log" +
    				"&view=json" +
    				"&mode=get" +
    				"&keyword=" + keyword +
    				"&property=" + property +
    				"&item_class_id=" + class1;
    				//"&item_type="+ itemType +

		if(start || start==0)
		query += "&start=" + start;


		if(limit)
		query += "&limit=" + limit;

		if(userID)
			query	+= "&user_id=" + userID.encode();

		if(getType)
			query	+= "&get_type="+ getType ;

    	this.ajax.request(query, callback, scope);
	},

	getPopularUser : function(category_id, start, limit, callback, scope)
	{
		var query = "model=category" +
						"&view=json" +
						"&mode=get_popular_user" +
						"&category_id=" + category_id;
		if(start == 0 || start) {
			query += "&start=" + start;
			query += "&limit=" + limit;
		}

		this.ajax.request(query, callback, scope);
	},

	getHotIssue : function(type, start, limit, dateflag, date, update_flag, callback, scope)
	{
		var query = "model=log" +
					"&view=json" +
					"&mode=get_main_log_section" +
					"&type=" + type;

		if(dateflag)
			query += "&date_flag=" + dateflag;

		if(update_flag)
			query += "&update_flag=" + update_flag;

		if(date)
			query += "&date=" + date;

		if(start && limit) {
			query += "&start=" + start;
			query += "&limit=" + limit;
		}

		this.ajax.request(query, callback, scope);
	},

	getTownLog : function(property, userID, start, limit, item_class_id, category_id, getType, callback, scope)
	{
  	var query = "model=log" +
  				"&view=json" +
  				"&mode=get" +
  				"&property=" + property +
  				"&start=" + start +
  				"&limit=" + limit;

		if(item_class_id)
			query	+= "&item_class_id=" + item_class_id;

		if(userID)
			query	+= "&user_id=" + userID.encode();

		if(category_id)
			query += "&category_id="+category_id;

		if(getType)
			query	+= "&get_type="+ getType;

		query +="&count_ref=0";

		this.ajax.request(query, callback, scope);
	},

	getTownEventLog : function(mode, userID, start, limit, category_id, query_date, class_id, callback, scope)
	{
		var query = "model=log" +
						"&view=json" +
						"&mode=" + mode;

		if(userID)
			query	+= "&user_id=" + userID.encode();
		if(start)
			query	+= "&start=" + start;
		if(limit)
			query	+= "&limit=" + limit;
		if(category_id)
			query += "&category_id="+category_id;
		if(query_date)
			query += "&query_date="+query_date;
		if(class_id)
			query += "&item_class_id="+class_id;

		this.ajax.request(query, callback, scope);
	},

	getBestLog : function(mode, start, limit, callback, scope)
	{
		var query = "model=user" +
						"&view=json" +
						"&mode=" + mode;
		if(start)
			query	+= "&start=" + start;
		if(limit)
			query	+= "&limit=" + limit;

		this.ajax.request(query, callback, scope);
	},

	getMainItem : function(mode, section_id, start, limit, callback, scope)
	{
		var query = "model=log" +
						"&view=json" +
						"&mode=" + mode;
		if(section_id)
			query	+= "&section_id=" + section_id;
		if(start)
			query	+= "&start=" + start;
		if(limit)
			query	+= "&limit=" + limit;

		this.ajax.request(query, callback, scope);
	},


	modifyGuide : function(guide_state, callback, scope){
	var query = "model=profile&view=json&mode=set_guide_state&guide_state=" + guide_state;
	this.ajax.request(query, callback, scope);
	},

	getSearchLog : function(item_class_id, category_id, keyword, start, limit, callback, scope)
	{
		var query = "model=log" +
					"&view=json" +
					"&mode=find_item" +
					"&start=" + start +
					"&limit=" + limit;

		if(keyword)
			query += "&keyword=" + keyword;
		if(item_class_id)
			query	+= "&item_class_id=" + item_class_id;

		if(category_id)
			query += "&category_id="+category_id;

		this.ajax.request(query, callback, scope);
	},

	getSingleItem : function(item_id, callback,scope)
	{
  	var query = "model=log&view=json&mode=get_item_view&item_id="+item_id;
		this.ajax.request(query, callback, scope);
	}

});

Mys.Model.Group = function()
{
	Mys.Model.Group.superclass.constructor.call(this);
};

Ext.extend(Mys.Model.Group, Mys.Model,
{
	events : {
		"join" : true,
		"withdraw" : true
	},

	get : function(keyword, callback, scope)
	{
		var query = "model=group&view=json&mode=get_search&keyword=" + keyword.encode();

		this.ajax.request(query, callback, scope);
	},

	getPart : function(start, limit, callback, scope)
	{
		var query = "model=group&view=json&mode=get&start=" + start + "&limit="+limit;

		this.ajax.request(query, callback, scope);
	},

	getMember : function(groupID, start, limit,callback, scope)
	{
		var query = "model=group&view=json&mode=get_member&grade=9&group_id=" + groupID + "&start=" + start + "&limit=" + limit;

		this.ajax.request(query, callback, scope);
	},

/* type =  "latest":최근참여자 , "popular":인기참여자
	  group_id  - 값이 있으면 해당채널에서 없으면 전체 채널에서..
*/
	getMemberWithCondi : function(groupID, start, limit, type, callback, scope)
	{
		var query = "model=group&view=json&mode=get_member_"+type+"&start=" + start + "&limit=" + limit;

		if(groupID)
		query += "&group_id="+groupID;

		this.ajax.request(query, callback, scope);
	},

	getGrant : function(calID, callback, scope)
	{
		var query = "model=group&view=json&mode=get_grant&cal_id=" + calID;

		this.ajax.request(query, callback, scope);
	},

	checkGroup : function(domain, callback, scope)
	{
		var query = "model=group&view=json&mode=check_group&domain=" + domain.encode();

		this.ajax.request(query, callback, scope);
	},

	checkName : function(name, callback, scope)
	{
		var query = "model=user&view=json&mode=check_name&name=" + name.encode();

		this.ajax.request(query, callback, scope);
	},

	create : function(name, domain, groupType, intro, callback, scope)
	{
		var query = "model=group&view=json&mode=create&name=" + name.encode() + "&domain=" + domain.encode() + "&group_type=" + groupType + "&intro=" + intro.encode();

		query += "&searchable=0";
		this.ajax.request(query, callback, scope);
	},

//공개채널 및 개인채널용
  createInfoChannel : function(name, domain, searchable, get_type, callback, scope)
  {
		var query = "model=group&view=json&mode=create&name=" + name.encode() + "&domain=" + domain.encode() + "&group_type=" + get_type;
		query += "&searchable="+searchable;
		this.ajax.request(query, callback, scope);
  },

//공개채널 만드는 API
  createChannel : function(name, callback, scope)
  {
		var query = "model=group&view=json&mode=create_channel&name=" + name.encode();

		this.ajax.request(query, callback, scope);
  },

	setFolder : function(groupID, folderID)
	{
		var query = "model=group&view=json&mode=move&group_id=" + groupID + "&folder_id=" + folderID;

		this.ajax.request(query);
	},

	join : function(groupID, password, callback, scope)
	{
		var query = "model=group&view=json&mode=join&group_id=" + groupID;

		if(typeof(password) != "undefined" && !password)
			query += "&password="+password;

		this.ajax.request(query, callback, scope);
	},

	withdraw : function(groupID, callback, scope)
	{
		var query = "model=group&view=json&mode=withdraw&group_id=" + groupID;

		this.ajax.request(query, callback, scope);
	},

	modify : function(groupId, searchable, groupType, password, passwordClue, callback, scope)
	{
		var query ="model=group&view=json&mode=modify&group_id="+groupId;

		if(typeof(searchable) != "undefined" && searchable != null)
			query += "&searchable="+searchable;

		if(typeof(groupType) != "undefined" && groupType != null)
			query += "&group_type="+groupType;

		if(typeof(password) != "undefined" && password != null)
			query += "&password="+password;

		if(typeof(passwordClue) != "undefined" && passwordClue != null)
			query += "&password_clue="+passwordClue;

		this.ajax.request(query, callback, scope);
	},

	inviteEmail : function(groupID, userID, msg, callback, scope)
	{
		query = "model=group&view=json&mode=invite_email&group_id=" +  groupID.encode() + "&msg=" + msg.encode();

		if(typeof userID == "object")
		{
			for(i=0 ; i< userID.length ; i++)
				query += '&user_id['+i+']=' + userID[i].encode();
		}
		else
			query += "&user_id=" + userID.encode();

		this.ajax.request(query, callback, scope);
	},

	inviteURL : function(groupID, msg, callback, scope)
	{
		query = "model=group&view=json&mode=invite_url&group_id=" + groupID.encode() + "&msg=" + msg.encode();

		if(confirm(query))
			this.ajax.request(query, callback, scope);
	},

	accept : function(isAccept, inviteID, callback, scope, passData)
	{
		var query = "model=group&view=json&mode=accept&accept=" + (isAccept ? 1 : 0) + "&invite_id=" + inviteID;

		this.ajax.request(query, callback, scope, this.onAccept, this, passData);
	},

// type :::  'public'=공개채널 순서없이, 'ranking'=총글개수 순(days 필요), 'lastest'=최근 만들어진 순, 'latest_updated'=최근 업데이트 순
	getChannelList : function(type, start, limit, days, callback, scope)
	{
		query = "model=group&view=json&mode=get_"+type+"_groups";

		if(start !== undefined)
		  query+="&start="+start;
		if(limit !== undefined)
		  query+="&limit="+limit;
		if(days !== undefined)
		  query+="&days="+days;

		this.ajax.request(query, callback, scope);
	},

/* point 순대로 채널을 가져온다
  class:
  ,CHANNEL_CLASS_ALL : 0
  ,CHANNEL_CLASS_KEYWORD : 1
  ,CHANNEL_CLASS_MOVIE : 2
  ,CHANNEL_CLASS_BOOK : 3
  ,CHANNEL_CLASS_SHOP : 4
  ,CHANNEL_CLASS_RSS : 5

  point: 최소점수
*/
	getChannelByPoint : function(classType, start, limit, point, callback, scope)
	{
		query = "model=group&view=json&mode=get_groups_point&class="+classType;

		if(start !== undefined)
		  query+="&start="+start;
		if(limit !== undefined)
		  query+="&limit="+limit;
		if(point !== undefined)
		  query+="&point="+point;

		this.ajax.request(query, callback, scope);
	},

//  searchable  0 : 공공채널 , 1 : 개인채널
// 다른 사람의 log에 갔을때만 user_id를 준다
	getChannelListByType : function(user_id, searchable, start, limit, callback, scope)
	{
		var query = "model=group&view=json&mode=get&searchable="+searchable+"&start="+start+"&limit="+limit;

		if(user_id) query +="&user_id="+user_id.encode();

		this.ajax.request(query, callback, scope);
	}
});


/* 외부 주소록 가져오기 Model*/
Mys.Model.Extaddr = function()
{
	Mys.Model.Extaddr.superclass.constructor.call(this);
};

Ext.extend(Mys.Model.Extaddr, Mys.Model,
{
  //site :  nate, daum, paran, naver, gmail
	get : function(id, pwd, site, callback, scope)
	{
		var query = "model=extaddr&view=json&mode=get_ext_addr&id=" + id.encode() + "&pwd=" + pwd.encode() + "&site=" + site;

		this.ajax.request(query, callback, scope);
	}

	,getInvitedEmailAddress : function(callback, scope)
	{
		var query = "model=extaddr&view=json&mode=get_invite_addr";
		this.ajax.request(query, callback, scope);
	}
});

Mys.Model.Mobile = function()
{
	Mys.Model.Mobile.superclass.constructor.call(this);
};

Ext.extend(Mys.Model.Mobile, Mys.Model,
{
	sendMiniNum : function(callback, scope){
		var query = "model=mobile&view=json&mode=send_mo_number";
		this.ajax.request(query, callback, scope);
	}
});


/* 자동 완성 Model*/
Mys.Model.KeywordComplete = function()
{
	Mys.Model.KeywordComplete.superclass.constructor.call(this);
};

Ext.extend(Mys.Model.KeywordComplete, Mys.Model,
{
  //except_user_id : 자기자신은 카운팅에서 제외시킨다.
	getLike : function(keyword, code, except_user_id, callback, scope)
	{
		var query = "model=keyword&view=json&mode=get_like&keyword=" + keyword.encode() + "&code=" + code + "&except_user_id=" + except_user_id.encode();

		this.ajax.request(query, callback, scope);
	}
});


Permaink = function(group, friend)
{
	this.group = group;
	this.friend = friend;
	this.imgPath = Global.isMain ? "/minilog/" : "/";
	this.init();
};

Permaink.prototype =
{
	init : function (){
		var listWidth = 0;
		this.visible = false;
		this.btnEl = Ext.get("permalink");
		this.listEl = Ext.get("permalinkList");
		if(this.btnEl && this.listEl)
		{
			this.list();
			this.btnEl.on("click", this.show, this);


			if(Global.noticeCount != 0)
				listWidth += 8;

			this.listEl.setStyle("right", listWidth+ 26 + "px");
		}
	}
	,show : function (evt, t){
		var left;
		if(this.visible==false){
			this.listEl.setStyle("display","block");

			this.visible = true;

			(function(){Ext.get(document.body).on("click", this.off, this)}).defer(100, this);
		}
		else{
			this.listEl.setStyle("display","none");
			this.visible = false;
		}
	}

	,off : function (){
			this.visible = false;
			Ext.get(document.body).un("click", this.off);
			this.listEl.setStyle("display","none");
	}

	,list : function (){
		// 안에 값을 넣기
		var i;
		var string = '';
		var name;

		string += '<ul id="otherList" class="perSub" style="background:none">';
		string += '<li><a href="http://'+DOMAIN+'/help_desk">고객센터</a></li>';
		string += '<li><a href="http://'+PAGE_USER_DOMAIN + "." + DOMAIN+'/manage/invitefriend" target="_blank">친구초대</a></li>';
		string += '<li><a href="http://'+PAGE_USER_DOMAIN + "." + DOMAIN+'/skin" target="_blank">스킨설정</a></li>';
		string += '<li><a href="http://'+DOMAIN+'/miniCalendar/miniCal.htm?user_id='+EXT_SESSION.getID()+'" target="_blank">일정관리</a></li>';
		string += '</ul>';
		listHeight = 53;
		if(this.group.total)
		{
			string += '<ul id="groupList" class="perSub">';
			for(i=0;i<this.group.total;i++){
				notifyNew = "";
				dateAdd = this.group.group[i].last_add_date?this.group.group[i].last_add_date:0;
				dateVisit = this.group.group[i].last_visit_date?this.group.group[i].last_visit_date:0;
				if((dateAdd && !dateVisit) || (dateAdd > dateVisit))
					notifyNew = "<img src='"+this.imgPath+"images/header/notify-new.gif'/>";
				name = this.group.group[i].name.ellipsis(14);
				string += '<li><a href="http://' + this.group.group[i].mydomain + '.' + DOMAIN + '">'+ name + '</a>' + notifyNew + '</li>';
			}
			string += '</ul>';
			listHeight += this.group.total * 18 + 2;
		}

		if(this.friend.total)
		{
			string += '<ul id="friendList" class="perSub">';
			for(i=0;i<this.friend.total;i++){
				notifyNew = "";
				dateAdd = this.friend.friend[i].last_add_date?this.friend.friend[i].last_add_date:0;
				dateVisit = this.friend.friend[i].last_visit_date?this.friend.friend[i].last_visit_date:0;
				if((dateAdd && !dateVisit) || (dateAdd > dateVisit))
					notifyNew = "<img src='"+this.imgPath+"images/header/notify-new.gif'/>";
				name = this.friend.friend[i].name.ellipsis(14);
				string += '<li><a href="http://' + this.friend.friend[i].mydomain + '.'+DOMAIN+'">'+ name + '</a>' + notifyNew + '</li>';
			}
			string += '</ul>';
			listHeight += this.friend.total * 18 + 2;
		}

		this.listEl.update(string);
		if(listHeight < 365)
			Ext.get("permalinkList").setStyle("height" ,listHeight+4 + "px");
		else
			Ext.get("permalinkList").setStyle("overflow-y", "scroll");
	}
}


/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }

/*
 * Perform a simple self-test to see if the VM is working
 */
function md5_vm_test()
{
  return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}

/*
 * Calculate the MD5 of an array of little-endian words, and a bit length
 */
function core_md5(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << ((len) % 32);
  x[(((len + 64) >>> 9) << 4) + 14] = len;

  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;

    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);

    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);

    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
  }
  return Array(a, b, c, d);

}

/*
 * These functions implement the four basic operations the algorithm uses.
 */
function md5_cmn(q, a, b, x, s, t)
{
  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
  return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
 * Calculate the HMAC-MD5, of a key and some data
 */
function core_hmac_md5(key, data)
{
  var bkey = str2binl(key);
  if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
  return core_md5(opad.concat(hash), 512 + 128);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function bit_rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * Convert a string to an array of little-endian words
 * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
 */
function str2binl(str)
{
  var bin = Array();
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < str.length * chrsz; i += chrsz)
    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
  return bin;
}

/*
 * Convert an array of little-endian words to a string
 */
function binl2str(bin)
{
  var str = "";
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
  return str;
}

/*
 * Convert an array of little-endian words to a hex string.
 */
function binl2hex(binarray)
{
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
           hex_tab.charAt((binarray[i>>2] >> ((i%4)*8  )) & 0xF);
  }
  return str;
}

/*
 * Convert an array of little-endian words to a base-64 string
 */
function binl2b64(binarray)
{
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   >> 2] >> 8 * ( i   %4)) & 0xFF) << 16)
                | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
                |  ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
    }
  }
  return str;
}


// Simple Set Clipboard System by Joseph Huckaby */
var ZeroClipboard = {

	version: "1.0.4",
	clients: {}, // registered upload clients on page, indexed by id
	moviePath: '/includes/ZeroClipboard.swf', // URL to movie
	nextId: 1, // ID of next movie

	$: function(thingy) {
		// simple DOM lookup utility function
		if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
		if (!thingy.addClass) {
			// extend element with a few useful methods
			thingy.hide = function() { this.style.display = 'none'; };
			thingy.show = function() { this.style.display = ''; };
			thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
			thingy.removeClass = function(name) {
				this.className = this.className.replace( new RegExp("\\s*" + name + "\\s*"), " ").replace(/^\s+/, '').replace(/\s+$/, '');
			};
			thingy.hasClass = function(name) {
				return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
			}
		}
		return thingy;
	},

	setMoviePath: function(path) {
		// set path to ZeroClipboard.swf
		this.moviePath = path;
	},

	dispatch: function(id, eventName, args) {
		// receive event from flash movie, send to client
		var client = this.clients[id];
		if (client) {
			client.receiveEvent(eventName, args);
		}
	},

	register: function(id, client) {
		// register new client to receive events
		this.clients[id] = client;
	},

	getDOMObjectPosition: function(obj) {
		// get absolute coordinates for dom element
		var info = {
			left: 0,
			top: 0,
			width: obj.width ? obj.width : obj.offsetWidth,
			height: obj.height ? obj.height : obj.offsetHeight
		};

		info.left = Ext.get(obj).getX();
		info.top = Ext.get(obj).getY();
/*		while (obj) {
			info.left += obj.offsetLeft;
			info.top += obj.offsetTop;
			obj = obj.offsetParent;
		}*/

		return info;
	},

	Client: function(elem) {
		// constructor for new simple upload client
		this.handlers = {};

		// unique ID
		this.id = ZeroClipboard.nextId++;
		this.movieId = 'ZeroClipboardMovie_' + this.id;

		// register client with singleton to receive flash events
		ZeroClipboard.register(this.id, this);

		// create movie
		if (elem) this.glue(elem);
	}
};

ZeroClipboard.Client.prototype = {

	id: 0, // unique ID for us
	ready: false, // whether movie is ready to receive events or not
	movie: null, // reference to movie object
	clipText: '', // text to copy to clipboard
	handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
	cssEffects: true, // enable CSS mouse effects on dom container
	handlers: null, // user event handlers

	glue: function(elem) {
		// glue to DOM element
		// elem can be ID or actual DOM element object
		this.domElement = ZeroClipboard.$(elem);

		// float just above object, or zIndex 99 if dom element isn't set
		var zIndex = 99;
		if (this.domElement.style.zIndex) {
			zIndex = parseInt(this.domElement.style.zIndex) + 1;
		}

		// find X/Y position of domElement
		var box = ZeroClipboard.getDOMObjectPosition(this.domElement);

		// create floating DIV above element
		this.div = document.createElement('div');
		var style = this.div.style;
		style.position = 'absolute';
		style.left = '' + box.left + 'px';
		style.top = '' + box.top + 'px';
		style.width = '' + box.width + 'px';
		style.height = '' + box.height + 'px';
		style.zIndex = zIndex;

		// style.backgroundColor = '#f00'; // debug

		var body = document.getElementsByTagName('body')[0];
		body.appendChild(this.div);

		this.div.innerHTML = this.getHTML( box.width, box.height );
	},

	getHTML: function(width, height) {
		// return HTML for movie
		var html = '';
		var flashvars = 'id=' + this.id +
			'&width=' + width +
			'&height=' + height;

		if (navigator.userAgent.match(/MSIE/)) {
			// IE gets an OBJECT tag
			var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
			html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
		}
		else {
			// all other browsers get an EMBED tag
			html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
		}
		return html;
	},

	hide: function() {
		// temporarily hide floater offscreen
		if (this.div) {
			this.div.style.left = '-2000px';
		}
	},

	show: function() {
		// show ourselves after a call to hide()
		this.reposition();
	},

	destroy: function() {
		// destroy control and floater
		if (this.domElement && this.div) {
			this.hide();
			this.div.innerHTML = '';

			var body = document.getElementsByTagName('body')[0];
			try { body.removeChild( this.div ); } catch(e) {;}

			this.domElement = null;
			this.div = null;
		}
	},

	reposition: function(elem) {
		// reposition our floating div, optionally to new container
		// warning: container CANNOT change size, only position
		if (elem) {
			this.domElement = ZeroClipboard.$(elem);
			if (!this.domElement) this.hide();
		}

		if (this.domElement && this.div) {
			var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
			var style = this.div.style;
			style.left = '' + box.left + 'px';
			style.top = '' + box.top + 'px';
		}
	},

	setText: function(newText) {
		// set text to be copied to clipboard
		this.clipText = newText;
		if (this.ready) this.movie.setText(newText);
	},

	addEventListener: function(eventName, func) {
		// add user event listener for event
		// event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
		eventName = eventName.toString().toLowerCase().replace(/^on/, '');
		if (!this.handlers[eventName]) this.handlers[eventName] = [];
		this.handlers[eventName].push(func);
	},

	setHandCursor: function(enabled) {
		// enable hand cursor (true), or default arrow cursor (false)
		this.handCursorEnabled = enabled;
		if (this.ready) this.movie.setHandCursor(enabled);
	},

	setCSSEffects: function(enabled) {
		// enable or disable CSS effects on DOM container
		this.cssEffects = !!enabled;
	},

	receiveEvent: function(eventName, args) {
		// receive event from flash
		eventName = eventName.toString().toLowerCase().replace(/^on/, '');

		// special behavior for certain events
		switch (eventName) {
			case 'load':
				// movie claims it is ready, but in IE this isn't always the case...
				// bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
				this.movie = document.getElementById(this.movieId);
				if (!this.movie) {
					var self = this;
					setTimeout( function() { self.receiveEvent('load', null); }, 1 );
					return;
				}

				// firefox on pc needs a "kick" in order to set these in certain cases
				if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
					var self = this;
					setTimeout( function() { self.receiveEvent('load', null); }, 100 );
					this.ready = true;
					return;
				}

				this.ready = true;
				this.movie.setText( this.clipText );
				this.movie.setHandCursor( this.handCursorEnabled );
				break;

			case 'mouseover':
				if (this.domElement && this.cssEffects) {
					this.domElement.addClass('hover');
					if (this.recoverActive) this.domElement.addClass('active');
				}
				break;

			case 'mouseout':
				if (this.domElement && this.cssEffects) {
					this.recoverActive = false;
					if (this.domElement.hasClass('active')) {
						this.domElement.removeClass('active');
						this.recoverActive = true;
					}
					this.domElement.removeClass('hover');
				}
				break;

			case 'mousedown':
				if (this.domElement && this.cssEffects) {
					this.domElement.addClass('active');
				}
				break;

			case 'mouseup':
				if (this.domElement && this.cssEffects) {
					this.domElement.removeClass('active');
					this.recoverActive = false;
				}
				break;
			case 'complete':
				alert("주소가 복사 되었습니다");
				break;
		} // switch eventName

		if (this.handlers[eventName]) {
			for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
				var func = this.handlers[eventName][idx];

				if (typeof(func) == 'function') {
					// actual function reference
					func(this, args);
				}
				else if ((typeof(func) == 'object') && (func.length == 2)) {
					// PHP style object + method, i.e. [myObject, 'myMethod']
					func[0][ func[1] ](this, args);
				}
				else if (typeof(func) == 'string') {
					// name of function
					window[func](this, args);
				}
			} // foreach event handler defined
		} // user defined handler for event
	}

};

/*	Mys.LayerNavi
	author : 코리아몽키
	description : 사용자 사진 클릭 시 뜨는 팝업 네비
	errorCode : 800
*/
Mys.LayerNavi =
{
	naviTemplate : '<ul class="layerNavi none"><li><a href ="#" class="showPic" target="_blank">사진 크게보기</a></li><li><a href="#" class="goLog">미니로그 가기</a></li><li><a href="#" onclick="return false" class="applyFriend">친구 신청하기</a></li><li><a href="#" onclick="return false" class="addRefuser">댓글 차단하기</a></li></ul>'

	,initalize : function(){
		this.naviEl = Ext.get(document.body).insertHtml("afterBegin", this.naviTemplate, true);
		this.naviEl.unselectable();

		this.applyFriendBtn = this.naviEl.child(".applyFriend");
		this.showPicBtn = this.naviEl.child(".showPic");
		this.goLogBtn = this.naviEl.child(".goLog");
		this.addRefuserBtn = this.naviEl.child(".addRefuser");

		this.applyFriendBtn.on("click", this.applyFriend, this);
		this.addRefuserBtn.on("click", this.addRefuser, this);

		if(!Global.modelUser) Global.modelUser = new Mys.Model.User;

		Ext.isIE?(function(){this.set()}).defer(500, this):this.set();
	}
	,addRefuser : function(){
		if(!confirm("정말 차단하시겠습니까?"))
			return;

		Global.refuserData.push({user_id : this.userId});
		Global.modelUser.addReplyRefuser([this.userId], this.cbAddRefuser, this);
	}

	,cbAddRefuser : function(data){
		if(!data || data.response.code != 100){window.status="내부 에러 800"; return;}

		alert("차단 되었습니다");
	}

	,goLog : function(){
		if(!this.userDomain)
			return;

		window.location.href = "http://"+this.userDomain+"."+DOMAIN;
	}

	,showPic : function(){
		var url = this.userImage;
		if(!url)
			return;

		var uploadNo = url.substring(url.lastIndexOf('=')+1);
		var fileName = url.substring(url.indexOf('&filename')+10,url.lastIndexOf('&'));

		window.open("http://"+DOMAIN+"/minilog/imageView.html?fileName="+fileName+"&uploadNo="+uploadNo, "image");
	}

	,applyFriend : function(){
		if(!this.userId)
			return;

		if(typeof(Global.friendData) == "undefined" || !Global.friendData) Global.friendData = [];

		if(!Global.friendData.friend) Global.friendData.friend = [];

		Global.friendData.friend.push({friend_id : this.userId});

		this.hideNavi();

		Global.modelFriend.apply(this.userId, this.cbApplyFriend, this);
	}

	,cbApplyFriend : function(data){
		if(data.response.code != 100){alert(data.response.message);return;}

		alert("친구 신청이 완료되었습니다.");
	}

	,set : function(){
		var iconBox = Ext.select(".userIcon");

		iconBox.on("click", this.showNavi, this);

		iconBox.removeClass("userIcon");
	}

	,resetVariable:function(){
	/*	this.userImage = null;
		this.userDomain = null;
		this.groupFlag = false; */
		this.userId = null;
	}

	,showNavi : function(evt, t){
		// Navi가 열려있을 때 다시 사진을 클릭했을 경우 Navi가 안열리는 현상 방지.
		this.hideNavi();
		this.resetVariable();
		var url, uploadNo, friendList, fileName, i, cnt, arr, hasImage = false, isFriend = false, useRefuser = false, isGroup = false;

		var sibling = t;

		while(sibling)
		{
			if(sibling.nodeType != 1){sibling = sibling.nextSibling; continue;}

			switch(sibling.className)
			{
				case "group" :
					isGroup = (sibling.innerHTML == "1")?true:false;
					break;

				case "userImage" :
					url = sibling.src;

					if(url.indexOf("cmd.htm") != -1)
					{
						uploadNo = url.substring(url.lastIndexOf('=')+1);
						fileName = url.substring(url.indexOf('&filename')+10,url.lastIndexOf('&'));

						query = "fileName="+fileName+"&uploadNo="+uploadNo;

						hasImage = true;

						this.showPicBtn.dom.href = "http://"+DOMAIN+"/minilog/imageView.html?"+query;
					}
					break;

				case "domain" :
					this.goLogBtn.dom.href = "http://"+decode64(sibling.innerHTML)+"."+DOMAIN;
					break;

				case "userId" :
					this.userId = decode64(sibling.innerHTML);
					break;

				case "refuser" :
					useRefuser = (sibling.innerHTML == "1")?true:false;
			}

			sibling = sibling.nextSibling;
		}

		//친구 확인.
		arr = Global.friendData;
		if(typeof(arr) != "undefined" && arr !== null && arr.friend !== null){
			arr = arr.friend;
			cnt = arr.length;
			for(i = 0; i < cnt; i ++){

				if(arr[i].friend_id == this.userId){
					isFriend = true;
					break;
				}
			}
		}

		//댓글 차단자인지 확인
		arr = Global.refuserData;

		if(typeof(arr) != "undefined" && arr !== null){
			cnt = arr.length;
			for(i = 0; i < cnt; i++){
				if(arr[i].user_id == this.userId){
					useRefuser = false;
					break;
				}
			}
		}

		(!hasImage)?this.showPicBtn.parent("li").addClass("none"):this.showPicBtn.parent("li").removeClass("none");

		(!EXT_SESSION.isLog() || this.userId == EXT_SESSION.getID() || isFriend || isGroup)?this.applyFriendBtn.parent("li").addClass("none"):this.applyFriendBtn.parent("li").removeClass("none");

		(typeof(PAGE_USER_ID) == "undefined" || LOG_USER_ID != EXT_SESSION.getID() || !EXT_SESSION.isLog() || this.userId == EXT_SESSION.getID() || !useRefuser)?this.addRefuserBtn.parent("li").addClass("none"):this.addRefuserBtn.parent("li").removeClass("none");

		this.naviEl.removeClass("none");

		this.naviEl.alignTo(t, "c");

		(function(){Ext.fly(document.body).on("click", this.hideNavi, this);}).defer(100, this);
	}

	,hideNavi : function(){
		Ext.fly(document.body).un("click", this.hideNavi);

		this.naviEl.addClass("none");
	}
}

Mys.NoticeCtrl = function(config){
	Ext.apply(this, config);

	this.initialize();
}


Mys.NoticeCtrl.prototype = {
	start : 0,
	limit : 5,
	imageUrl : "/images/icon",

	listTemplate : new Ext.Template("<li class='{className}'><a href='#' onclick='return false' title='{title}' id='{item_id}'>{name}{group}{text}</a></li>"),

	initialize : function(){
		var imageUrl = (Global.isMain)?"/minilog/images/icon":"/images/icon";


		var template = '<div class="notice none">' +
						'<div class="header">' +
							'<span>알림</span>' +
							//'<a class="more" href="http://'+EXT_SESSION.getDomain()+'.'+DOMAIN+'/notice">more...</a>' +
							'<span class="none loading"><img src="'+imageUrl+'/icon_notice_loading.gif" alt="로딩 중..."/></span>' +
							'<span class="btn">' +
								'<a href="#" class="clean none" onclick="return false"><img src="'+imageUrl+'/btn_notify_clean.gif" alt="알림 삭제하기"/></a>' +
								'<a href="#" class="refresh" onclick="return false"><img src="'+imageUrl+'/btn_notice_refresh.gif" alt="알림 새로고침"/></a>' +
								'<a href="#" class="close"onclick="return false"><img src="'+imageUrl+'/btn_notice_close.gif" alt="알림 닫기" class="closeImg"/></a>' +
							'</span>' +
						'</div>' +
						'<ul class="body"></ul>' +
						'<div class="navi none">' +
							'<a href="#" class="prev none" onclick="return false"><img src="'+imageUrl+'/btn_notice_prev.gif" alt="알림 다음"/></a>' +
							'<a href="#" class="next none" onclick="return false"><img src="'+imageUrl+'/btn_notice_next.gif" alt="알림 이전"/></a>' +
						'</div>' +
						'<form class="goLogForm" method="POST" action="" target="_self">' +
							'<input type="hidden" name="item_id" value=""/>' +
							'<input type="hidden" name="ref_item_id" value=""/>' +
						'</form>' +
					'</div>'

		this.el = Ext.fly("headerPopup").insertHtml("beforeEnd", template, true);
		this.el.unselectable();

		this.loadingEl = this.el.child(".loading");
		this.bodyEl = this.el.child(".body");
		this.formEl = this.el.child(".goLogForm");

		this.noticeBtn = Ext.get("noticeBtn");
		this.prevBtn = this.el.child(".prev");
		this.nextBtn = this.el.child(".next");
		this.cleanBtn = this.el.child(".clean");
		this.naviEl = this.el.child(".navi");
		var refreshBtn = this.el.child(".refresh");
		var closeBtn = this.el.child(".close");
		var openBtn = Ext.fly(this.openBtnName);

		this.cleanBtn.on("click", this.clean, this);
		this.prevBtn.on("click", this.get, this, -1);
		this.nextBtn.on("click", this.get, this, +1);
		refreshBtn.on("click", this.get, this, 0);
		closeBtn.on("click", this.hide, this);
		openBtn.on("click", this.toggle, this);
			//	this.el.alignTo(openBtn, "bl", [-149,7]);
	},

	toggleLoading : function(showFlag){
			showFlag?this.loadingEl.removeClass("none"):this.loadingEl.addClass("none");
	},

	 toggle : function(evt, t){
	 	if(!this.el.isDisplayed()){
			this.get();

			(function(){Ext.fly(document.body).on("click", this.hide, this)}).defer(300, this);
			this.el.removeClass('none');
	 	}
	 	else{
			this.hide();
	 	}
	},

	hide : function(evt, t){
		if(!t || t.className != "closeImg" && this.el.contains(t))
			return;

		Ext.fly(document.body).un("click", this.hide, this);
		this.el.addClass('none');
	},

	clean : function(evt, t){
		var answer = confirm("모든 알림을 읽음 처리 하시겠습니까? (원하시면 확인 버튼을 클릭해주세요)");

		if(!answer) return;

		Global.modelHistory.readAll(null, this.cbClean, this);
	},

	cbClean : function(data){
		if(data.response.code != 100){alert(data.response.message); return}

		this.get();
	},

	get : function(evt, t, type){
		// on 함수에서 obj에 0을 줬을 때 예외 처리.
		if(typeof(type)== "object") type = 0;

		(typeof(type) == "undefined")?this.start = 0:this.start += this.limit * type;

		if(this.start < 0) this.start = 0;


		this.toggleLoading(true);
		Global.modelHistory.getAll(0, this.start, this.limit, this.cbGet, this);
	},

	// button Visible set
	toggleBtn : function(){
		(this.start === 0)?this.prevBtn.addClass("none"):this.prevBtn.removeClass("none");

		(this.total <= this.start+this.limit)?this.nextBtn.addClass("none"):this.nextBtn.removeClass("none");

		(this.prevBtn.hasClass("none") && this.nextBtn.hasClass("none"))?this.naviEl.addClass("none"):this.naviEl.removeClass("none");
	},

	cbGet : function(data){
		var deferTime, items, length = 0, data, className, text, i, query = "", cnt = 0;

		this.toggleLoading(false);

		if(data.response.code != 100){alert(data.reponse.code); return}

		items = data.response.history;

		this.total = data.response.total?data.response.total:0;
		this.data = items;

		this.toggleBtn();

		this.bodyEl.update("");

		if(items)
			length = (items.length <= this.limit)?items.length:this.limit;

		for(i = 0; i < length; i++){
			data = this.parseData(i);

			// 리플 아이템이 삭제 되었을 시
			if(!data)
				continue;

			data.item_id = "notice_"+i;

			query += this.listTemplate.apply(data);

			cnt++;
		}

		if(!items || !cnt){
			this.cleanBtn.addClass("none");
			this.bodyEl.insertHtml("beforeEnd", "<li class='empty'>새 알림이 없습니다</li>");

			if(this.noticeBtn)
				this.removeNoticeBtn();

			return;
		}else
			this.cleanBtn.removeClass("none");


		this.bodyEl.insertHtml("beforeEnd", query);

		this.set();
	},

	removeNoticeBtn : function(){
		this.noticeBtn.remove();
		if(Ext.fly("permalinkList") !== null){
			var listWidth = parseInt(Ext.fly("permalinkList").dom.style.right) - 12;
			Ext.fly("permalinkList").setStyle("right", listWidth + "px");
		}
	},

	set : function(){
		this.bodyEl.select("li a").on("click", this.onClickList, this);
	},

	onClickList : function(evt, t){
		if(this.loadingFlag){
			alert("현재 처리중입니다. 잠시만 기다려주세요");
			return;
		}

		var index = t.id.replace("notice_", "");
		var data = this.data[index];
		var className = t.parentNode.className;
		this.selectedIndex= index;

		switch(className){
			case "friend" :
				(typeof(data.action) != "undefined")?this.read(data.history_id):this.acceptFriend(data.name, data.target_id);
				break;

			case "group" :
				(typeof(data.action) != "undefined")?this.read(data.history_id):this.acceptGroup(data.name, data.to_id, data.target_id);
				break;

			case "reply" :
				this.getAncInfo(data.target_id);
				break;
		}
		this.toggleLoading(true);
	},

	acceptGroup : function(name, cafeName, inviteId){
		var answer = confirm(name+"님이 "+cafeName+" 카페에 초대하셨습니다. 수락하시겠습니까? (거절하시려면 취소 버튼을 눌려주세요)");

		var isAccept = answer?true:false;

		var message = cafeName+" 카페";
		message += isAccept?"에 참여하셨습니다.":"초대를 거절하셨습니다.";

		Global.modelGroup.accept(isAccept, inviteId, this.cbAccept, this, message);
	},

	acceptFriend : function(name, inviteId){
		var answer = confirm(name+"님이 친구로 초대하셨습니다. 수락하시겠습니까? (거절하시려면 취소 버튼을 눌려주세요)");

		var isAccept = answer?true:false;

		var message = name+"님";
		message += isAccept?"과 친구가 되셨습니다.":"의 친구 신청이 거절되었습니다.";

		Global.modelFriend.accept(isAccept, inviteId, this.cbAccept, this, message);
	},

	cbAccept :function(data, message){
		if(data.response.code != 100){alert(data.response.message); return}
		var historyId = this.data[this.selectedIndex].history_id;

		this.read(historyId, message);
	},

	// 부모 Item_id get
	getAncInfo : function(item_id){
		this.toggleLoading(true);
		Global.modelLogItem.getAncItemInfo(item_id, this.cbGetAncInfo, this);
	},

	cbGetAncInfo : function(data){
		this.toggleLoading(false);
		if(data.response.code != 100){alert(data.response.message); return}


		this.goLog(data.response);
	},

	goLog : function(data){
		this.formEl.dom.action = "http://"+data.anc_domain+"."+DOMAIN+"/"+data.anc_link_date;
		this.formEl.dom.item_id.value = data.anc_item_id;
		this.formEl.dom.ref_item_id.value = data.item_id;

		this.callback = (function(){this.formEl.dom.submit();}).createDelegate(this);

		var historyId = this.data[this.selectedIndex].history_id;

		this.read(historyId);
	},

	read : function(historyId, message){
		Global.modelHistory.read(historyId, this.cbRead, this, message);
	},

	cbRead : function(data, message){
		if(data.response.code != 100){alert(data.response.message); return}

		if(message !== null && typeof(message) != "undefined")
			alert(message);

		this.toggleLoading(false);
		this.loadingFlag = false;

		if(this.callback)
			this.callback.call();
		else
			this.get(null, null, 0);
	},

	parseData : function(index){
		var item = this.data[index];
		var text, className, parser, title, group, memo;
		var type = item.history_type;
		var action = item.action;
		var name = item.name;

		if(typeof type == "string") type = parseInt(type);
		if(typeof action == "string") action = parseInt(action);

		switch(type){
			case HISTORY_TYPE_REPLY :

				className = "reply";
				title = name+"님이 댓글을 다셨습니다.";

				if("memo" in item == false)
					return false;

				memo = item.memo;

				parser = new Mys.ParseItem;
				parser.parse(memo, false, true);

				text = parser.text_memo.ellipsis(36).replace(/<br>|<br\/>/gi, "");
				name = "";
				break;

			case HISTORY_TYPE_GROUP :
				className = "group";
				group = "님이 "+item.to_id;

				switch(action){
					case HISTORY_GROUP_ACCEPT :
						text = " 카페에 참여하셨습니다.";
						break;

					case HISTORY_GROUP_REJECT :
						text = " 카페 초대를 거절하셨습니다.";
						break;

					case HISTORY_GROUP_BANNED :
						text = " 카페로부터 강퇴되셨습니다.";
						break;

					default : //HISTORY_GROUP_INVITE
						text = " 카페에 초대하셨습니다.";
						break;
				}
				break;

			default : // HISTORY_TYPE_FRIEND
				className = "friend";

				switch(action){
					case HISTORY_FRIEND_ACCEPT :
						text = "님과 친구가 되셨습니다.";
						break;

					case HISTORY_FRIEND_REJECT :
						text = "님과의 친구가 거절되었습니다.";
						break;

					case HISTORY_FRIEND_DELETE :
						text = "님과 친구 삭제되셨습니다.";
						break;

					default : // HISTORY_FRIEND_INVITE
						text = "님이 친구로 초대하셨습니다.";
						break;
				}
				break;
		}

		return {text : text, className : className, title : title, name : name, group : group};
	}
}

Mys.ParseContents = function()
{
		this.initialize();
}

Mys.ParseContents.prototype =
{
		category : null,
		item : null,
		categoryList : null,
		imageWidth : 490,
		movieHtml : '<p class="image"><img height="156" width="108" src="{image}"></p><dl><dd class="title"><a href="{link}" target="_blank">{title}</a><strong class="{pointClass}">{pointHtml}</strong>{agreeImg}</dd><dd>{directorHtml}</dd><dd>{pubDateHtml}</dd><dd>{actorHtml}</dd>{reviewHtml}</dl>',
		videoHtml : '<p><embed height="350" width="425" wmode="transparent" type="application/x-shockwave-flash" src="http://www.youtube.com/v/{videoId}?f=videos&app=youtube_gdata&autoplay=0" wmode="transparent"/></p>',
		bookHtml : '<p class="image"><img height="109" width="73" src="{image}"></p><dl><dd class="title"><a href="{link}" target="_blank">{title}</a><strong class="{pointClass}">{pointHtml}</strong>{agreeImg}</dd><dd>{authorHtml}</dd><dd>{publisherHtml}</dd><dd>{pubdateHtml}</dd>{reviewHtml}</dl>',
		shopHtml : '<p class="image"><img height="118" width="118" src="{image}"></p><dl><dd class="title"><a href="{link}" target="_blank">{title}</a><strong class="{pointClass}">{pointHtml}</strong>{agreeImg}</dd><dd>{lpriceHtml}</dd><dd>{hpriceHtml}</dd>{reviewHtml}</dl>',
		photoHtml : '<p><img src="{image}" {script}/></p>',
		linkHtml : '<p class="contentsLink"><a href="{link}" title="{title}" target="_blank">{con_title}</a></p>',
		wishString : {movie : "보고싶어", book : "읽고싶어", shop : "사고싶어"},

		initialize : function()
		{
				this.categoryList = [CONTENTS_CATEGORY.MUSIC, CONTENTS_CATEGORY.MOVIE, CONTENTS_CATEGORY.VIDEO, CONTENTS_CATEGORY.BOOK, CONTENTS_CATEGORY.SHOP, CONTENTS_CATEGORY.PHOTO, CONTENTS_CATEGORY.LINK, CONTENTS_CATEGORY.MINISHOP_PHOTO];
				this.categoryName = ["music", "movie", "video", "book", "shop", "photo", "link", "minishop_photo"];
				this.imageSrc = Global.isMain?"/minilog/images":"images";
		}

		,setCategory : function(category)
		{
				this.category = parseInt(category);
		}

		,setItem : function(item)
		{
				this.item = item;
		}

		,getItem : function()
		{
				return this.item;
		}

		,getCategory : function()
		{
				return this.category;
		}

		,getCategoryName : function()
		{
			var index = this.categoryList.indexOf(this.getCategory());

			if(index == -1)
					return "";

			return this.categoryName[index];
		}

		,checkCategory : function()
		{
				category = this.getCategory();
				return (this.categoryList.indexOf(category) == -1)?false:true;
		}

		,parse : function(item)
		{
				if(item == null) return;

				this.setItem(item);
				this.setCategory(item.category);

				if(!this.checkCategory()) return "";

				item = this.getItem();

				this.parseItem(item);

				var html = this.getTemplate().apply(item);
				return html;
		}

		,parseItem : function(item)
		{
					var category = this.getCategory();

					switch(category)
					{
							case CONTENTS_CATEGORY.MOVIE :
							case CONTENTS_CATEGORY.MUSIC :
								this.parseMovie(item);
								break;

							case CONTENTS_CATEGORY.BOOK	:
								this.parseBook(item);
								break;

							case CONTENTS_CATEGORY.SHOP	:
								this.parseShop(item);
								break;

							case CONTENTS_CATEGORY.PHOTO :
								this.parsePhoto(item);
								break;
					}
		}

	,	parseBook : function(item)
		{
				if(item.author)
					item.authorHtml = '<span class="sub">지은이</span>'+item.author;

				if(item.publisher)
					item.publisherHtml = '<span class="sub">출판사</span>'+item.publisher;

				if(item.pubdate)
					item.pubdateHtml = '<span class="sub">출판일</span>'+item.pubdate.substring(0, 10);

				item.title = item.con_title.length >= 42?item.con_title.ellipsis(42):item.con_title;
				item.pointClass = this.getPointClass(item.point, item.is_wish);
				item.pointHtml = this.getPointHtml(item.is_wish);
				item.agreeImg = this.getAgreeImg(item.agree_type);
				item.reviewHtml = this.getReviewHtml(item.con_group_id, item.con_count, "책");
		}

		,parseMovie : function(item)
		{
				if(item.director)
					item.directorHtml = '<span class="sub">감독</span>'+item.director;

				if(item.pubDate)
					item.pubDateHtml = '<span class="sub">년도</span>'+item.pubDate.substring(0, 10);

				if(item.actor)
					item.actorHtml = '<span class="sub">출연</span>'+item.actor;

				item.title = item.con_title.length >= 42?item.con_title.ellipsis(42):item.con_title;
				item.pointClass = this.getPointClass(item.point, item.is_wish);
				item.pointHtml = this.getPointHtml(item.is_wish);
				item.agreeImg = this.getAgreeImg(item.agree_type);
				item.reviewHtml = this.getReviewHtml(item.con_group_id, item.con_count, "영화");
		}

		,parseShop : function(item)
		{
				if(item.lprice)
					item.lpriceHtml = '<span class="sub">최저가</span>'+item.lprice;

				if(item.hprice)
					item.hpriceHtml = '<span class="sub">최고가</span>'+item.hprice;

				item.title = item.con_title.length >= 42?item.con_title.ellipsis(42):item.con_title;
				item.pointClass = this.getPointClass(item.point, item.is_wish);
				item.pointHtml = this.getPointHtml(item.is_wish);
				item.agreeImg = this.getAgreeImg(item.agree_type);
				item.reviewHtml = this.getReviewHtml(item.con_group_id, item.con_count, "상품");
		}

		,parsePhoto : function(item)
		{
				item.script = 'onload="if(this.width > '+this.imageWidth+'){this.width='+this.imageWidth+'}"';
		}

		,getAgreeImg : function(agreeType)
		{
				var img;

				if(!agreeType)
						return "";

				switch(parseInt(agreeType))
				{
						case CONTENTS_AGREE :
								img = "<img class='agree' src='"+this.imageSrc+"/icon/thumb_up.gif' alt='Good'>";
								break;

						case CONTENTS_DISAGREE :
								img = "<img class='agree' src='"+this.imageSrc+"/icon/thumb_down.gif' alt='Bad'>";
								break;

						default :
								img = "";
								break;
				}

				return img;
		}

		,getPointClass : function(point, is_wish)
		{
				var pointClass = "point star_";
				pointClass += point?point:0;

				return is_wish?"":pointClass;
		}

		,getPointHtml : function(is_wish)
		{
				return is_wish?"":"<span></span>";
		}

		,getIsWishString : function()
		{
				var category = this.getCategory();

				return this.wishString[category];
		}

		,getTemplate : function()
		{
				var categoryName = this.getCategoryName();

				//exception
				if(categoryName == "music")
						categoryName = "video";

				var categoryTemplate = categoryName+"Html";

				if(typeof(this[categoryTemplate]) == "string")
					this[categoryTemplate] = new Ext.Template(this[categoryTemplate]);

				return this[categoryTemplate];
		}

		,getReviewHtml : function(groupId, count, category)
		{
				if(!groupId || parseInt(count) == 1)
						return "";

				return "<dd class='review'>이 "+category+"에 대한 <a href='http://"+groupId+"."+DOMAIN+"' target='_self'>"+(count-1)+"</a>개의 리뷰가 더 있습니다.</dd>";
		}
}


Mys.ParseItem = function(viewType, imageWidth)
{
	this.addEvents({"findtag" : true});
	this.initialize(viewType, imageWidth);
};

Ext.extend(Mys.ParseItem, Ext.util.Observable,
{
	firstImg : null,
	text_memo : '',
	imageWidth : 490,
	tags : [{startTag:'*제목', endTag:'<BR>'},
			{startTag:'*URL', endTag:'<BR>'},
			{startTag:'*사진', endTag:'<BR>'},
			{startTag:'*그림', endTag:'<BR>'},
			{startTag:'*가입', endTag:'<BR>'},
			{startTag:'*파일', endTag:'<BR>'},
			{startTag:'*폰', endTag:'<BR>'},
		//	{startTag:'[', endTag:']'},
			{startTag:'<', startTag2:'IMG', endTag:'>'},
			{startTag:'<', startTag2:'EMBED', endTag:'>'},
			{startTag:'<', startTag2:'OBJECT', endTag:'</OBJECT>'}],

	initialize : function(viewType, imageWidth)
	{
		if(viewType) this.viewType = viewType;
		if(imageWidth) this.imageWidth = imageWidth;
		this.imageCount = 0;
		this.imageQuery = "";
		this.fileListArr = [];
		this.isUsedPhone = false;
		this.text_memo = "";
		this.firstImg = null;
	},

    parse : function(input, bSkipReplaceTag, bRemoveImageTag)
    {
    	if(!input)
    		return;

		this.uploadFileList = [];

    	input = input.replace(/\n/gi, "<br>");
    	var oriinput = input;

    	input += "<br>";

    	var output = "";

      	var rt = { value: null, nextIndex : 0, tagIndex:-1,  nextValue:"1"};

		var cc = 0;
		var out;

		while (rt.nextIndex >= 0 && rt.nextValue)
        {
        	cc++;
        	if (cc == 100) //무한루프방지
        	{
        		output = oriinput;

        		break;
        	}

            rt = this.findTag(input, 0, this.tags);

            // 태그를 찾았다면
            if (rt.nextIndex != -1)
            {
                if (rt.preValue)
                {
	               	out = (bSkipReplaceTag)?rt.preValue:rt.preValue.replaceLink();
					output+= out;
					this.text_memo += out;
					this.fireEvent("findtag", "*글", out, out);
                }

                if (rt.value)
                {
					out = this.replaceTag(this.tags[rt.tagIndex], rt.value, rt.fullValue, bSkipReplaceTag, bRemoveImageTag);
                	output+= out;
                	this.fireEvent("findtag", this.tags[rt.tagIndex].startTag, rt.value, out);
                }

                if (rt.nextValue)
                    input = rt.nextValue;
            }
            else
            {
            	out = (bSkipReplaceTag)?rt.nextValue:rt.nextValue.replaceLink();

	            this.text_memo += out;
            	output += out;
            	this.fireEvent("findtag", "*글", out, out);
            }
        }

        // 파싱때문에 넣어줬던 <BR>제거
        output = output.substring(0, output.length - 4);

				output = output.stripTags(["a", "img", "b", "br", "strong", "embed", "object", "font"]);

        return output;
	}

    ,findTag : function(input, startIndex, tags)
    {
        var oriinput = input;
        //URLtag때문에 파싱전에 메모를 대문자로 변화한다.
        input = input.toUpperCase();

	    var index = 0;
	  	var nextIndex = startIndex;
	  	var end;
	  	var minIndex = 2000;
			var tagName = null;
  	  var minTag = 0;

  	    if(this.bSkipDefaultTag)
	  	    var loop_len = 4;
	  	  else
	  	    var loop_len = tags.length;

  	    for (var i = 0; i < loop_len; i++)
  	    {
			if(tags[i].startTag2)
				tagName = tags[i].startTag +tags[i].startTag2;
			else
				tagName = tags[i].startTag;

  	        index = input.indexOf(tagName+"", nextIndex);

  	        if (index != -1 && minIndex > index)
  	        {
  	            minIndex = index;
  	            minTag = i;
  	        }
  	    }

  	    // 찾은게 없다면
  	    if (minIndex == 2000) minIndex = -1;

        // find
  	    if (minIndex >= 0)
  	    {
            end = input.indexOf(tags[minTag].endTag, minIndex);

            if (end == -1)
            {
            	return { preValue : null, value: null, nextValue: oriinput, nextIndex : minIndex + 1, tagIndex:null };
            }

            //찾았다면
            if(tags[minTag].startTag == "[")
            	start = minIndex;
            else
            	start = input.indexOf(' ', minIndex);


            if (start == -1) return minIndex + 1; // 이건 해석이 안되니까 다음부터 찾아라

            var value = oriinput.substring(start+1, end);
            var preValue, nextValue;
            preValue = oriinput.slice(0, minIndex);  // 태그 앞부분
            nextValue = oriinput.slice(end+tags[minTag].endTag.length, oriinput.length);  // 태그 뒷부분

						if(tags[minTag].startTag2){
							var fullValueStart = start-(tags[minTag].startTag.length+tags[minTag].startTag2.length);
							if(fullValueStart < 0)fullValue = 0;
							var fullValueEnd = end+tags[minTag].endTag.length;
				            var fullValue = oriinput.substring(fullValueStart, fullValueEnd);
	      	  }
	          else{
	          	var fullValueStart = start-(tags[minTag].startTag.length);

	          	if(tags[minTag].startTag == "[")
	          		fullValueStart++;

	          	if(fullValueStart < 0)fullValue = 0;

	          	var fullValueEnd = end+tags[minTag].endTag.length;
	            var fullValue = oriinput.substring(fullValueStart, fullValueEnd);
	         }
            nextIndex = end + 1;
            return { preValue: preValue, value: value, fullValue: fullValue, nextValue: nextValue, nextIndex : nextIndex, tagIndex:minTag };
  	    }
        return { preValue : null, value: null, fullValue: null, nextValue: oriinput, nextIndex : -1, tagIndex:null };
	}

	,replaceTag : function(tagName, value, fullValue, bSkipReplaceTag, bRemoveImageTag)
	{
		var output, script, setting, marginSetting = "";
		switch (tagName.startTag)
    	{
    		case "*그림":
    		case "*사진":
    			this.imageCount++;

    			if(bRemoveImageTag){
    				output = "";
    				break;
    			}

				if(bSkipReplaceTag){
					if(!fullValue.indexOf("<br>"))
						fullValue += "<br>";

					output = fullValue;
					break;
				}

				switch(this.viewType){
					case "reply" :
						this.imageQuery += "<img "+value+"/>";
						output = "";
						break;
					case "1" :
						setting="width='212' height='129'";
						if(this.imageCount % 3 == 0)
							marginSetting=" style='margin-right:0'";

						script = "onload='";
						script += isIE?"addRoundedIECorner(null, this);' ":"addRoundedCorner(this)' ";

						output = "<a href='"+value+"' "+marginSetting+"'><img class='corners iradius10 iradiae1110' "+script+setting+" src='" + value +"'/></a>";
						break;

					default :
						script = "onload='if(this.width > "+this.imageWidth+"){this.width="+this.imageWidth+"}'";

						output = "<a href='"+value+"' rel='lightbox' class='lightBox blog'><img "+script+" src='" + value +"'/></a><br/>";
						break;
				}

    			this.uploadFileList.push(value.substring(value.indexOf("upload_no=")+10));
    			if(!this.firstImg)
    				this.firstImg = value;

    			break;
    		case "*파일":
				if(bSkipReplaceTag){
					if(!fullValue.indexOf("<br>"))
						fullValue += "<br>";

					output = fullValue;
					break;
				}
    			this.fileListArr.push({src : value, fileName : this.getFileName(value)});
    			output = "";
    			break;

    		case "*폰":
    			this.isUsedPhone = true;

				this.text_memo += value;

				if(bSkipReplaceTag){
					if(!fullValue.indexOf("<br>"))
						fullValue += "<br>";

					output = fullValue;
					break;
				}

    			output = value+"<br>";

    			break;

			case "*가입":
				if(bSkipReplaceTag){
					if(!fullValue.indexOf("<br>"))
						fullValue += "<br>";

					output = fullValue;
					break;
				}
				output = value+"<br>";
				break;

			case "*URL":
				if(bSkipReplaceTag){
					if(!fullValue.indexOf("<br>"))
						fullValue += "<br>";

					output = fullValue;
					break;
				}

				var url, title;
				var index = value.indexOf(" ", 0); // space 를 찾는다.
				if (index != -1)
				{
					url = value.substring(0, index);
					title = value.substring(index+1, value.length);
				}
    			else
    			{
    				url = value;
    				title = value;
    			}

				urlup = url.toUpperCase();
				index = urlup.indexOf("HTTP://", 0);
				if (index == -1)
					url = "http://" + url;
				this.text_memo = title;
    			output = "<a class='linkUrl' href='" + url + "' target = 'new'>" + title + "</a><br>";
    			break;

			case "[" :
				if(bSkipReplaceTag){
					output = fullValue;
					break;
				}

				var index = value.indexOf(";");
				if(index == -1){
					output = fullValue;
					break;
				}

				title = value.substring(0, index);
				url = value.substring(index+1);

				urlup = url.toUpperCase();
				index = urlup.indexOf("HTTP://", 0);
				if (index == -1)
					url = "http://" + url;

				this.text_memo = title;
    			output = "<a class='linkUrl' href='" + url + "' target = 'new'>" + title + "</a>";
				break;

			case "<":
				switch(tagName.startTag2)
				{
					case 'IMG' : // img tag
							this.imageCount++;
							var script, setting;
							var marginSetting = "";
							var src = this.getSrc(value);

							if(bSkipReplaceTag){
								output = "<img src='"+src+"'>";
								break;
							}

							switch(this.viewType){
								case "reply" :
									this.imageQuery += "<a href='"+src+"' rel='lightbox' class='lightBox'><img src='"+src+"'></a>";
									output = "";
									break;

								case "1" :
									setting = "width='212' height='129' ";
									script = "onload='";
									script += isIE?"addRoundedIECorner(this);' ":"addRoundedCorner(this)' ";
									if(this.imageCount % 3 == 0)
										marginSetting=" style='margin-right:0'";

									output = "<a href='"+src+"' "+marginSetting+"><img class='corners iradius10 iradiae1110' "+script+setting+ " src='"+src+"'></a>";
									break;

								default :
									script = "onload='if(this.width > "+this.imageWidth+"){width="+this.imageWidth+"}' ";
									output = "<a href='"+src+"'><img "+script+" src='"+src+"'></a><br/>";
									break;
							}
			       		//var script = "onload='javascript:if(this.width>640){this.width=640;}'";

			       		//output = "<img "+script+value + "'><br>";



		    				if(!this.firstImg)
		    					this.firstImg = value.substring(value.indexOf('"')+1,value.lastIndexOf('"'));

		    				break;

		    		case "EMBED" :
						if(bSkipReplaceTag){
							if(!fullValue.indexOf("<br>"))
								fullValue += "<br>";

							output = fullValue;
							break;
							}
							output = fullValue;

	  					output = this.replaceWidth(fullValue);
	  					//output = this.replaceAllowScript(output);
	  					//output = this.addWmode(output);
	  					break;

	  				case "OBJECT" :
						if(bSkipReplaceTag){
							if(!fullValue.indexOf("<br>"))
								fullValue += "<br>";

							output = fullValue;
							break;
						}

	  					output = this.getEmbedCode(fullValue);
	  					output = this.replaceWidth(output);
	  					//output = this.replaceAllowScript(output);
	  					//output = this.addWmode(output);
	  					break;
				}

				break;

  		default:
  			output = fullValue;
	  		break;
    	}

    	return output;
	}

	,addWmode : function(value){
		var input = value;
		var index = input.indexOf(">");

		if(input.charAt(index-1) == "/")
			index--;

		output = input.substring(0, index);
		output += "wmode = 'transparent'></embed>";
		return output;
	}

	,replaceAllowScript : function(value){
		var replaceValue = value.replace(/\"/, "'", value);

		var start = replaceValue.indexOf("allowScriptAccess=");
		if(start == -1)
			return value;

		start += 18;

		if(replaceValue.charAt(start) != "'")
			return value;

		var end = replaceValue.indexOf("'", start+1);

		var preValue = replaceValue.substr(0, start+1);

		var nextValue = replaceValue.substr(end);

		replaceValue = preValue+"sameDomain"+nextValue;

		return replaceValue;
	}

	,getEmbedCode : function(value){
		var start = value.indexOf("<embed");
		var end = value.lastIndexOf("</embed>");

		if(start == -1 || end == -1)
			return value;

		return value.substring(start, end+8);
	}

	,getFileName : function(value){
		var startIndex = value.indexOf("filename=");
		startIndex += 9;
		var endIndex = value.indexOf("&", startIndex)
		return value.substring(startIndex, endIndex);
	}

	,getFileQuery : function(){
		var query = "";
		for(var i = 0; i < this.fileListArr.length; i++){
			query += '<span class="file"><a href="'+this.fileListArr[i].src+'" title="'+this.fileListArr[i].fileName+' 저장" target="_blank">'+this.fileListArr[i].fileName+'</a></span>';
		}

		return query;
	}
	,getImageQuery : function(){
		return this.imageQuery;
	}

	,hasImage : function(){
			return this.imageCount > 0?true:false;
	}

	,getSrc : function(value)
	{
		var replaceValue = value.replace(/\"|\'/gi,"");

		var start = replaceValue.indexOf("src=");
		start += 4;
		var end = replaceValue.indexOf(" ", start);

		if(end >= 0)
			src = replaceValue.substring(start, end);
		else{
			src = replaceValue.substring(start);
			var length = src.length;
			if(src.charAt(length-1) == "/")
				src = src.substr(0, length-1);

		}
		return src;
	}

	,replaceWidth : function(value)
	{
		var input = value;

    var pattern=/width(?:\s*)=(?:\s*)([\'|\"]?)(\d+)\1/;
    input.match(pattern);
    var width = RegExp.$2;

    if(!width) return input;

		if(width && width > this.imageWidth)
		{
			input = input.replace(pattern, "width='"+this.imageWidth+"'");
		}

		return input;
	},

	getFirstImgUrl : function()
	{
		return this.firstImg;
	},

	getText : function()
	{
	  this.text_memo = this.text_memo.replace(/<\/embed>/gi, "");
		this.text_memo = this.text_memo.replace(/<br><br><br>/gi, "<br>");
		this.text_memo = this.text_memo.replace(/<br><br>/gi, "<br>");
		this.text_memo = this.text_memo.replace(/<br> <br>/gi, "<br>");
		if(this.text_memo.indexOf('<br') == 0 || this.text_memo.indexOf('<br') == 1)
			this.text_memo = this.text_memo.substring(this.text_memo.indexOf('>')+1);
		return this.text_memo;
	},

	getUploadFileList : function()
	{
		return this.uploadFileList;
	}
});


/*******************/
/*   initialize    */
/*******************/
if(typeof(Global) != "undefined" && Global.initFlag){
	// login Data set
	var EXT_SESSION = new Mys.Session();
	EXT_SESSION.modelSession = new Mys.Model.Session();
	if (typeof(LOGIN_DATA) != "undefined" && LOGIN_DATA)
	{
		EXT_SESSION.setLoginData(LOGIN_DATA);
	}

	// model set
	if(!Global.modelFriend) Global.modelFriend = new Mys.Model.Friend;

	if(!Global.modelHistory) Global.modelHistory = new Mys.Model.History;

	if(!Global.modelLogItem) Global.modelLogItem = new Mys.Model.LogItem;

	if(!Global.modelFriend) Global.modelFriend = new Mys.Model.Friend;

	if(!Global.modelGroup) Global.modelGroup = new Mys.Model.Group;

	if(!Global.modelExtaddr) Global.modelExtaddr = new Mys.Model.Extaddr;

	if(!Global.modelKeyword) Global.modelKeyword = new Mys.Model.KeywordComplete;

  if(!Global.modelMobile) Global.modelMobile = new Mys.Model.Mobile;
	//if(!Global.modelContents) Global.modelContents = new Mys.Model.Contents;

	Ext.onReady(function(){
		// login Box
		new LoginBox();

		// layer Navi
		Mys.LayerNavi.initalize();

		if(EXT_SESSION.isLog()){
			// Notice, Friend Group list
			if (Ext.isIE)
			{
				(function(){
					new Mys.NoticeCtrl({openBtnName : "notifyBtn"});
					if(typeof(PAGE_USER_DOMAIN) != "undefined") new Permaink(Global.groupData, Global.friendData);
				}).defer(300);
			}
			else
			{
					new Mys.NoticeCtrl({openBtnName : "notifyBtn"});
					if(typeof(PAGE_USER_DOMAIN) != "undefined") new Permaink(Global.groupData, Global.friendData);
			}
		}
	});
}

Date.kDayNames = ["일요일", "월요일","화요일","수요일","목요일","금요일","토요일"];
Date.getFormatCode = function(character) {
	switch (character) {
	case "d":
		return "String.leftPad(this.getDate(), 2, '0') + ";
	case "D":
		return "Date.dayNames[this.getDay()].substring(0, 3) + ";
	case "j":
		return "this.getDate() + ";
	case "l":
		return "Date.dayNames[this.getDay()] + ";
	case "S":
		return "this.getSuffix() + ";
	case "w":
		return "this.getDay() + ";
	case "z":
		return "this.getDayOfYear() + ";
	case "W":
		return "this.getWeekOfYear() + ";
	case "Q":
		return "this.getWeekOfMonth() + ";
	case "F":
		return "Date.monthNames[this.getMonth()] + ";
	case "m":
		return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
	case "M":
		return "Date.monthNames[this.getMonth()].substring(0, 3) + ";
	case "n":
		return "(this.getMonth() + 1) + ";
	case "t":
		return "this.getDaysInMonth() + ";
	case "L":
		return "(this.isLeapYear() ? 1 : 0) + ";
	case "Y":
		return "this.getFullYear() + ";
	case "y":
		return "('' + this.getFullYear()).substring(2, 4) + ";
	case "a":
		return "(this.getHours() < 12 ? 'am' : 'pm') + ";
	case "A":
		return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
	case "g":
		return "((this.getHours() %12) ? this.getHours() % 12 : 12) + ";
	case "G":
		return "this.getHours() + ";
	case "h":
		return "String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";
	case "H":
		return "String.leftPad(this.getHours(), 2, '0') + ";
	case "i":
		return "String.leftPad(this.getMinutes(), 2, '0') + ";
	case "s":
		return "String.leftPad(this.getSeconds(), 2, '0') + ";
	case "O":
		return "this.getGMTOffset() + ";
	case "T":
		return "this.getTimezone() + ";
	case "Z":
		return "(this.getTimezoneOffset() * -60) + ";
	case "K":
		return "(this.getHours() < 12 ? '오전' : '오후') + ";
	case "E":
		return "Date.kDayNames[this.getDay()].substring(0, 1) + ";
	case "e":
		return "Date.kDayNames[this.getDay()] + ";
	default:
		return "'" + String.escape(character) + "' + ";
	}
};

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){ if(!input) return null;\n"
		+ "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1;\n"
		+ "var d = new Date();\n"
		+ "y = d.getFullYear();\n"
		+ "m = d.getMonth();\n"
		+ "d = d.getDate();\n"
		+ "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
		+ "if (results && results.length > 0) {";
	var regex = "";

	var special = false;
	var ch = '';
	for(var i = 0; i < format.length; ++i)
	{
		ch = format.charAt(i);
		if(!special && ch == "\\")
			special = true;
		else if (special)
		{
			special = false;
			regex += String.escape(ch);
		}
		else
		{
			var obj = Date.formatCodeToRegex(ch, currentGroup);
			currentGroup += obj.g;
			regex += obj.s;

			if(obj.g && obj.c)
				code += obj.c;
		}
	}


	code += "if(h >= 0 && typeof post != 'undefined')\n"
		+ "{ if(post) h += 12;"
		+ "else if(h == 12) h = 0;}"
		+ "if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"
		+ "{return new Date(y, m, d, h, i, s);}\n"
		+ "else if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"
		+ "{return new Date(y, m, d, h, i);}\n"
		+ "else if (y > 0 && m >= 0 && d > 0 && h >= 0)\n"
		+ "{return new Date(y, m, d, h);}\n"
		+ "else if (y > 0 && m >= 0 && d > 0)\n"
		+ "{return new Date(y, m, d);}\n"
		+ "else if (y > 0 && m >= 0)\n"
		+ "{return new Date(y, m);}\n"
		+ "else if (y > 0)\n"
		+ "{return new Date(y);}\n"
		+ "}return null;}";

	Date.parseRegexes[regexNum] = new RegExp(regex);
	eval(code);
};

Date.formatCodeToRegex = function(character, currentGroup) {
	switch (character)
	{
	case "D":
		return {g:0,
		c:null,
		s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};
	case "j":
	case "d":
		return {g:1,
			c:"d = parseInt(results[" + currentGroup + "], 10);\n",
			s:"(\\d{1,2})"};
	case "l":
		return {g:0,
			c:null,
			s:"(?:" + Date.dayNames.join("|") + ")"};
	case "S":
		return {g:0,
			c:null,
			s:"(?:st|nd|rd|th)"};
	case "w":
		return {g:0,
			c:null,
			s:"\\d"};
	case "z":
		return {g:0,
			c:null,
			s:"(?:\\d{1,3})"};
	case "W":
		return {g:0,
			c:null,
			s:"(?:\\d{2})"};
	case "F":
		return {g:1,
			c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "].substring(0, 3)], 10);\n",
			s:"(" + Date.monthNames.join("|") + ")"};
	case "M":
		return {g:1,
			c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "]], 10);\n",
			s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};
	case "n":
	case "m":
		return {g:1,
			c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n",
			s:"(\\d{1,2})"};
	case "t":
		return {g:0,
			c:null,
			s:"\\d{1,2}"};
	case "L":
		return {g:0,
			c:null,
			s:"(?:1|0)"};
	case "Y":
		return {g:1,
			c:"y = parseInt(results[" + currentGroup + "], 10);\n",
			s:"(\\d{4})"};
	case "y":
		return {g:1,
			c:"var ty = parseInt(results[" + currentGroup + "], 10);\n"
				+ "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
			s:"(\\d{1,2})"};
	case "a":
		return {g:1,
			c:"var post = results[" + currentGroup + "] == 'am' ? false : true;\n",
			s:"(am|pm)"};
	case "A":
		return {g:1,
			c:"var post = results[" + currentGroup + "] == 'AM' ? false : true;\n",
			s:"(AM|PM)"};
	case "g":
	case "G":
	case "h":
	case "H":
		return {g:1,
			c:"h = parseInt(results[" + currentGroup + "], 10);\n",
			s:"(\\d{1,2})"};
	case "i":
		return {g:1,
			c:"i = parseInt(results[" + currentGroup + "], 10);\n",
			s:"(\\d{1,2})"};
	case "s":
		return {g:1,
			c:"s = parseInt(results[" + currentGroup + "], 10);\n",
			s:"(\\d{2})"};
	case "O":
		return {g:0,
			c:null,
			s:"[+-]\\d{4}"};
	case "T":
		return {g:0,
			c:null,
			s:"[A-Z]{3}"};
	case "Z":
		return {g:0,
			c:null,
			s:"[+-]\\d{1,5}"};

	case "K":
		return {g :1,
			c:"var post = results[" + currentGroup + "] == '오전' ? false : true;\n",
			s:"(오전|오후)"};
	case "E":
		return {g:0,
		c:null,
		s:"(?:일|월|화|수|목|금|토)"};
	case "e":
		return {g:0,
			c:null,
			s:"(?:" + Date.kDayNames.join("|") + ")"};
	case "B":
		return {g:0,
			c:null,
			s:"\\s*"};
	default:
		return {g:0,
			c:null,
			s:String.escape(character)};
	}
};

Date.parseTimeStr = function(str)
{
	var time = Date.parseDate(str, "KBh:i") ||
						 Date.parseDate(str, "aBh:i") ||
						 Date.parseDate(str, "ABh:i") ||
						 Date.parseDate(str, "H:i") ||
						 Date.parseDate(str, "KBh시Bi분") ||
						 Date.parseDate(str, "H시Bi분");

	return time;
};

Date.parseTimeSecondStr = function(str)
{
	var time = Date.parseDate(str, "KBh:i:s") ||
						 Date.parseDate(str, "aBh:i:s") ||
						 Date.parseDate(str, "ABh:i:s") ||
						 Date.parseDate(str, "H:i:s") ||
						 Date.parseDate(str, "KBh시Bi분Bs초") ||
						 Date.parseDate(str, "H시Bi분Bs초");

	return time;
};

Date.parseDateStr = function(str)
{
	var date = Date.parseDate(str, "Y/m/d") ||
						 Date.parseDate(str, "Y-m-d") ||
						 Date.parseDate(str, "Y.m.d") ||
						 Date.parseDate(str, "Y년Bm월Bd일");

	return date;
};

Date.parseString = function(dateStr, timeStr, hasSecond)
{
	if(!timeStr)
		var timeStr = dateStr;

	var date = Date.parseDateStr(dateStr);
	if(hasSecond)
		var time = Date.parseTimeSecondStr(timeStr);
	else
		var time = Date.parseTimeStr(timeStr);

	if(date && time)
	{
		date.setHours(time.getHours());
		date.setMinutes(time.getMinutes());
		date.setSeconds(time.getSeconds());
		date.hasTime = true;
	}

	return date;
}
// 두 date 객체를 입력 받아서 날짜까지만 같은지 판단하여 true, false를 반환한다.
// (주의!) 시간은 비교하지 않음.
Date.compareDate = function(date1, date2)
{
	if(typeof date1 == "string")
		date1 = Date.parseDateStr(date1);
	if(typeof date2 == "string")
		date2 = Date.parseDateStr(date2);

	if(!date1 || !date2)
		return false;

	if (date1.getFullYear() == date2.getFullYear() &&
			date1.getMonth() == date2.getMonth() &&
			date1.getDate() == date2.getDate())
				return true;

	return false;
};

Date.prototype.clearTime = function(clone)
{
	if(clone)
		return this.clone().clearTime();

	this.setHours(0);
	this.setMinutes(0);
	this.setSeconds(0);
	this.setMilliseconds(0);
	this.hasTime = false;

	return this;
};

Date.prototype.getWeekOfMonth = function()
{
	var firstDate = this.getFirstDateOfMonth();

	return this.getWeekOfYear() - firstDate.getWeekOfYear() + 1;
};

function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='about:blank;';
	return '';
}