typeof ace=="undefined"&&(window.ace={});(function($){ace.argsStringify=function(aL,aN){if(aL<1){return""}var s=aN+"[0]",i=1;for(;i<aL;i++){s+=","+aN+"["+i+"]"}return s};ace.Singleton=function(c){return{getInstance:function(){var i;eval("i = new c("+ace.argsStringify(arguments.length,"arguments")+")");return(this.getInstance=function(){return i})()}}};ace.ext=function(s,c){var S=function(){};S.prototype=s.prototype;c.prototype=$.extend(new S,c.prototype);c.prototype.constructor=c;for(var n in s){if(typeof c[n]=="undefined"){c[n]=s[n]}}return c};ace.mixin=function(mixTarget,mixSource,mixMap){switch(typeof mixSource){case"object":if(mixSource instanceof Array){for(var i=0,l=mixSource.length;i<l;i++){ace.mixin(mixTarget,mixSource[i],mixMap)}return}break;case"function":mixSource=mixSource.prototype}typeof mixTarget=="function"&&(mixTarget=mixTarget.prototype);switch(typeof mixMap){case"object":if(mixMap!=null&&mixMap instanceof Array){for(var i=0,l=mixMap.length,key,toCopy;i<l;i++){toCopy=mixSource[key=mixMap[i]];typeof toCopy=="undefined"||(mixTarget[key]=toCopy)}break}default:if(mixMap){for(var n in mixSource){mixTarget[n]=mixSource[n]}}else{for(var n in mixSource){typeof mixTarget[n]=="undefined"&&(mixTarget[n]=mixSource[n])}}}};ace.extendClass=function(Super,Constr,Impl){ace.ext(Super,Constr);if(typeof Impl=="object"&&Impl instanceof Array){ace.implement(Constr,Impl)}};ace.implement=function(Constr,Impl){var _I={};for(var i=0,l=Impl.length;i<l;i++){switch(typeof Impl[i]){case"function":$.extend(_I,Impl[i].prototype);break;case"object":$.extend(_I,Impl[i]);break}}Constr.prototype=$.extend({},_I,{doesImplement:function(c){for(var i=0,l=Impl.length;i<l;i++){if(c==Impl[i]||(typeof Impl[i].doesImplement=="function"&&Impl[i].doesImplement(c))){return true}}return false}},Constr.prototype);Constr.prototype.constructor=Constr};ace.Destructable=function(){var _constr=function(){$(window).bind("unload",{_me:this},this.__unload=function(e){if(typeof e.data=="object"&&e.data!=null&&typeof e.data._me=="object"&&e.data._me!=null&&e.data._me instanceof _constr){e.data._me.destructor();e.data._me=null}})};_constr.prototype={destructor:function(){$(window).unbind("unload",this.__unload)}};return _constr};ace.Destructable=ace.Destructable();ace.plugin=function(PluginClass,Public){var _plugin=function(){if(this.length==1){var DomKey=typeof PluginClass.DOM_KEY=="string"?PluginClass.DOM_KEY:null;if(DomKey!=null){var command,_obj,_ret;if(arguments.length>0&&typeof(command=arguments[0])=="string"){if(typeof Public=="object"&&Public instanceof Array&&$.inArray(command,Public)<0){return this}if(typeof(_obj=this.data(DomKey))!="undefined"&&_obj!=null){Array.prototype.shift.call(arguments);_ret=_obj[command].apply(_obj,arguments)}return typeof _ret=="undefined"?this:_ret}if(typeof(_obj=this.data(DomKey))!="undefined"&&_obj!=null&&typeof _obj.jSet=="object"&&_obj.jSet!=null&&_obj.jSet instanceof $){return _obj.jSet}eval("this.data(DomKey, new PluginClass("+(arguments.length>0?"this,"+ace.argsStringify(arguments.length,"arguments"):"this")+"))")}else{eval("new PluginClass("+(arguments.length>0?"this,"+ace.argsStringify(arguments.length,"arguments"):"this")+")")}return this}var args=arguments;return this.each(function(){_plugin.apply($(this),args)})};return _plugin};ace.Ifc=function(){var _constr=function(prototype){this.prototype=prototype;return this};_constr.prototype={is:function(prototype){switch(typeof prototype){case"function":prototype=prototype.prototype;case"object":if(prototype!==null){for(var n in this.prototype){if(typeof prototype[n]!=typeof this.prototype[n]){return false}}return true}}return false},impl:function(prototype){switch(typeof prototype){case"function":prototype=prototype.prototype;case"object":if(prototype!==null){for(var n in this.prototype){if(typeof prototype[n]!=typeof this.prototype[n]){prototype[n]=this.prototype[n]}}}}},constructor:_constr};return _constr};ace.Ifc=ace.Ifc()})(jQuery);
