(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/=c;b=Math.log((1-b)/b);return e*(b+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+"}";d=document.getElementsByTagName("head")[0];d.appendChild(c)}};
a.createDiv_=function(b,e,c,d,f){var h=document.createElement("div"),j="position:absolute;overflow:hidden;left:";j+=b;j+="px;top:";j+=e;j+="px;width:";j+=c;j+="px;height:";j+=d;j+="px;";if(f!=null){j+="opacity:";j+=f;if(AdSenseGraphics.IS_IE_){j+=";filter: alpha(opacity=";j+=Math.round(f*100);j+=");"}}h.style.cssText=j;return h};
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){c=this.getSigmoidPixelIntercepts_(b,e,c,d);b=this.getAntiAliasOpacity_(b,e,c);return b==-1?0:b};a.getCircleAntiAliasOpacity_=function(b,e,c,d){c=this.getCirclePixelIntercepts_(b,e,c);b=this.getAntiAliasOpacity_(b,e,c);if(b==-1)return 0;return d?1-b:b};
a.getAntiAliasOpacity_=function(b,e,c){var d=0,f=new Array(2),h=new Array(2),j=false,m=false,g=false,n=false,k=this.getPixelBottomY_(e);e=this.getPixelTopY_(e);var l=this.getPixelLeftX_(b);b=this.getPixelRightX_(b);if(c[AdSenseGraphics.Y_INTERCEPT_LEFT_]>=k&&c[AdSenseGraphics.Y_INTERCEPT_LEFT_]<e){j=true;f[0]=0;h[0]=c[AdSenseGraphics.Y_INTERCEPT_LEFT_]-k}else if(c[AdSenseGraphics.X_INTERCEPT_TOP_]>=l&&c[AdSenseGraphics.X_INTERCEPT_TOP_]<b){m=true;f[0]=c[AdSenseGraphics.X_INTERCEPT_TOP_]-l;h[0]=1}if(!m&&
!j)return-1;if(c[AdSenseGraphics.Y_INTERCEPT_RIGHT_]>=k&&c[AdSenseGraphics.Y_INTERCEPT_RIGHT_]<e){g=true;f[1]=1;h[1]=c[AdSenseGraphics.Y_INTERCEPT_RIGHT_]-k}else if(c[AdSenseGraphics.X_INTERCEPT_BOTTOM_]>=l&&c[AdSenseGraphics.X_INTERCEPT_BOTTOM_]<b){n=true;f[1]=c[AdSenseGraphics.X_INTERCEPT_BOTTOM_]-l;h[1]=0}if(j&&g){f=h[0]<=h[1]?h[0]:h[1];h=h[0]>h[1]?h[0]:h[1];d=f+(h-f)/2}else if(j&&n)d=h[0]*f[1]/2;else if(m&&g)d=1-(1-f[0])*(1-h[1])/2;else if(m&&n){h=f[0]<=f[1]?f[0]:f[1];f=f[0]>f[1]?f[0]:f[1];d=
h+(f-h)/2}return d};
a.createSigmoidCurve=function(b,e,c,d,f,h){this.addStyleRule_("#"+b.id+" ."+AdSenseGraphics.S_CURVE_CLASS_NAME_+" div","background-color: "+d);b.style.display="none";d=this.createDiv_(0,0,e,c);d.className=AdSenseGraphics.S_CURVE_CLASS_NAME_;for(var j,m=c-1,g,n,k,l=c-1,q=0;q<e;++q){j=m;m=Math.floor(this.computeSigmoid_(q+1,e,c));n=f?q:e-q;g=h?0:c-m;g=this.createDiv_(n,g,1,m);d.appendChild(g);for(var o=m;o<=j;++o){k=this.getSigmoidAntiAliasOpacity_(q,o,e,c);g=h?o:l-o;g=this.createDiv_(n,g,1,1,k);d.appendChild(g)}}b.appendChild(d);
b.style.display=""};
a.applyRoundedCorner=function(b,e,c,d,f,h,j,m){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+=h;c+=h;var g=b.style;g.display="none";b.innerHTML="";g.position="absolute";g.borderWidth="0px";g.backgroundColor="transparent";f=h+"px solid "+f;var n=m==AdSenseGraphics.POS_TOP_LEFT_||m==AdSenseGraphics.POS_BOTTOM_LEFT_;m=m==AdSenseGraphics.POS_TOP_LEFT_||
m==AdSenseGraphics.POS_TOP_RIGHT_;var k=e-j;if(k>0){var l=n?e-k:0;k=this.createDiv_(l,0,k,c-h);l=k.style;l.backgroundColor=d;m?(l.borderTop=f):(l.borderBottom=f);b.appendChild(k)}k=c-j;if(k>0){l=m?c-k:0;k=this.createDiv_(0,l,e-h,k);l=k.style;l.backgroundColor=d;n?(l.borderLeft=f):(l.borderRight=f);b.appendChild(k)}this.createRoundedCorner_(b,e,c,j,h,n,m);g.display=""};
a.createRoundedCorner_=function(b,e,c,d,f,h,j){var m=f>0;f=d-f;e=h?0:e-d;var g=j?0:c-d;c=this.createDiv_(e,g,d,d);c.className=AdSenseGraphics.ROUNDED_CORNER_BG_CLASS_NAME_;var n=this.createDiv_(e,g,d,d);n.className=m?AdSenseGraphics.ROUNDED_CORNER_BORDER_CLASS_NAME_:AdSenseGraphics.ROUNDED_CORNER_BG_CLASS_NAME_;for(var k=f,l=d,q=f,o=d,s,t,u=d-1,r=0;r<d;++r){e=h?u-r:r;k=q;l=o;q=Math.ceil(this.computeCircle_(r+1,f));o=Math.floor(this.computeCircle_(r+1,d));s=m?k:o;g=j?d-s:0;g=this.createDiv_(e,g,1,
s);c.appendChild(g);for(var p=o;p<=l;++p){t=this.getCircleAntiAliasOpacity_(r,p,d,false);g=j?u-p:p;g=this.createDiv_(e,g,1,1,t);n.appendChild(g)}if(m){l=o-s;if(l>0){g=j?d-s-l:s;g=this.createDiv_(e,g,1,l);n.appendChild(g)}for(p=q-1;p<k;++p){t=this.getCircleAntiAliasOpacity_(r,p,f,true);g=j?u-p:p;g=this.createDiv_(e,g,1,1,t);n.appendChild(g)}}}b.appendChild(c);b.appendChild(n)};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]);})()
