function browserdetect(){var b=navigator.userAgent.toLowerCase();this.isIE=b.indexOf("msie")>-1;if(this.isIE){this.ieVer=/msie\s(\d\.\d)/.exec(b)[1];this.quirksMode=!document.compatMode||document.compatMode.indexOf("BackCompat")>-1;this.get_style=function(f,h){if(!(h in f.currentStyle)){return""}var d=/^([\d.]+)(\w*)/.exec(f.currentStyle[h]);if(!d){return f.currentStyle[h]}if(d[1]==0){return"0"}if(d[2]&&d[2]!=="px"){var c=f.style.left;var g=f.runtimeStyle.left;f.runtimeStyle.left=f.currentStyle.left;f.style.left=d[1]+d[2];d[0]=f.style.pixelLeft;f.style.left=c;f.runtimeStyle.left=g}return d[0]};this.supportsCorners=false}else{this.ieVer=this.quirksMode=0;this.get_style=function(c,d){d=d.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(c,"").getPropertyValue(d)};this.isSafari=b.indexOf("safari")!=-1;this.isWebKit=b.indexOf("webkit")!=-1;this.isOp="opera" in window;if(this.isOp){this.supportsCorners=(this.isOp=window.opera.version())>=10.5}else{if(!this.isWebkit){if(!(this.isMoz=b.indexOf("firefox")!==-1)){for(var a=document.childNodes.length;--a>=0;){if("style" in document.childNodes[a]){this.isMoz="MozBorderRadius" in document.childNodes[a].style;break}}}}this.supportsCorners=this.isWebKit||this.isMoz}}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}function curvyCnrSpec(a){this.selectorText=a;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=true}curvyCnrSpec.prototype.setcorner=function(b,c,a,d){if(!b){this.tlR=this.trR=this.blR=this.brR=parseInt(a);this.tlu=this.tru=this.blu=this.bru=d}else{var f=b.charAt(0)+c.charAt(0);this[f+"R"]=parseInt(a);this[f+"u"]=d}};curvyCnrSpec.prototype.get=function(d){if(/^(t|b)(l|r)(R|u)$/.test(d)){return this[d]}if(/^(t|b)(l|r)Ru$/.test(d)){var c=d.charAt(0)+d.charAt(1);return this[c+"R"]+this[c+"u"]}if(/^(t|b)Ru?$/.test(d)){var b=d.charAt(0);b+=this[b+"lR"]>this[b+"rR"]?"l":"r";var a=this[b+"R"];if(d.length===3&&d.charAt(2)==="u"){a+=this[b="u"]}return a}throw new Error("Don't recognize property "+d)};curvyCnrSpec.prototype.radiusdiff=function(a){if(a!=="t"&&a!=="b"){throw new Error("Param must be 't' or 'b'")}return Math.abs(this[a+"lR"]-this[a+"rR"])};curvyCnrSpec.prototype.setfrom=function(a){this.tlu=this.tru=this.blu=this.bru="px";if("tl" in a){this.tlR=a.tl.radius}if("tr" in a){this.trR=a.tr.radius}if("bl" in a){this.blR=a.bl.radius}if("br" in a){this.brR=a.br.radius}if("antiAlias" in a){this.antiAlias=a.antiAlias}};curvyCnrSpec.prototype.cloneOn=function(f){var j=["tl","tr","bl","br"];var k=0;var d,g;for(d in j){if(!isNaN(d)){g=this[j[d]+"u"];if(g!==""&&g!=="px"){k=new curvyCnrSpec;break}}}if(!k){k=this}else{var c,b,h=curvyBrowser.get_style(f,"left");for(d in j){if(!isNaN(d)){c=j[d];g=this[c+"u"];b=this[c+"R"];if(g!=="px"){var a=f.style.left;f.style.left=b+g;b=f.style.pixelLeft;f.style.left=a}k[c+"R"]=b;k[c+"u"]="px"}}f.style.left=h}return k};curvyCnrSpec.prototype.radiusSum=function(a){if(a!=="t"&&a!=="b"){throw new Error("Param must be 't' or 'b'")}return this[a+"lR"]+this[a+"rR"]};curvyCnrSpec.prototype.radiusCount=function(a){var b=0;if(this[a+"lR"]){++b}if(this[a+"rR"]){++b}return b};curvyCnrSpec.prototype.cornerNames=function(){var a=[];if(this.tlR){a.push("tl")}if(this.trR){a.push("tr")}if(this.blR){a.push("bl")}if(this.brR){a.push("br")}return a};function operasheet(c){var a=document.styleSheets.item(c).ownerNode.text;a=a.replace(/\/\*(\n|\r|.)*?\*\//g,"");var d=new RegExp("^\\s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg");var h;this.rules=[];while((h=d.exec(a))!==null){var g=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g");var f,b=new curvyCnrSpec(h[1]);while((f=g.exec(h[2]))!==null){if(f[1]!=="z-"){b.setcorner(f[3],f[4],f[5],f[6])}}this.rules.push(b)}}operasheet.contains_border_radius=function(a){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(a).ownerNode.text)};function curvyCorners(){var g,c,d,b,l;if(typeof arguments[0]!=="object"){throw curvyCorners.newError("First parameter of curvyCorners() must be an object.")}if(arguments[0] instanceof curvyCnrSpec){b=arguments[0];if(!b.selectorText&&typeof arguments[1]==="string"){b.selectorText=arguments[1]}}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string"){throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.")}c=arguments[1];if(typeof c!=="string"){c=""}if(c!==""&&c.charAt(0)!=="."&&"autoPad" in arguments[0]){c="."+c}b=new curvyCnrSpec(c);b.setfrom(arguments[0])}if(b.selectorText){l=0;var h=b.selectorText.replace(/\s+$/,"").split(/,\s*/);d=new Array;for(g=0;g=0;--b){a[b].parentNode.removeChild(a[b])}while(f.firstChild){d.appendChild(f.removeChild(f.firstChild))}g=new curvyObject(g.spec,g.node=d);g.applyCorners()}curvyCorners.block_redraw=h};curvyCorners.adjust=function(obj,prop,newval){if(!curvyBrowser.supportsCorners){if(!curvyCorners.redrawList){throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.")}var i,j=curvyCorners.redrawList.length;for(i=0;i7?curvyBrowser.get_style(this.box,"filter"):null;var l=this.spec.get("tR");var r=this.spec.get("bR");var D=function(L){if(typeof L==="number"){return L}if(typeof L!=="string"){throw new Error("unexpected styleToNPx type "+typeof L)}var t=/^[-\d.]([a-z]+)$/.exec(L);if(t&&t[1]!="px"){throw new Error("Unexpected unit "+t[1])}if(isNaN(L=parseInt(L))){L=0}return L};var A=function(t){return t<=0?"0":t+"px"};try{this.borderWidth=D(J);this.borderWidthB=D(o);this.borderWidthL=D(h);this.borderWidthR=D(c);this.boxColour=curvyObject.format_colour(i);this.topPadding=D(G);this.bottomPadding=D(K);this.leftPadding=D(y);this.rightPadding=D(H);this.boxWidth=p;this.boxHeight=this.box.clientHeight;this.borderColour=curvyObject.format_colour(n);this.borderColourB=curvyObject.format_colour(k);this.borderColourL=curvyObject.format_colour(b);this.borderColourR=curvyObject.format_colour(I);this.borderString=this.borderWidth+"px "+d+" "+this.borderColour;this.borderStringB=this.borderWidthB+"px "+m+" "+this.borderColourB;this.borderStringL=this.borderWidthL+"px "+g+" "+this.borderColourL;this.borderStringR=this.borderWidthR+"px "+a+" "+this.borderColourR;this.backgroundImage=((f!="none")?f:"");this.backgroundRepeat=F}catch(E){throw this.newError(E.message)}var j=this.boxHeight;var C=p;if(curvyBrowser.isOp){var v;z=D(z);x=D(x);if(z){v=C+this.borderWidthL+this.borderWidthR;if(z>v){z=v}z=(v/z*100)+"%"}if(x){v=j+this.borderWidth+this.borderWidthB;if(x>v){x=v}x=(v/x*100)+"%"}}if(curvyBrowser.quirksMode){}else{this.boxWidth-=this.leftPadding+this.rightPadding;this.boxHeight-=this.topPadding+this.bottomPadding}this.contentContainer=document.createElement("div");if(s){this.contentContainer.style.filter=s}while(this.box.firstChild){this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild))}if(w!="absolute"){this.box.style.position="relative"}this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=(C+this.borderWidthL+this.borderWidthR)+"px";this.box.style.height=(j+this.borderWidth+this.borderWidthB)+"px";var q=document.createElement("div");q.style.position="absolute";if(s){q.style.filter=s}if(curvyBrowser.quirksMode){q.style.width=(C+this.borderWidthL+this.borderWidthR)+"px"}else{q.style.width=C+"px"}q.style.height=A(j+this.borderWidth+this.borderWidthB-l-r);q.style.padding="0";q.style.top=l+"px";q.style.left="0";if(this.borderWidthL){q.style.borderLeft=this.borderStringL}if(this.borderWidth&&!l){q.style.borderTop=this.borderString}if(this.borderWidthR){q.style.borderRight=this.borderStringR}if(this.borderWidthB&&!r){q.style.borderBottom=this.borderStringB}q.style.backgroundColor=i;q.style.backgroundImage=this.backgroundImage;q.style.backgroundRepeat=this.backgroundRepeat;q.style.direction="ltr";this.shell=this.box.appendChild(q);p=curvyBrowser.get_style(this.shell,"width");if(p===""||p==="auto"||p.indexOf("%")!==-1){throw this.newError("Shell width is "+p)}this.boxWidth=(p!==""&&p!="auto"&&p.indexOf("%")==-1)?parseInt(p):this.shell.clientWidth;this.applyCorners=function(){this.backgroundPosX=this.backgroundPosY=0;if(this.backgroundObject){var Z=function(ar,ap,aq){if(ar===0){return 0}if(ar==="right"||ar==="bottom"){return aq-ap}if(ar==="center"){return(aq-ap)/2}if(ar.indexOf("%")>0){return(aq-ap)*100/parseInt(ar)}return D(ar)};this.backgroundPosX=Z(z,this.backgroundObject.width,C);this.backgroundPosY=Z(x,this.backgroundObject.height,j)}else{if(this.backgroundImage){this.backgroundPosX=D(z);this.backgroundPosY=D(x)}}if(l){q=document.createElement("div");q.style.width=this.boxWidth+"px";q.style.fontSize="1px";q.style.overflow="hidden";q.style.position="absolute";q.style.paddingLeft=this.borderWidth+"px";q.style.paddingRight=this.borderWidth+"px";q.style.height=l+"px";q.style.top=-l+"px";q.style.left=-this.borderWidthL+"px";this.topContainer=this.shell.appendChild(q)}if(r){q=document.createElement("div");q.style.width=this.boxWidth+"px";q.style.fontSize="1px";q.style.overflow="hidden";q.style.position="absolute";q.style.paddingLeft=this.borderWidthB+"px";q.style.paddingRight=this.borderWidthB+"px";q.style.height=r+"px";q.style.bottom=-r+"px";q.style.left=-this.borderWidthL+"px";this.bottomContainer=this.shell.appendChild(q)}var ah=this.spec.cornerNames();for(var al in ah){if(!isNaN(al)){var ad=ah[al];var ae=this.spec[ad+"R"];var af,ai,O,ag;if(ad=="tr"||ad=="tl"){af=this.borderWidth;ai=this.borderColour;ag=this.borderWidth}else{af=this.borderWidthB;ai=this.borderColourB;ag=this.borderWidthB}O=ae-ag;var Y=document.createElement("div");Y.style.height=this.spec.get(ad+"Ru");Y.style.width=this.spec.get(ad+"Ru");Y.style.position="absolute";Y.style.fontSize="1px";Y.style.overflow="hidden";var W,V,T;var R=s?parseInt(/alpha\(opacity.(\d+)\)/.exec(s)[1]):100;for(W=0;W=O)?-1:Math.floor(Math.sqrt(Math.pow(O,2)-Math.pow(W+1,2)))-1;if(O!=ae){var N=(W>=O)?-1:Math.ceil(Math.sqrt(Math.pow(O,2)-Math.pow(W,2)));var L=(W+1>=ae)?-1:Math.floor(Math.sqrt(Math.pow(ae,2)-Math.pow((W+1),2)))-1}var t=(W>=ae)?-1:Math.ceil(Math.sqrt(Math.pow(ae,2)-Math.pow(W,2)));if(Q>-1){this.drawPixel(W,0,this.boxColour,R,(Q+1),Y,true,ae)}if(O!=ae){if(this.spec.antiAlias){for(V=Q+1;V=30,ae)}else{if(this.boxColour!=="transparent"){var ac=curvyObject.BlendColour(this.boxColour,ai,curvyObject.pixelFraction(W,V,O));this.drawPixel(W,V,ac,R,1,Y,false,ae)}else{this.drawPixel(W,V,ai,R>>1,1,Y,false,ae)}}}if(L>=N){if(N==-1){N=0}this.drawPixel(W,N,ai,R,(L-N+1),Y,false,0)}T=ai;V=L}else{if(L>Q){this.drawPixel(W,(Q+1),ai,R,(L-Q),Y,false,0)}}}else{T=this.boxColour;V=Q}if(this.spec.antiAlias&&this.boxColour!=="transparent"){while(++V>>4]+""+a[b&15]};curvyObject.BlendColour=function(m,k,h){if(m==="transparent"||k==="transparent"){throw this.newError("Cannot blend with transparent")}if(m.charAt(0)!=="#"){m=curvyObject.format_colour(m)}if(k.charAt(0)!=="#"){k=curvyObject.format_colour(k)}var d=parseInt(m.substr(1,2),16);var l=parseInt(m.substr(3,2),16);var g=parseInt(m.substr(5,2),16);var c=parseInt(k.substr(1,2),16);var j=parseInt(k.substr(3,2),16);var f=parseInt(k.substr(5,2),16);if(h>1||h<0){h=1}var i=Math.round((d*h)+(c*(1-h)));if(i>255){i=255}if(i<0){i=0}var b=Math.round((l*h)+(j*(1-h)));if(b>255){b=255}if(b<0){b=0}var a=Math.round((g*h)+(f*(1-h)));if(a>255){a=255}if(a<0){a=0}return"#"+curvyObject.IntToHex(i)+curvyObject.IntToHex(b)+curvyObject.IntToHex(a)};curvyObject.pixelFraction=function(i,h,a){var k;var f=a*a;var b=new Array(2);var g=new Array(2);var j=0;var c="";var d=Math.sqrt(f-Math.pow(i,2));if(d>=h&&d<(h+1)){c="Left";b[j]=0;g[j]=d-h;++j}d=Math.sqrt(f-Math.pow(h+1,2));if(d>=i&&d<(i+1)){c+="Top";b[j]=d-i;g[j]=1;++j}d=Math.sqrt(f-Math.pow(i+1,2));if(d>=h&&d<(h+1)){c+="Right";b[j]=1;g[j]=d-h;++j}d=Math.sqrt(f-Math.pow(h,2));if(d>=i&&d<(i+1)){c+="Bottom";b[j]=d-i;g[j]=0}switch(c){case"LeftRight":k=Math.min(g[0],g[1])+((Math.max(g[0],g[1])-Math.min(g[0],g[1]))/2);break;case"TopRight":k=1-(((1-b[0])*(1-g[1]))/2);break;case"TopBottom":k=Math.min(b[0],b[1])+((Math.max(b[0],b[1])-Math.min(b[0],b[1]))/2);break;case"LeftBottom":k=g[0]*b[1]/2;break;default:k=1}return k};curvyObject.rgb2Array=function(a){var b=a.substring(4,a.indexOf(")"));return b.split(/,\s*/)};curvyObject.rgb2Hex=function(b){try{var c=curvyObject.rgb2Array(b);var h=parseInt(c[0]);var f=parseInt(c[1]);var a=parseInt(c[2]);var d="#"+curvyObject.IntToHex(h)+curvyObject.IntToHex(f)+curvyObject.IntToHex(a)}catch(g){var i="getMessage" in g?g.getMessage():g.message;throw new Error("Error ("+i+") converting RGB value to Hex in rgb2Hex")}return d};curvyObject.setOpacity=function(g,c){c=(c==100)?99.999:c;if(curvyBrowser.isSafari&&g.tagName!="IFRAME"){var b=curvyObject.rgb2Array(g.style.backgroundColor);var f=parseInt(b[0]);var d=parseInt(b[1]);var a=parseInt(b[2]);g.style.backgroundColor="rgba("+f+", "+d+", "+a+", "+c/100+")"}else{if(typeof g.style.opacity!=="undefined"){g.style.opacity=c/100}else{if(typeof g.style.MozOpacity!=="undefined"){g.style.MozOpacity=c/100}else{if(typeof g.style.filter!=="undefined"){g.style.filter="alpha(opacity="+c+")"}else{if(typeof g.style.KHTMLOpacity!=="undefined"){g.style.KHTMLOpacity=c/100}}}}}};curvyCorners.addEvent=function(d,c,b,a){if(d.addEventListener){d.addEventListener(c,b,a);return true}if(d.attachEvent){return d.attachEvent("on"+c,b)}d["on"+c]=b;return false};if(typeof addEvent==="undefined"){addEvent=curvyCorners.addEvent}curvyObject.getComputedColour=function(g){var h=document.createElement("DIV");h.style.backgroundColor=g;document.body.appendChild(h);if(window.getComputedStyle){var f=document.defaultView.getComputedStyle(h,null).getPropertyValue("background-color");h.parentNode.removeChild(h);if(f.substr(0,3)==="rgb"){f=curvyObject.rgb2Hex(f)}return f}else{var a=document.body.createTextRange();a.moveToElementText(h);a.execCommand("ForeColor",false,g);var b=a.queryCommandValue("ForeColor");var c="rgb("+(b&255)+", "+((b&65280)>>8)+", "+((b&16711680)>>16)+")";h.parentNode.removeChild(h);a=null;return curvyObject.rgb2Hex(c)}};curvyObject.format_colour=function(a){if(a!==""&&a!=="transparent"){if(a.substr(0,3)==="rgb"){a=curvyObject.rgb2Hex(a)}else{if(a.charAt(0)!=="#"){a=curvyObject.getComputedColour(a)}else{if(a.length===4){a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)}}}}return a};curvyCorners.getElementsByClass=function(j,g){var f=new Array;if(g===undefined){g=document}j=j.split(".");var a="*";if(j.length===1){a=j[0];j=false}else{if(j[0]){a=j[0]}j=j[1]}var d,c,b;if(a.charAt(0)==="#"){c=document.getElementById(a.substr(1));if(c){f.push(c)}}else{c=g.getElementsByTagName(a);b=c.length;if(j){var h=new RegExp("(^|\\s)"+j+"(\\s|$)");for(d=0;d1){var a=[];for(var c=b.length;--c>=0;){a=a.concat(curvyCorners.getElementsBySelector(f.slice(1),b[c]))}b=a}return b};if(curvyBrowser.supportsCorners){var curvyCornersNoAutoScan=true;curvyCorners.init=function(){}}else{curvyCorners.scanStyles=function(){function b(h){if(!parseInt(h)){return"px"}var i=/^[\d.]+(\w+)$/.exec(h);return i[1]}var f,d,c;if(curvyBrowser.isIE){function a(o){var j=o.style,h,i,m,l,n;if(curvyBrowser.ieVer>6){h=j["-moz-border-radius"]||0;i=j["-moz-border-radius-topright"]||0;m=j["-moz-border-radius-topleft"]||0;l=j["-moz-border-radius-bottomright"]||0;n=j["-moz-border-radius-bottomleft"]||0}else{h=j["moz-border-radius"]||0;i=j["moz-border-radius-topright"]||0;m=j["moz-border-radius-topleft"]||0;l=j["moz-border-radius-bottomright"]||0;n=j["moz-border-radius-bottomleft"]||0}if(h){var p=h.split("/");p=p[0].split(/\s+/);if(p[p.length-1]===""){p.pop()}switch(p.length){case 3:m=p[0];i=n=p[1];l=p[2];h=false;break;case 2:m=l=p[0];i=n=p[1];h=false;case 1:break;case 4:m=p[0];i=p[1];l=p[2];n=p[3];h=false;break;default:curvyCorners.alert("Illegal corners specification: "+h)}}if(h||m||i||l||n){var k=new curvyCnrSpec(o.selectorText);if(h){k.setcorner(null,null,parseInt(h),b(h))}else{if(i){k.setcorner("t","r",parseInt(i),b(i))}if(m){k.setcorner("t","l",parseInt(m),b(m))}if(n){k.setcorner("b","l",parseInt(n),b(n))}if(l){k.setcorner("b","r",parseInt(l),b(l))}}curvyCorners(k)}}for(f=0;f