var classLoader=(function(A){return function(Y){var V=this,N={system:{classes:{},imports:["system"]}},X={},I={},a;if(Y==undefined){Y={}}if(!Y.enableTrace){Y.enableTrace=true}if(!Y.exceptionHandler){Y.exceptionHandler=function(b){a.error("system","uncaught exception: "+b)}}if(!Y.baseUrl){Y.baseUrl="classes"}if(typeof Y.loader!="function"){if(typeof YAHOO=="object"){Y.loader=function(c,d,b){YAHOO.util.Connect.asyncRequest("GET",Y.baseUrl+"/"+c+".js",{success:function(e){d(e.responseText)},failure:b})}}else{if(jQuery.ajax){Y.loader=function(c,d,b){jQuery.ajax({url:Y.baseUrl+"/"+c+".js",success:d,error:b})}}}}switch(typeof Y.logLevel){default:Y.logLevel="error";case"string":var H=Y.logLevel;Y.logLevel=function(){return H};case"function":}var B=Y.logLevel("system");function O(){}function W(){}function Q(){}function R(){}function K(c,n){if(typeof N[c]=="object"){n();return }var j=I[c],i=false,b=[c],e={},l;if(j!=undefined){j.push(n);return }I[c]=j=[n];if(B=="debug"){a.debug("system",'loading package "'+c+'"')}var h={debug:O,info:W,warning:Q,error:R};switch(Y.logLevel(c)){case"debug":h.debug=function(o){a.debug(c,o)};case"info":h.info=function(o){a.info(c,o)};case"warning":h.warning=function(o){a.warning(c,o)};case"error":h.error=function(o){a.error(c,o)}}function d(o){if(i){throw k("system.InvalidStateException","access to importPackage(name) is not allowed at runtime")}b.push(o);K(o,function(){})}function g(p,o,q){if(i){throw k("system.InvalidStateException","access to defineClass(name,parent,ctor) is not allowed at runtime")}e[p]=[o,q]}l=(function(){var o={};return function(q){var p=o[q];if(typeof p=="object"){return p}var q=G(q,b);if(q==null){return null}p=Z(q);if(p==null){return null}return o[q]=S(p)}})();function k(r){var p=l(r),s,o=[];if(p==null){var q=new (Z("system.ClassNotFoundException"))();q.init(r);throw q}for(var t=1;t<arguments.length;t++){o.push(arguments[t])}return p.newInstance.apply(p,o)}function f(p,o){if(typeof o!="function"){o=l(o);if(o==null){return false}}return p instanceof o}var m=new (Z("system.Monitor"))();m.init(function(){N[c]={classes:e,imports:b};for(var p=0;p<j.length;p++){try{j[p]()}catch(o){Y.exceptionHandler(o)}}},function(o){a.error("system","failed to load package "+c+" "+o)});Y.loader(c,m.track(function(o){A(o,d,g,l,k,f,h);b.push("system");i=true}),m.trackFail());m.end()}function M(c){var b=c.lastIndexOf(".");if(b==-1){return[null,c]}return[c.substr(0,b),c.substr(b+1)]}function G(d,g){var f=M(d),b=f[0],e=f[1],h,c;if(b!=null){for(h=0;h<g.length;h++){if(g[h]==b){return d}}return null}for(h=0;h<g.length;h++){c=N[g[h]];if(c&&c.classes[d]){return g[h]+"."+e}}return null}function Z(d){var g=X[d];if(typeof g=="function"){return g}var f=M(d),b=f[0],e=f[1],c=N[b];if(c){var h=c.classes[e];if(h){return E(d,c.imports,h[0],h[1])}}return null}function C(d,i){var g=X[d];if(typeof g=="function"){if(typeof i=="function"){i(g)}return }var f=M(d),b=f[0],e=f[1],c=N[b];if(c){var h=c.classes[e];if(typeof i=="function"){if(h){i(E(d,c.imports,h[0],h[1]))}else{i(null)}}return }K(b,function(){if(typeof i=="function"){i(Z(d))}})}var D={};function E(c,b,i,h){if(D[c]){var d=new (Z("system.InitializationException"))();d.init(c);throw d}D[c]=true;if(i!=null){var i=G(i,b);h.prototype=Z(i).prototype}var e=new h(h.prototype),f,j,g;e.getClass=function(){return S(h)};if(Y.enableTrace){for(j in e){g=e[j];if(typeof g=="function"){e[j]=U(c,j,g)}}}f=function(){};f.prototype=e;f.name=c;X[c]=f;delete D[c];return f}function S(b){if(!b.reflector){b.reflector=new (Z("system.Class"))();b.reflector.init(b)}return b.reflector}function J(b,c,d){N.system["classes"][b]=[c,d]}J("Object",null,function(){this.init=function(){};this.toString=function(){return"[object "+this.getClass().getName()+"]"};this.curry=function(c){var b=this;return function(){return c.apply(b,arguments)}}});J("Class","Object",function(){this.init=function(b){this.constructor=b};this.getName=function(){return this.constructor.name};this.getClassLoader=function(){return V};this.toString=function(){return"[class "+this.getName()+"]"};this.getParent=function(){var b=this.constructor.prototype;if(typeof b.getClass!="function"){return null}return b.getClass()};this.isInstance=function(b){return b instanceof this.constructor};this.newInstance=function(){var b=new this.constructor();b.init.apply(b,arguments);return b}});J("Logger","Object",function(){this.debug=function(b,c){this.log("debug",b,c)};this.info=function(b,c){this.log("info",b,c)};this.warning=function(b,c){this.log("warning",b,c)};this.error=function(b,c){this.log("error",b,c)};this.log=function(){}});J("DefaultLogger","Logger",function(){if(Y.logger){this.log=function(e,b,c){var d=this;C(Y.logger.className,function(f){if(f==null||!(f.prototype instanceof Z("system.Logger"))){alert('invalid logger "'+Y.logger.className+'"');d.log=function(){};return }if(a==d){a=new f();a.init.apply(a,Y.logger.arguments)}a.log(e,b,c)})}}});J("Exception","Object",function(b){this.init=function(g){var i,c,f,d;this.data=g;try{this.trace=[];for(i=L.length-2;i>=0;i--){try{f=L[i];d=[];for(c=0;c<f[1].length;c++){d.push(f[1][c].toString())}this.trace.push(f[0]+"("+d+")")}catch(h){this.trace.push("???")}}}catch(h){alert("error initializing stacktrace: "+h)}};this.getMessage=function(){return this.data};this.toString=function(){return this.getClass().name+": "+this.getMessage()+"\n  "+this.trace.join("\n  ")}});J("WrappedException","Exception",function(b){});J("ClassNotFoundException","Exception",function(b){});J("InitializationException","Exception",function(b){});J("InvalidStateException","Exception",function(b){});J("Monitor","Object",function(){var b=null;this.successCallback=function(){};this.failCallback=function(){};this.init=function(c,d){if(c){this.successCallback=c}if(d){this.failCallback=d}this.running=0;this.parent=b;b=this;this.beginOperation()};this.end=function(){if(b!=this){throw"activeMonitor does not match this in monitor.end()"}b=this.parent;this.endOperation()};this.track=function(d){this.beginOperation();var c=this;return function(){var e=b;b=c;try{d.apply(this,arguments)}finally{b=e;c.endOperation()}}};this.trackFail=function(d){var c=this;return function(){var e=b;b=c;try{if(d){d.apply(this,arguments)}}finally{b=e;c.failOperation()}}};this.beginOperation=function(){if(this.parent!=null){this.parent.beginOperation()}this.running++};this.endOperation=function(){this.running--;if(this.running==0){var d=b;b=this.parent;try{this.successCallback();b=d}catch(c){b=d;if(!this.failCallback(c)&&this.parent!=null){this.parent.failOperation(c);return }}}if(this.parent!=null){this.parent.endOperation()}};this.failOperation=function(c){if(this.failCallback(c)){this.endOperation()}else{if(this.parent!=null){this.parent.failOperation(c)}}}});var L=[];var F=Z("system.Exception");var T=Z("system.WrappedException");function U(d,b,f){if(f.isDebugWrapper){return f}var c=d+"."+b,e=function(){try{L.push([c,arguments]);return f.apply(this,arguments)}catch(h){if(h instanceof F){throw h}var g=new T();g.init(h);throw g}finally{L.pop()}};e.isDebugWrapper=true;return e}a=new (Z("system.DefaultLogger"))();a.init();this.findClass=G;this.getClass=function(b){return S(Z(b))};this.loadClass=function(b,c){C(b,function(d){c(S(d))})};this.start=function(b){var c=[],d=1;for(;d<arguments.length;d++){c.push(arguments[d])}C(b,function(e){var f=new e();f.init.apply(f,c);f.start.apply(f,c)})};var P=this;this.preload=function(b){C(b)};this.initHandler=function(b,c){if(c.isHandlerInitialized){return }c.isHandlerInitialized=true;P.start.apply(P,arguments)}}})(function(source,importPackage,defineClass,classForName,newInstance,isInstance,log){eval(source);delete source});loader=(function(){var A={loader:function(C,D,B){jQuery.ajax({url:"/$package/"+C+"/",success:D,error:B})}};if(window.enableDebug){A.logger={className:"debug.Logger","arguments":[20]};A.logLevel="debug"}return new classLoader(A)})();preload=loader.preload;initHandler=loader.initHandler;