function DHTMLgoodies_roundedCorners(){var a;this.roundedCornerTargets=new Array()}var string="";DHTMLgoodies_roundedCorners.prototype={addTarget:function(i,g,d,b,h,f,a,c){var e=this.roundedCornerTargets.length;this.roundedCornerTargets[e]=new Array();this.roundedCornerTargets[e]["divId"]=i;this.roundedCornerTargets[e]["xRadius"]=g;this.roundedCornerTargets[e]["yRadius"]=d;this.roundedCornerTargets[e]["color"]=b;this.roundedCornerTargets[e]["backgroundColor"]=h;this.roundedCornerTargets[e]["padding"]=f;this.roundedCornerTargets[e]["heightOfContent"]=a;this.roundedCornerTargets[e]["whichCorners"]=c},init:function(){for(var t=0;t<this.roundedCornerTargets.length;t++){whichCorners=this.roundedCornerTargets[t]["whichCorners"];divId=this.roundedCornerTargets[t]["divId"];xRadius=this.roundedCornerTargets[t]["xRadius"];yRadius=this.roundedCornerTargets[t]["yRadius"];color=this.roundedCornerTargets[t]["color"];backgroundColor=this.roundedCornerTargets[t]["backgroundColor"];padding=this.roundedCornerTargets[t]["padding"];heightOfContent=this.roundedCornerTargets[t]["heightOfContent"];whichCorners=this.roundedCornerTargets[t]["whichCorners"];var z=new Array();if(!whichCorners||whichCorners=="all"){z.top_left=true;z.top_right=true;z.bottom_left=true;z.bottom_right=true}else{z=whichCorners.split(/,/gi);for(var f in z){z[z[f]]=true}}var A=xRadius/yRadius;var l=document.getElementById(divId);l.style.backgroundColor=null;l.style.backgroundColor="transparent";var r=l.innerHTML;l.innerHTML="";if(z.top_left||z.top_right){var v=document.createElement("DIV");v.style.height=yRadius+"px";v.style.overflow="hidden";l.appendChild(v);var h=0;var n=0;for(no=1;no<=yRadius;no++){var d=(xRadius-(this.getY((yRadius-no),yRadius,A)));var x=(xRadius-(this.getY_withDecimals((yRadius-no),yRadius,A)));var k=xRadius-x;var p=xRadius-d-Math.floor(n);var g=xRadius-(d+p);var c=document.createElement("DIV");c.style.overflow="hidden";c.style.height="1px";if(z.top_left){c.style.marginLeft=d+"px"}if(z.top_right){c.style.marginRight=d+"px"}v.appendChild(c);var j=v;for(var m=1;m<=p;m++){switch(m){case 1:if(m==p){blendMode=((k+n)/2)-g}else{var b=this.getY_withDecimals((xRadius-d-m),xRadius,1/A);blendMode=(k-g-p+1)*(b-(yRadius-no))/2}break;case p:var b=this.getY_withDecimals((xRadius-d-m+1),xRadius,1/A);blendMode=1-(1-(b-(yRadius-no)))*(1-(n-g))/2;break;default:var i=this.getY_withDecimals((xRadius-d-m),xRadius,1/A);var b=this.getY_withDecimals((xRadius-d-m+1),xRadius,1/A);blendMode=((b+i)/2)-(yRadius-no)}c.style.backgroundColor=this.__blendColors(backgroundColor,color,blendMode);j.appendChild(c);j=c;var c=document.createElement("DIV");c.style.height="1px";c.style.overflow="hidden";if(z.top_left){c.style.marginLeft="1px"}if(z.top_right){c.style.marginRight="1px"}c.style.backgroundColor=color}j.appendChild(c);n=k}}var o=document.createElement("DIV");o.className=l.className;o.style.border="1px solid "+color;o.innerHTML=r;o.style.backgroundColor=color;o.style.paddingLeft=padding+"px";o.style.paddingRight=padding+"px";if(!heightOfContent){heightOfContent=""}heightOfContent=heightOfContent+"";if(heightOfContent.length>0&&heightOfContent.indexOf("%")==-1){heightOfContent=heightOfContent+"px"}if(heightOfContent.length>0){o.style.height=heightOfContent}l.appendChild(o);if(z.bottom_left||z.bottom_right){var q=document.createElement("DIV");q.style.height=yRadius+"px";q.style.overflow="hidden";l.appendChild(q);var h=0;var n=0;var B=false;var s=new Array();for(no=1;no<=yRadius;no++){var d=(xRadius-(this.getY((yRadius-no),yRadius,A)));var x=(xRadius-(this.getY_withDecimals((yRadius-no),yRadius,A)));var k=(xRadius-x);var p=xRadius-d-Math.floor(n);var g=xRadius-(d+p);var c=document.createElement("DIV");c.style.overflow="hidden";c.style.height="1px";if(z.bottom_left){c.style.marginLeft=d+"px"}if(z.bottom_right){c.style.marginRight=d+"px"}q.insertBefore(c,q.firstChild);var j=q;for(var m=1;m<=p;m++){switch(m){case 1:if(m==p){blendMode=((k+n)/2)-g}else{var b=this.getY_withDecimals((xRadius-d-m),xRadius,1/A);blendMode=(k-g-p+1)*(b-(yRadius-no))/2}break;case p:var b=this.getY_withDecimals((xRadius-d-m+1),xRadius,1/A);blendMode=1-(1-(b-(yRadius-no)))*(1-(n-g))/2;break;default:var i=this.getY_withDecimals((xRadius-d-m),xRadius,1/A);var b=this.getY_withDecimals((xRadius-d-m+1),xRadius,1/A);blendMode=((b+i)/2)-(yRadius-no)}c.style.backgroundColor=this.__blendColors(backgroundColor,color,blendMode);if(j==q){s[s.length]=c}try{var a=j.getElementsByTagName("DIV")[0];j.insertBefore(c,j.firstChild)}catch(w){j.appendChild(c);B=true}j=c;var c=document.createElement("DIV");c.style.height="1px";c.style.overflow="hidden";if(z.bottom_left){c.style.marginLeft="1px"}if(z.bottom_right){c.style.marginRight="1px"}}if(B){for(var u=s.length-1;u>=0;u--){q.appendChild(s[u])}}c.style.backgroundColor=color;j.appendChild(c);n=k}}}},getY:function(a,c,b){return Math.max(0,Math.ceil(b*Math.sqrt((c*c)-(a*a))))},getY_withDecimals:function(a,c,b){return Math.max(0,b*Math.sqrt((c*c)-(a*a)))},__blendColors:function(f,d,c){if(f.length=="4"){f="#"+f.substring(1,1)+f.substring(1,1)+f.substring(2,1)+f.substring(2,1)+f.substring(3,1)+f.substring(3,1)}if(d.length=="4"){d="#"+d.substring(1,1)+d.substring(1,1)+d.substring(2,1)+d.substring(2,1)+d.substring(3,1)+d.substring(3,1)}var b=[parseInt("0x"+f.substring(1,3)),parseInt("0x"+f.substring(3,5)),parseInt("0x"+f.substring(5,7))];var h=[parseInt("0x"+d.substring(1,3)),parseInt("0x"+d.substring(3,5)),parseInt("0x"+d.substring(5,7))];var g=Math.round(b[0]+(h[0]-b[0])*c).toString(16);var e=Math.round(b[1]+(h[1]-b[1])*c).toString(16);var a=Math.round(b[2]+(h[2]-b[2])*c).toString(16);if(g.length==1){g="0"+g}if(e.length==1){e="0"+e}if(a.length==1){a="0"+a}return"#"+g+e+a}};
