Corners = Class.create();

Corners.prototype = {
  initialize:function(container,options){
    this.container = $(container);
    this.options = Object.extend({
      'cornerHeight' : 10,
      'cornerWidth' : 10
    },options || {});
    this.paint();
  },
  paint : function(){
    this.container.setStyle({
      position:'relative',
      background:this.options.backgroundColor
    });
     var innerDiv = $(document.createElement('div')).setStyle({padding:this.options.cornerHeight + "px"});
    innerDiv.update(this.container.innerHTML);
    this.container.update(innerDiv);
    $A(['top','bottom']).each(function(verticalPosition){
      $A(['left','right']).each(function(horizontalPosition){
        var div = document.createElement('div');
        var settings = {
          position:'absolute',
          height : this.options.cornerHeight + "px",
          width : this.options.cornerWidth + "px",
          background : "url('"+this.options.backgroundUrl+"') no-repeat "+verticalPosition+" "+horizontalPosition+" "
        };
        settings[verticalPosition] = "0px";
        settings[horizontalPosition] = "0px";
        $(div).setStyle(settings);
        new Insertion.Bottom(this.container,div);
      }.bind(this));
    }.bind(this));
  }
  
}
