(function(){
var a;AdSenseGraphics.POS_TOP_LEFT_=0;AdSenseGraphics.POS_TOP_RIGHT_=1;AdSenseGraphics.POS_BOTTOM_LEFT_=2;AdSenseGraphics.POS_BOTTOM_RIGHT_=3;AdSenseGraphics.X_INTERCEPT_TOP_=0;AdSenseGraphics.X_INTERCEPT_BOTTOM_=1;AdSenseGraphics.Y_INTERCEPT_LEFT_=2;AdSenseGraphics.Y_INTERCEPT_RIGHT_=3;AdSenseGraphics.USER_AGENT_=navigator.userAgent;AdSenseGraphics.IS_OPERA_=typeof opera!="undefined";AdSenseGraphics.IS_IE_=!AdSenseGraphics.IS_OPERA_&&AdSenseGraphics.USER_AGENT_.indexOf("MSIE")!=-1;
AdSenseGraphics.IS_SAFARI_=!AdSenseGraphics.IS_OPERA_&&AdSenseGraphics.USER_AGENT_.indexOf("Safari")!=-1;AdSenseGraphics.S_CURVE_CLASS_NAME_="curve";AdSenseGraphics.ROUNDED_CORNER_BG_CLASS_NAME_="rc_bg";AdSenseGraphics.ROUNDED_CORNER_BORDER_CLASS_NAME_="rc_border";AdSenseGraphics.SIGMOID_FUNCTION_WIDTH=12;AdSenseGraphics.SIGMOID_FUNCTION_OFFSET=6;function AdSenseGraphics(){}a=AdSenseGraphics.prototype;a.getPixelLeftX_=function(b){return b};a.getPixelRightX_=function(b){return b+1};
a.getPixelBottomY_=function(b){return b};a.getPixelTopY_=function(b){return b+1};a.computeSigmoid_=function(b,e,c){b=12*b/e-6;return c/(1+Math.exp(b))};a.computeSigmoidInverse_=function(b,e,c){if(b<=0)return e;if(b>=c)return 0;b=b/c;var d=Math.log((1-b)/b);return e*(d+6)/12};a.computeCircle_=function(b,e){var c=Math.sqrt(Math.pow(e,2)-Math.pow(b,2));return isNaN(c)?0:c};
a.addStyleRule_=function(b,e){if(AdSenseGraphics.IS_IE_)document.styleSheets[0].addRule(b,e);else{var c=document.createElement("style");c.type="text/css";var d=AdSenseGraphics.IS_SAFARI_?"innerText":"innerHTML";c[d]=b+"{"+e+"}";var f=document.getElementsByTagName("head")[0];f.appendChild(c)}};
a.createDiv_=function(b,e,c,d,f){var g=document.createElement("div"),h="position:absolute;overflow:hidden;left:";h+=b;h+="px;top:";h+=e;h+="px;width:";h+=c;h+="px;height:";h+=d;h+="px;";if(f!=null){h+="opacity:";h+=f;if(AdSenseGraphics.IS_IE_){h+=";filter: alpha(opacity=";h+=Math.round(f*100);h+=");"}}g.style.cssText=h;return g};
a.getCirclePixelIntercepts_=function(b,e,c){var d=new Array(4);d[AdSenseGraphics.Y_INTERCEPT_LEFT_]=this.computeCircle_(this.getPixelLeftX_(b),c);d[AdSenseGraphics.Y_INTERCEPT_RIGHT_]=this.computeCircle_(this.getPixelRightX_(b),c);d[AdSenseGraphics.X_INTERCEPT_BOTTOM_]=this.computeCircle_(this.getPixelBottomY_(e),c);d[AdSenseGraphics.X_INTERCEPT_TOP_]=this.computeCircle_(this.getPixelTopY_(e),c);return d};
a.getSigmoidPixelIntercepts_=function(b,e,c,d){var f=new Array(4);f[AdSenseGraphics.Y_INTERCEPT_LEFT_]=this.computeSigmoid_(this.getPixelLeftX_(b),c,d);f[AdSenseGraphics.Y_INTERCEPT_RIGHT_]=this.computeSigmoid_(this.getPixelRightX_(b),c,d);f[AdSenseGraphics.X_INTERCEPT_BOTTOM_]=this.computeSigmoidInverse_(this.getPixelBottomY_(e),c,d);f[AdSenseGraphics.X_INTERCEPT_TOP_]=this.computeSigmoidInverse_(this.getPixelTopY_(e),c,d);return f};
a.getSigmoidAntiAliasOpacity_=function(b,e,c,d){var f=this.getSigmoidPixelIntercepts_(b,e,c,d),g=this.getAntiAliasOpacity_(b,e,f);return g==-1?0:g};a.getCircleAntiAliasOpacity_=function(b,e,c,d){var f=this.getCirclePixelIntercepts_(b,e,c),g=this.getAntiAliasOpacity_(b,e,f);if(g==-1)return 0;return d?1-g:g};
a.getAntiAliasOpacity_=function(b,e,c){var d=0,f=new Array(2),g=new Array(2),h=false,p=false,l=false,k=false,j=this.getPixelBottomY_(e),q=this.getPixelTopY_(e),o=this.getPixelLeftX_(b),t=this.getPixelRightX_(b);if(c[AdSenseGraphics.Y_INTERCEPT_LEFT_]>=j&&c[AdSenseGraphics.Y_INTERCEPT_LEFT_]<q){h=true;f[0]=0;g[0]=c[AdSenseGraphics.Y_INTERCEPT_LEFT_]-j}else if(c[AdSenseGraphics.X_INTERCEPT_TOP_]>=o&&c[AdSenseGraphics.X_INTERCEPT_TOP_]<t){p=true;f[0]=c[AdSenseGraphics.X_INTERCEPT_TOP_]-o;g[0]=1}if(!p&&
!h)return-1;if(c[AdSenseGraphics.Y_INTERCEPT_RIGHT_]>=j&&c[AdSenseGraphics.Y_INTERCEPT_RIGHT_]<q){l=true;f[1]=1;g[1]=c[AdSenseGraphics.Y_INTERCEPT_RIGHT_]-j}else if(c[AdSenseGraphics.X_INTERCEPT_BOTTOM_]>=o&&c[AdSenseGraphics.X_INTERCEPT_BOTTOM_]<t){k=true;f[1]=c[AdSenseGraphics.X_INTERCEPT_BOTTOM_]-o;g[1]=0}if(h&&l){var n=g[0]<=g[1]?g[0]:g[1],m=g[0]>g[1]?g[0]:g[1];d=n+(m-n)/2}else if(h&&k)d=g[0]*f[1]/2;else if(p&&l)d=1-(1-f[0])*(1-g[1])/2;else if(p&&k){var r=f[0]<=f[1]?f[0]:f[1],u=f[0]>f[1]?f[0]:
f[1];d=r+(u-r)/2}return d};
a.createSigmoidCurve=function(b,e,c,d,f,g){this.addStyleRule_("#"+b.id+" ."+AdSenseGraphics.S_CURVE_CLASS_NAME_+" div","background-color: "+d);b.style.display="none";var h=this.createDiv_(0,0,e,c);h.className=AdSenseGraphics.S_CURVE_CLASS_NAME_;for(var p,l=c-1,k,j,q,o,t=c-1,n=0;n<e;++n){p=l;l=Math.floor(this.computeSigmoid_(n+1,e,c));j=f?n:e-n;q=g?0:c-l;k=this.createDiv_(j,q,1,l);h.appendChild(k);for(var m=l;m<=p;++m){o=this.getSigmoidAntiAliasOpacity_(n,m,e,c);q=g?m:t-m;k=this.createDiv_(j,q,1,1,
o);h.appendChild(k)}}b.appendChild(h);b.style.display=""};
a.applyRoundedCorner=function(b,e,c,d,f,g,h,p){this.addStyleRule_("#"+b.id+" ."+AdSenseGraphics.ROUNDED_CORNER_BG_CLASS_NAME_+" div","background-color: "+d);this.addStyleRule_("#"+b.id+" ."+AdSenseGraphics.ROUNDED_CORNER_BORDER_CLASS_NAME_+" div","background-color: "+f);e+=g;c+=g;var l=b.style;l.display="none";b.innerHTML="";l.position="absolute";l.borderWidth="0px";l.backgroundColor="transparent";var k=g+"px solid "+f,j=p==AdSenseGraphics.POS_TOP_LEFT_||p==AdSenseGraphics.POS_BOTTOM_LEFT_,q=p==AdSenseGraphics.POS_TOP_LEFT_||
p==AdSenseGraphics.POS_TOP_RIGHT_,o=e-h;if(o>0){var t=j?e-o:0,n=this.createDiv_(t,0,o,c-g),m=n.style;m.backgroundColor=d;q?(m.borderTop=k):(m.borderBottom=k);b.appendChild(n)}var r=c-h;if(r>0){var u=q?c-r:0;n=this.createDiv_(0,u,e-g,r);m=n.style;m.backgroundColor=d;j?(m.borderLeft=k):(m.borderRight=k);b.appendChild(n)}this.createRoundedCorner_(b,e,c,h,g,j,q);l.display=""};
a.createRoundedCorner_=function(b,e,c,d,f,g,h){var p=f>0,l=d-f,k=g?0:e-d,j=h?0:c-d,q=this.createDiv_(k,j,d,d);q.className=AdSenseGraphics.ROUNDED_CORNER_BG_CLASS_NAME_;var o=this.createDiv_(k,j,d,d);o.className=p?AdSenseGraphics.ROUNDED_CORNER_BORDER_CLASS_NAME_:AdSenseGraphics.ROUNDED_CORNER_BG_CLASS_NAME_;for(var t=l,n=d,m=l,r=d,u,x,y,v,z=d-1,w=0;w<d;++w){k=g?z-w:w;t=m;n=r;m=Math.ceil(this.computeCircle_(w+1,l));r=Math.floor(this.computeCircle_(w+1,d));u=p?t:r;j=h?d-u:0;v=this.createDiv_(k,j,1,
u);q.appendChild(v);for(var s=r;s<=n;++s){y=this.getCircleAntiAliasOpacity_(w,s,d,false);j=h?z-s:s;v=this.createDiv_(k,j,1,1,y);o.appendChild(v)}if(p){x=r-u;if(x>0){j=h?d-u-x:u;v=this.createDiv_(k,j,1,x);o.appendChild(v)}for(s=m-1;s<t;++s){y=this.getCircleAntiAliasOpacity_(w,s,l,true);j=h?z-s:s;v=this.createDiv_(k,j,1,1,y);o.appendChild(v)}}}b.appendChild(q);b.appendChild(o)};var asg=new AdSenseGraphics;if(typeof window.rcl!="undefined")for(var rc,i=0;i<rcl.length;i++){rc=rcl[i];asg.applyRoundedCorner(document.getElementById(rc[0]),rc[1],rc[2],rc[3],rc[4],rc[5],rc[6],rc[7])}typeof window.sc!="undefined"&&asg.createSigmoidCurve(document.getElementById(sc[0]),sc[1],sc[2],sc[3],sc[4],sc[5]);
})()
