function extend(f,o){
    function wrap(c){
        return function(){
            return c.apply(this.__this||this,arguments)
        }
    }
    f=f.prototype;
    for(var i in o)if(!f[i])f[i]=wrap(o[i]);
}

function wrapper(f){
var f=function (o){
return new f.prototype.init(o)
}
f.prototype={
init:function(o){this.__this=o;return this}
}
f.prototype.init.prototype=f.prototype
return f;
}

$A=wrapper()

extend($A,{

remove:function(e){
    for(var i=this.length;i>=0;--i){
        if(this[i]==e){
            this.splice(i,1)
        }
    }
    return this
},
indexOf:function(e,pos){
    pos=pos||0;
    for(var len=this.length;pos<len;++pos)
        if(this[pos]==e)
            return pos;
    return -1
},
replace:function(f,t){
    for(var i=this.length;i>=0;--i){
        if(this[i]==f)
            this[i]=t;
    }
    return this
}
})


$S=wrapper()
extend($S,{
strip:function(){
return this.replace(/^\s+/, '').replace(/\s+$/, '')
}
})


