	var softrRounded = new Class({

		initialize: function(div,options){

			div=($(div))?$(div):$$(div);

			this.options=options;

			if($type(div)=='element')

				this.makeRounded(div);

			else if($type(div)=='array'){

				$each(div,function(el){

					this.makeRounded(el);

				}.bind(this));

			}

			

		},

		makeRounded: function(div){

			

			var bottom=0,right=0,top=0,left=0;

			var div2=new Element('div',{'styles':{'position':'relative',overflow:'auto',zIndex:2,top:0}}).setHTML(div.innerHTML);			



			if($type(div)=='element'){

				div.set({'styles':{'position':'relative'}}).empty().adopt(div2);

			}else if($type(div)=='array'){

				$each(div,function(el){

					el.set({'styles':{'position':'relative'}}).empty().adopt(div2);

				});

			};

			

			if($chk(this.options.all)){

				var op=this.options.all, bg=this.options.bg, color=this.options.color;

				this.options={'tl':op,'tr':op,'bl':op,'br':op,'bg':bg,'color':color};

			}



			$each(this.options,function(op,el){

			if($defined(op.w)){

				corner=new Element('img',{'src':'http://groups.google.com/groups/roundedcorners?c='+this.color+'&bc='+this.bg+'&w='+op.w+'&h='+op.h+'&a='+el,'styles':{position:'absolute',zIndex:1}});



				switch(el){

					case 'tl': if(op.w>left) left=op.w; if(op.h>top) top=op.h;  corner.setStyles({'top':0,'left':0}); break;

					case 'tr': if(op.w>right) right=op.w; if(op.h>top) top=op.h;  corner.setStyles({'top':0,'right':0}); break;

					case 'bl': if(op.w>left) left=op.w;  if(op.h>bottom) bottom=op.h; corner.setStyles({'bottom':0,'left':0}); break;

					case 'br': if(op.w>right) right=op.w; if(op.h>bottom) bottom=op.h; corner.setStyles({'bottom':0,'right':0}); break;

				}

				corner.injectTop(div);

			}

			});



			div2.set({'styles':{marginLeft:(left/3).round(-1),width:div.getStyle('width').toInt()-(left/3).round(-1)-(right/3).round(-1), paddingTop:(top/3).round(-1),height:div.getStyle('height').toInt()-(top/3).round(-1)-(bottom/3).round(-1)}});

		}

	}); 