Element.implement({
    setSize: function(width, height){
        return this.setStyles({
            width: width,
            height: height
        });
    }
})

function Delegate(){
}

Delegate.create = function(thisInstance, method, args){
    return function(){
        method.apply(thisInstance, args);
    }
}

function $get(key, url){
    if (arguments.length < 2) 
        url = location.href;
    if (arguments.length > 0 && key != "") {
        if (key == "#") {
            var regex = new RegExp("[#]([^$]*)");
        }
        else 
            if (key == "?") {
                var regex = new RegExp("[?]([^#$]*)");
            }
            else {
                var regex = new RegExp("[?&]" + key + "=([^&#]*)");
            }
        var results = regex.exec(url);
        return (results == null) ? "" : results[1];
    }
    else {
        url = url.split("?");
        var results = {};
        if (url.length > 1) {
            url = url[1].split("#");
            if (url.length > 1) 
                results["hash"] = url[1];
            url[0].split("&").each(function(item, index){
                item = item.split("=");
                results[item[0]] = item[1];
            });
        }
        return results;
    }
}

function Quad(){
}

Quad.easeIn = function(t, b, c, d){
    return c * (t /= d) * t + b;
}
Quad.easeOut = function(t, b, c, d){
    return -c * (t /= d) * (t - 2) + b;
}
Quad.easeInOut = function(t, b, c, d){
    if ((t /= d * 0.5) < 1) 
        return c * 0.5 * t * t + b;
    return -c * 0.5 * ((--t) * (t - 2) - 1) + b;
}

