(function(){function a(c){if(c instanceof Function){c=c()}var d=function(){var e=(this.initialize)?this.initialize.apply(this,arguments):this;return e};a._build(d,c);var b=d.prototype.parent;b=b?b:Object;d.constructor=a;d.prototype.constructor=d;return d}a.mixin=function(d,b){if(d){for(var c in (b||{})){if(b[c]!=null){d[c]=b[c]}}return d}};a.mixinFun=function(d,b,c){var e=function(f){d(f);b(f)};return function(){e.apply(c,arguments)}};a.clone=function(d){var b;switch(typeof(d)){case"object":b={};for(var f in d){b[f]=a.clone(d[f])}break;case"array":b=[];for(var e=0,c=d.length;e<c;e++){b[e]=a.clone(d[e])}break;default:return d}return b};a._build=function(b,c,f){if(typeof(c)=="object"){for(var g in c){a._build(b,g,c[g])}return b}var e=a.inheritance[c];if(e){f=e.call(b,f);if(f==null){return b}}var d=b.prototype;switch(typeof(f)){case"object":d[c]=a.clone(f);break;case"function":f._name=c;d[c]=f;break;case"array":d[c]=a.clone(f);break;default:d[c]=f;break}};a.inheritance={extend:function(b){this.parent=b;var c=function(){};c.prototype=b.prototype;this.prototype=new c();this.prototype.parent=function(){this._sope=arguments.callee._owner;var d=this._sope.parent.prototype[arguments.callee.caller._name];if(!d){throw new Error('The method "'+method+'" has no parent.')}this._sope=arguments.callee._owner;return d.apply(this,arguments)};this.prototype.parent._owner=this},implement:function(b){var d=[];if(typeof(b)=="array"){d=b}else{d.push(b)}for(var c=0;c<d.length;c++){var e=d[c];if(typeof(e)=="function"){d[c]=new e()}a.mixin(this.prototype,d[c])}},statics:function(b){a.mixin(this,b)}};SNS.sys.Class=a})();
