var softrRounded=new Class({initialize:function(b,c){b=($(b))?$(b):$$(b);this.options=c;if($type(b)=='element')this.makeRounded(b);else if($type(b)=='array'){$each(b,function(a){this.makeRounded(a)}.bind(this))}},makeRounded:function(c){var d=0,right=0,top=0,left=0;var e=new Element('div',{'styles':{'position':'relative',overflow:'auto',zIndex:2,top:0}}).setHTML(c.innerHTML);if($type(c)=='element'){c.set({'styles':{'position':'relative'}}).empty().adopt(e)}else if($type(c)=='array'){$each(c,function(a){a.set({'styles':{'position':'relative'}}).empty().adopt(e)})};if($chk(this.options.all)){var f=this.options.all,bg=this.options.bg,color=this.options.color;this.options={'tl':f,'tr':f,'bl':f,'br':f,'bg':bg,'color':color}}$each(this.options,function(a,b){if($defined(a.w)){corner=new Element('img',{'src':'http://groups-beta.google.com/groups/roundedcorners?c='+this.color+'&bc='+this.bg+'&w='+a.w+'&h='+a.h+'&a='+b,'styles':{position:'absolute',zIndex:1}});switch(b){case'tl':if(a.w>left)left=a.w;if(a.h>top)top=a.h;corner.setStyles({'top':0,'left':0});break;case'tr':if(a.w>right)right=a.w;if(a.h>top)top=a.h;corner.setStyles({'top':0,'right':0});break;case'bl':if(a.w>left)left=a.w;if(a.h>d)d=a.h;corner.setStyles({'bottom':0,'left':0});break;case'br':if(a.w>right)right=a.w;if(a.h>d)d=a.h;corner.setStyles({'bottom':0,'right':0});break}corner.injectTop(c)}});e.set({'styles':{marginLeft:(left/3).round(-1),width:c.getStyle('width').toInt()-(left/3).round(-1)-(right/3).round(-1),paddingTop:(top/3).round(-1),height:c.getStyle('height').toInt()-(top/3).round(-1)-(d/3).round(-1)}})}});
