if(typeof ace=="undefined"){window.ace={}}ace.Singleton=function(constructor){var _instance=null;return{getInstance:function(){if(_instance==null){if(typeof constructor!="function"){throw ("Invalid constructor")}var e="_instance = new constructor(";for(var i=0,l=arguments.length;i<l;i++){e+="arguments["+i+"],"}e+=")";eval(e);this.getInstance=function(){return _instance}}return _instance}}};ace.extendClass=function(b,a,d){var c=function(){};c.prototype=b.prototype;a.prototype=$.extend(new c,a.prototype);a.prototype.constructor=a;if(typeof d!="undefined"&&d instanceof Array){ace.implement(a,d)}};ace.implement=function(b,e){var d={};for(var c=0,a=e.length;c<a;c++){switch(typeof e[c]){case"function":$.extend(d,e[c].prototype);break;case"object":$.extend(d,e[c]);break}}b.prototype=$.extend({},d,{doesImplement:function(h){for(var g=0,f=e.length;g<f;g++){if(h==e[g]||(typeof e[g].doesImplement=="function"&&e[g].doesImplement(h))){return true}}return false}},b.prototype)};ace.Destructable=function(){var a=function(){$(window).bind("unload",{_me:this},this.__unload=function(b){if(typeof b.data=="object"&&b.data!=null&&typeof b.data._me=="object"&&b.data._me!=null&&b.data._me instanceof a){b.data._me.destructor();b.data._me=null}})};a.prototype={destructor:function(){$(window).unbind("unload",this.__unload)}};return a};ace.Destructable=ace.Destructable();$.extend(typeof ace.helpers=="undefined"?ace.helpers={}:ace.helpers,{argsStringify:function(d,c){if(d<1){return""}var b=c+"[0]";for(var a=1;a<d;a++){b+=","+c+"["+a+"]"}return b}});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"){Array.prototype.shift.call(arguments);_ret=_obj[command].apply(_obj,arguments)}return typeof _ret=="undefined"?this:_ret}if(typeof(_obj=this.data(DomKey))!="undefined"&&typeof _obj.jSet=="object"&&_obj.jSet!=null&&_obj.jSet instanceof $){return _obj.jSet}eval("this.data(DomKey, new PluginClass("+(arguments.length>0?"this,"+ace.helpers.argsStringify(arguments.length,"arguments"):"this")+"))")}else{eval("new PluginClass("+(arguments.length>0?"this,"+ace.helpers.argsStringify(arguments.length,"arguments"):"this")+")")}return this}var args=arguments;return this.each(function(){_plugin.apply($(this),args)})};return _plugin};