/**
 * Classy - classy classes for JavaScript
 *
 * :copyright: (c) 2010 by Armin Ronacher.
 * :license: BSD.
 */
;(function(undefined){var
CLASSY_VERSION='1.1',root=this,old_class=Class,disable_constructor=false;var probe_super=(function(){$super();}).toString().indexOf('$super')>0;function usesSuper(obj){return!probe_super||/\B\$super\b/.test(obj.toString());}
function setOrUnset(obj,key,value){if(value===undefined)
delete obj[key];else
obj[key]=value;}
function getOwnProperty(obj,name){return Object.prototype.hasOwnProperty.call(obj,name)?obj[name]:undefined;}
function cheapNew(cls){disable_constructor=true;var rv=new cls;disable_constructor=false;return rv;}
var Class=function(){};Class.$noConflict=function(){setOrUnset(root,'Class',old_class);return Class;};Class.$classyVersion=CLASSY_VERSION;Class.$extend=function(properties){var super_prototype=this.prototype;var prototype=cheapNew(this);if(properties.__include__)
for(var i=0,n=properties.__include__.length;i!=n;++i){var mixin=properties.__include__[i];for(var name in mixin){var value=getOwnProperty(mixin,name);if(value!==undefined)
prototype[name]=mixin[name];}}
for(var name in properties){var value=getOwnProperty(properties,name);if(name==='__include__'||value===undefined)
continue;prototype[name]=typeof value==='function'&&usesSuper(value)?(function(meth,name){return function(){var old_super=getOwnProperty(this,'$super');this.$super=super_prototype[name];try{return meth.apply(this,arguments);}
finally{setOrUnset(this,'$super',old_super);}};})(value,name):value}
var rv=function Class(){if(disable_constructor)
return;var proper_this=root===this?cheapNew(arguments.callee):this;if(proper_this.__init__)
proper_this.__init__.apply(proper_this,arguments);return proper_this;}
rv.prototype=prototype;rv.constructor=rv;rv.$extend=Class.$extend;return rv;};root.Class=Class;})();
