Element.extend({

  makeHeightable:function(options){
    return new Drag.Base(this, $merge({modifiers: {y: 'height'}}, options));
  },

  toggleDisplay:function(show){
    if (show){
      this.style.display = "";
      return 1;
    }
    this.style.display = (this.style.display == "none") ? "" : "none";
  }

});


Cookie.extend({

    toggle:function(key, options){
      if (Cookie.get(key)){
        Cookie.remove(key);
      }
      else {
        Cookie.set(key, '1', options);
      }
    }

});

/*
String.extend({
  parseQuery: function() {
    var pairs = this.match(/^\??(.*)$/)[1].split('&');
    var params = {};
    pairs.each(function(pair) {
      pair = pair.split('=');
      params[pair[0]] = pair[1];
    });
    return params;
  },
});

window.extend({
  getQueryStringValue: function(key, url) {
    try {
      return window.getQueryStringValues(url)[key];
    }catch(e){return null;}
  },

  getQueryStringValues: function(url){
    var qs = $pick(url, $pick(window.location.search, ''));
    if(qs == "") return [];
    if(qs.indexOf("?") >= 0)qs = qs.substring(qs.indexOf("?")+1, qs.length);
    return qs.parseQuery();
  }

});
*/