﻿function browserdetect(){var a=navigator.userAgent.toLowerCase();this.isIE=a.indexOf("msie")>-1;this.ieVer=this.isIE?/msie\s(\d\.\d)/.exec(a)[1]:0;this.isMoz=a.indexOf("firefox")!=-1;this.isSafari=a.indexOf("safari")!=-1;this.quirksMode=this.isIE&&(!document.compatMode||document.compatMode.indexOf("BackCompat")>-1);this.isOp="opera" in window;this.isWebKit=a.indexOf("webkit")!=-1;if(this.isIE)this.get_style=function(a,c){if(!(c in a.currentStyle))return "";var b=/^([\d.]+)(\w*)/.exec(a.currentStyle[c]);if(!b)return a.currentStyle[c];if(b[1]==0)return "0";if(b[2]&&b[2]!=="px"){var d=a.style.left,e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b[1]+b[2];b[0]=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e}return b[0]};else this.get_style=function(b,a){a=a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(b,"").getPropertyValue(a)}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE)try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}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,d,a,c){if(!b){this.tlR=this.trR=this.blR=this.brR=parseInt(a);this.tlu=this.tru=this.blu=this.bru=c}else{propname=b.charAt(0)+d.charAt(0);this[propname+"R"]=parseInt(a);this[propname+"u"]=c}};curvyCnrSpec.prototype.get=function(a){if(/^(t|b)(l|r)(R|u)$/.test(a))return this[a];if(/^(t|b)(l|r)Ru$/.test(a)){var d=a.charAt(0)+a.charAt(1);return this[d+"R"]+this[d+"u"]}if(/^(t|b)Ru?$/.test(a)){var b=a.charAt(0);b+=this[b+"lR"]>this[b+"rR"]?"l":"r";var c=this[b+"R"];if(a.length===3&&a.charAt(2)==="u")c+=this[b="u"];return c}throw new Error("Don't recognize property "+a)};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(c){var g=["tl","tr","bl","br"],d=0,b,a;for(b in g)if(!isNaN(b)){a=this[g[b]+"u"];if(a!==""&&a!=="px"){d=new curvyCnrSpec;break}}if(!d)d=this;else{var e,f,h=curvyBrowser.get_style(c,"left");for(b in g)if(!isNaN(b)){e=g[b];a=this[e+"u"];f=this[e+"R"];if(a!=="px"){var h=c.style.left;c.style.left=f+a;f=c.style.pixelLeft;c.style.left=h}d[e+"R"]=f;d[e+"u"]="px"}c.style.left=h}return d};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(b){var a=0;if(this[b+"lR"])++a;if(this[b+"rR"])++a;return a};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(e){var b=document.styleSheets.item(e).ownerNode.text;b=b.replace(/\/\*(\n|\r|.)*?\*\//g,"");var f=new RegExp("^s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg"),c;this.rules=[];while((c=f.exec(b))!==null){var g=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g"),a,d=new curvyCnrSpec(c[1]);while((a=g.exec(c[2]))!==null)if(a[1]!=="z-")d.setcorner(a[3],a[4],a[5],a[6]);this.rules.push(d)}}operasheet.contains_border_radius=function(a){return /border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(a).ownerNode.text)};function curvyCorners(){var c,a,b,d,g;if(typeof arguments[0]!=="object")throw curvyCorners.newError("First parameter of curvyCorners() must be an object.");if(arguments[0]instanceof curvyCnrSpec){d=arguments[0];if(!d.selectorText&&typeof arguments[1]==="string")d.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.");a=arguments[1];if(typeof a!=="string")a="";if(a!==""&&a.charAt(0)!=="."&&"autoPad" in arguments[0])a="."+a;d=new curvyCnrSpec(a);d.setfrom(arguments[0])}if(d.selectorText){g=0;var i=d.selectorText.replace(/\s+$/,"").split(/,\s*/);b=[];function j(b){var a=b.split("#");return (a.length===2?"#":"")+a.pop()}for(c=0;c<i.length;++c){var f=j(i[c]),e=f.split(" ");switch(f.charAt(0)){case "#":a=e.length===1?f:e[0];a=document.getElementById(a.substr(1));if(a===null)curvyCorners.alert("No object with ID "+f+" exists yet.\nCall curvyCorners(settings, obj) when it is created.");else if(e.length===1)b.push(a);else b=b.concat(curvyCorners.getElementsByClass(e[1],a));break;default:if(e.length===1)b=b.concat(curvyCorners.getElementsByClass(f));else{var h=curvyCorners.getElementsByClass(e[0]);for(a=0;a<h.length;++a)b=b.concat(curvyCorners.getElementsByClass(e[1],h))}}}}else{g=1;b=arguments}for(c=g,a=b.length;c<a;++c)if(b[c]&&(!("IEborderRadius" in b[c].style)||b[c].style.IEborderRadius!="set")){if(b[c].className&&b[c].className.indexOf("curvyRedraw")!==-1){if(typeof curvyCorners.redrawList==="undefined")curvyCorners.redrawList=[];curvyCorners.redrawList.push({node:b[c],spec:d,copy:b[c].cloneNode(false)})}b[c].style.IEborderRadius="set";var k=new curvyObject(d,b[c]);k.applyCorners()}}curvyCorners.prototype.applyCornersToAll=function(){curvyCorners.alert("This function is now redundant. Just call curvyCorners(). See documentation.")};curvyCorners.redraw=function(){if(!curvyBrowser.isOp&&!curvyBrowser.isIE)return;if(!curvyCorners.redrawList)throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.");var e=curvyCorners.bock_redraw;curvyCorners.block_redraw=true;for(var d in curvyCorners.redrawList){if(isNaN(d))continue;var a=curvyCorners.redrawList[d];if(!a.node.clientWidth)continue;var c=a.copy.cloneNode(false);for(var b=a.node.firstChild;b!=null;b=b.nextSibling)if(b.className==="autoPadDiv")break;if(!b){curvyCorners.alert("Couldn't find autoPad DIV");break}a.node.parentNode.replaceChild(c,a.node);while(b.firstChild)c.appendChild(b.removeChild(b.firstChild));a=new curvyObject(a.spec,a.node=c);a.applyCorners()}curvyCorners.block_redraw=e};curvyCorners.adjust=function(obj,prop,newval){if(curvyBrowser.isOp||curvyBrowser.isIE){if(!curvyCorners.redrawList)throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.");var i,j=curvyCorners.redrawList.length;for(i=0;i<j;++i)if(curvyCorners.redrawList[i].node===obj)break;if(i===j)throw curvyCorners.newError("Object not redrawable");obj=curvyCorners.redrawList[i].copy}if(prop.indexOf(".")===-1)obj[prop]=newval;else eval("obj."+prop+"='"+newval+"'")};curvyCorners.handleWinResize=function(){if(!curvyCorners.block_redraw)curvyCorners.redraw()};curvyCorners.setWinResize=function(a){curvyCorners.block_redraw=!a};curvyCorners.newError=function(a){return new Error("curvyCorners Error:\n"+a)};curvyCorners.alert=function(a){if(typeof curvyCornersVerbose==="undefined"||curvyCornersVerbose)alert(a)};function curvyObject(){var g;this.box=arguments[1];this.settings=arguments[0];this.topContainer=this.bottomContainer=this.shell=g=null;var c=this.box.clientWidth;if(!c&&curvyBrowser.isIE){this.box.style.zoom=1;c=this.box.clientWidth}if(!c){if(!this.box.parentNode)throw this.newError("box has no parent!");for(g=this.box;true;g=g.parentNode){if(!g||g.tagName==="BODY"){this.applyCorners=function(){};curvyCorners.alert(this.errmsg("zero-width box with no accountable parent","warning"));return}if(g.style.display==="none")break}g.style.display="block";c=this.box.clientWidth}if(arguments[0]instanceof curvyCnrSpec)this.spec=arguments[0].cloneOn(this.box);else{this.spec=new curvyCnrSpec("");this.spec.setfrom(this.settings)}var r=curvyBrowser.get_style(this.box,"borderTopWidth"),x=curvyBrowser.get_style(this.box,"borderBottomWidth"),u=curvyBrowser.get_style(this.box,"borderLeftWidth"),s=curvyBrowser.get_style(this.box,"borderRightWidth"),w=curvyBrowser.get_style(this.box,"borderTopColor"),v=curvyBrowser.get_style(this.box,"borderBottomColor"),q=curvyBrowser.get_style(this.box,"borderLeftColor"),m=curvyBrowser.get_style(this.box,"backgroundColor"),l=curvyBrowser.get_style(this.box,"backgroundImage"),n=curvyBrowser.get_style(this.box,"backgroundRepeat");if(this.box.currentStyle&&this.box.currentStyle.backgroundPositionX)var b=curvyBrowser.get_style(this.box,"backgroundPositionX"),e=curvyBrowser.get_style(this.box,"backgroundPositionY");else{var b=curvyBrowser.get_style(this.box,"backgroundPosition");b=b.split(" ");var e=b[1];b=b[0]}var y=curvyBrowser.get_style(this.box,"position"),o=curvyBrowser.get_style(this.box,"paddingTop"),t=curvyBrowser.get_style(this.box,"paddingBottom"),A=curvyBrowser.get_style(this.box,"paddingLeft"),p=curvyBrowser.get_style(this.box,"paddingRight"),C=curvyBrowser.get_style(this.box,"border");filter=curvyBrowser.ieVer>7?curvyBrowser.get_style(this.box,"filter"):null;var f=this.spec.get("tR"),h=this.spec.get("bR"),d=function(a){if(typeof a==="number")return a;if(typeof a!=="string")throw new Error("unexpected styleToNPx type "+typeof a);var b=/^[-\d.]([a-z]+)$/.exec(a);if(b&&b[1]!="px")throw new Error("Unexpected unit "+b[1]);if(isNaN(a=parseInt(a)))a=0;return a},B=function(a){return a<=0?"0":a+"px"};try{this.borderWidth=d(r);this.borderWidthB=d(x);this.borderWidthL=d(u);this.borderWidthR=d(s);this.boxColour=curvyObject.format_colour(m);this.topPadding=d(o);this.bottomPadding=d(t);this.leftPadding=d(A);this.rightPadding=d(p);this.boxWidth=c;this.boxHeight=this.box.clientHeight;this.borderColour=curvyObject.format_colour(w);this.borderColourB=curvyObject.format_colour(v);this.borderColourL=curvyObject.format_colour(q);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.borderStringB=this.borderWidthB+"px solid "+this.borderColourB;this.backgroundImage=l!="none"?l:"";this.backgroundRepeat=n}catch(D){throw this.newError("getMessage" in D?D.getMessage():D.message)}var j=this.boxHeight,i=c;if(curvyBrowser.isOp){b=d(b);e=d(e);if(b){var k=i+this.borderWidthL+this.borderWidthR;if(b>k)b=k;b=k/b*100+"%"}if(e){var k=j+this.borderWidth+this.borderWidthB;if(e>k)e=k;e=k/e*100+"%"}}if(!curvyBrowser.quirksMode){this.boxWidth-=this.leftPadding+this.rightPadding;this.boxHeight-=this.topPadding+this.bottomPadding}this.contentContainer=document.createElement("div");if(filter)this.contentContainer.style.filter=filter;while(this.box.firstChild)this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild));if(y!="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=i+this.borderWidthL+this.borderWidthR+"px";this.box.style.height=j+this.borderWidth+this.borderWidthB+"px";var a=document.createElement("div");a.style.position="absolute";if(filter)a.style.filter=filter;if(curvyBrowser.quirksMode)a.style.width=i+this.borderWidthL+this.borderWidthR+"px";else a.style.width=i+"px";a.style.height=B(j+this.borderWidth+this.borderWidthB-f-h);a.style.padding="0";a.style.top=f+"px";a.style.left="0";if(this.borderWidthL)a.style.borderLeft=this.borderWidthL+"px solid "+this.borderColourL;if(this.borderWidth&&!f)a.style.borderTop=this.borderWidth+"px solid "+this.borderColour;if(this.borderWidthR)a.style.borderRight=this.borderWidthR+"px solid "+this.borderColourL;if(this.borderWidthB&&!h)a.style.borderBottom=this.borderWidthB+"px solid "+this.borderColourB;a.style.backgroundColor=m;a.style.backgroundImage=this.backgroundImage;a.style.backgroundRepeat=this.backgroundRepeat;this.shell=this.box.appendChild(a);c=curvyBrowser.get_style(this.shell,"width");if(c===""||c==="auto"||c.indexOf("%")!==-1)throw this.newError("Shell width is "+c);this.boxWidth=c!=""&&c!="auto"&&c.indexOf("%")==-1?parseInt(c):this.shell.clientWidth;this.applyCorners=function(){if(this.backgroundObject){var K=function(a,b,c){if(a===0)return 0;var e;if(a==="right"||a==="bottom")return c-b;if(a==="center")return (c-b)/2;if(a.indexOf("%")>0)return (c-b)*100/parseInt(a);return d(a)};this.backgroundPosX=K(b,this.backgroundObject.width,i);this.backgroundPosY=K(e,this.backgroundObject.height,j)}else if(this.backgroundImage){this.backgroundPosX=d(b);this.backgroundPosY=d(e)}if(f){m=document.createElement("div");m.style.width=this.boxWidth+"px";m.style.fontSize="1px";m.style.overflow="hidden";m.style.position="absolute";m.style.paddingLeft=this.borderWidth+"px";m.style.paddingRight=this.borderWidth+"px";m.style.height=f+"px";m.style.top=-f+"px";m.style.left=-this.borderWidthL+"px";this.topContainer=this.shell.appendChild(m)}if(h){var m=document.createElement("div");m.style.width=this.boxWidth+"px";m.style.fontSize="1px";m.style.overflow="hidden";m.style.position="absolute";m.style.paddingLeft=this.borderWidthB+"px";m.style.paddingRight=this.borderWidthB+"px";m.style.height=h+"px";m.style.bottom=-h+"px";m.style.left=-this.borderWidthL+"px";this.bottomContainer=this.shell.appendChild(m)}var H=this.spec.cornerNames();for(var I in H)if(!isNaN(I)){var p=H[I],a=this.spec[p+"R"],G,s,r,A;if(p=="tr"||p=="tl"){G=this.borderWidth;s=this.borderColour;A=this.borderWidth}else{G=this.borderWidthB;s=this.borderColourB;A=this.borderWidthB}r=a-A;var c=document.createElement("div");c.style.height=this.spec.get(p+"Ru");c.style.width=this.spec.get(p+"Ru");c.style.position="absolute";c.style.fontSize="1px";c.style.overflow="hidden";var l,o,D,v=filter?parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]):100;for(l=0;l<a;++l){var u=l+1>=r?-1:Math.floor(Math.sqrt(Math.pow(r,2)-Math.pow(l+1,2)))-1;if(r!=a)var x=l>=r?-1:Math.ceil(Math.sqrt(Math.pow(r,2)-Math.pow(l,2))),y=l+1>=a?-1:Math.floor(Math.sqrt(Math.pow(a,2)-Math.pow(l+1,2)))-1;var N=l>=a?-1:Math.ceil(Math.sqrt(Math.pow(a,2)-Math.pow(l,2)));if(u>-1)this.drawPixel(l,0,this.boxColour,v,u+1,c,true,a);if(r!=a){if(this.spec.antiAlias){for(o=u+1;o<x;++o)if(this.backgroundImage!=""){var O=curvyObject.pixelFraction(l,o,r)*100;this.drawPixel(l,o,s,v,1,c,O>=30,a)}else if(this.boxColour!=="transparent"){var L=curvyObject.BlendColour(this.boxColour,s,curvyObject.pixelFraction(l,o,r));this.drawPixel(l,o,L,v,1,c,false,a)}else this.drawPixel(l,o,s,v>>1,1,c,false,a);if(y>=x){if(x==-1)x=0;this.drawPixel(l,x,s,v,y-x+1,c,false,0)}D=s;o=y}else if(y>u)this.drawPixel(l,u+1,s,v,y-u,c,false,0)}else{D=this.boxColour;o=u}if(this.spec.antiAlias)while(++o<N)this.drawPixel(l,o,D,curvyObject.pixelFraction(l,o,a)*v,1,c,A<=0,a)}for(var E=0,M=c.childNodes.length;E<M;++E){var q=c.childNodes[E],t=parseInt(q.style.top),w=parseInt(q.style.left),C=parseInt(q.style.height);if(p=="tl"||p=="bl")q.style.left=a-w-1+"px";if(p=="tr"||p=="tl")q.style.top=a-C-t+"px";q.style.backgroundRepeat=this.backgroundRepeat;if(this.backgroundImage)switch(p){case "tr":q.style.backgroundPosition=this.backgroundPosX-this.borderWidthL+a-i-w+"px "+(this.backgroundPosY+C+t+this.borderWidth-a)+"px";break;case "tl":q.style.backgroundPosition=this.backgroundPosX-a+w+this.borderWidthL+"px "+(this.backgroundPosY-a+C+t+this.borderWidth)+"px";break;case "bl":q.style.backgroundPosition=this.backgroundPosX-a+w+1+this.borderWidthL+"px "+(this.backgroundPosY-j-this.borderWidth+(curvyBrowser.quirksMode?t:-t)+a)+"px";break;case "br":if(curvyBrowser.quirksMode)q.style.backgroundPosition=this.backgroundPosX+this.borderWidthL-i+a-w+"px "+(this.backgroundPosY-j-this.borderWidth+t+a)+"px";else q.style.backgroundPosition=this.backgroundPosX-this.borderWidthL-i+a-w+"px "+(this.backgroundPosY-j-this.borderWidth+a-t)+"px"}}switch(p){case "tl":c.style.top=c.style.left="0";this.topContainer.appendChild(c);break;case "tr":c.style.top=c.style.right="0";this.topContainer.appendChild(c);break;case "bl":c.style.bottom=c.style.left="0";this.bottomContainer.appendChild(c);break;case "br":c.style.bottom=c.style.right="0";this.bottomContainer.appendChild(c)}}var B={t:this.spec.radiusdiff("t"),b:this.spec.radiusdiff("b")};for(z in B){if(typeof z==="function")continue;if(!this.spec.get(z+"R"))continue;if(B[z]){if(this.backgroundImage&&this.spec.radiusSum(z)!==B[z])curvyCorners.alert(this.errmsg("Not supported: unequal non-zero top/bottom radii with background image"));var J=this.spec[z+"lR"]<this.spec[z+"rR"]?z+"l":z+"r",k=document.createElement("div");k.style.height=B[z]+"px";k.style.width=this.spec.get(J+"Ru");k.style.position="absolute";k.style.fontSize="1px";k.style.overflow="hidden";k.style.backgroundColor=this.boxColour;switch(J){case "tl":k.style.bottom=k.style.left="0";k.style.borderLeft=this.borderString;this.topContainer.appendChild(k);break;case "tr":k.style.bottom=k.style.right="0";k.style.borderRight=this.borderString;this.topContainer.appendChild(k);break;case "bl":k.style.top=k.style.left="0";k.style.borderLeft=this.borderStringB;this.bottomContainer.appendChild(k);break;case "br":k.style.top=k.style.right="0";k.style.borderRight=this.borderStringB;this.bottomContainer.appendChild(k)}}var n=document.createElement("div");if(filter)n.style.filter=filter;n.style.position="relative";n.style.fontSize="1px";n.style.overflow="hidden";n.style.width=this.fillerWidth(z);n.style.backgroundColor=this.boxColour;n.style.backgroundImage=this.backgroundImage;n.style.backgroundRepeat=this.backgroundRepeat;switch(z){case "t":if(this.topContainer){if(curvyBrowser.quirksMode)n.style.height=100+f+"px";else n.style.height=100+f-this.borderWidth+"px";n.style.marginLeft=this.spec.tlR?this.spec.tlR-this.borderWidthL+"px":"0";n.style.borderTop=this.borderString;if(this.backgroundImage){var F=this.spec.tlR?this.backgroundPosX-(f-this.borderWidthL)+"px ":"0 ";n.style.backgroundPosition=F+this.backgroundPosY+"px";this.shell.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-f+this.borderWidthL)+"px"}this.topContainer.appendChild(n)}break;case "b":if(this.bottomContainer){if(curvyBrowser.quirksMode)n.style.height=h+"px";else n.style.height=h-this.borderWidthB+"px";n.style.marginLeft=this.spec.blR?this.spec.blR-this.borderWidthL+"px":"0";n.style.borderBottom=this.borderStringB;if(this.backgroundImage){var F=this.spec.blR?this.backgroundPosX+this.borderWidthL-h+"px ":this.backgroundPosX+"px ";n.style.backgroundPosition=F+(this.backgroundPosY-j-this.borderWidth+h)+"px"}this.bottomContainer.appendChild(n)}}}this.contentContainer.style.position="absolute";this.contentContainer.className="autoPadDiv";this.contentContainer.style.left=this.borderWidthL+"px";this.contentContainer.style.paddingTop=this.topPadding+"px";this.contentContainer.style.top=this.borderWidth+"px";this.contentContainer.style.paddingLeft=this.leftPadding+"px";this.contentContainer.style.paddingRight=this.rightPadding+"px";z=i;if(!curvyBrowser.quirksMode)z-=this.leftPadding+this.rightPadding;this.contentContainer.style.width=z+"px";this.contentContainer.style.textAlign=curvyBrowser.get_style(this.box,"textAlign");this.box.style.textAlign="left";this.box.appendChild(this.contentContainer);if(g)g.style.display="none"};if(this.backgroundImage){b=this.backgroundCheck(b);e=this.backgroundCheck(e);if(this.backgroundObject){this.backgroundObject.holdingElement=this;this.dispatch=this.applyCorners;this.applyCorners=function(){if(this.backgroundObject.complete)this.dispatch();else this.backgroundObject.onload=new Function("curvyObject.dispatch(this.holdingElement);")}}}}curvyObject.prototype.backgroundCheck=function(a){if(a==="top"||a==="left"||parseInt(a)===0)return 0;if(!/^[-\d.]+px$/.test(a)&&!this.backgroundObject){this.backgroundObject=new Image;var b=function(b){var a=/url\("?([^'"]+)"?\)/.exec(b);return a?a[1]:b};this.backgroundObject.src=b(this.backgroundImage)}return a};curvyObject.dispatch=function(a){if("dispatch" in a)a.dispatch();else throw a.newError("No dispatch function")};curvyObject.prototype.drawPixel=function(d,c,e,b,i,j,f,h){var a=document.createElement("div");a.style.height=i+"px";a.style.width="1px";a.style.position="absolute";a.style.fontSize="1px";a.style.overflow="hidden";var g=this.spec.get("tR");a.style.backgroundColor=e;if(f&&this.backgroundImage!=""){a.style.backgroundImage=this.backgroundImage;a.style.backgroundPosition="-"+(this.boxWidth-(h-d)+this.borderWidth)+"px -"+(this.boxHeight+g+c-this.borderWidth)+"px"}if(b!=100)curvyObject.setOpacity(a,b);a.style.top=c+"px";a.style.left=d+"px";j.appendChild(a)};curvyObject.prototype.fillerWidth=function(a){var b=curvyBrowser.quirksMode?0:this.spec.radiusCount(a)*this.borderWidthL;return this.boxWidth-this.spec.radiusSum(a)+b+"px"};curvyObject.prototype.errmsg=function(d,c){var a="\ntag: "+this.box.tagName;if(this.box.id)a+="\nid: "+this.box.id;if(this.box.className)a+="\nclass: "+this.box.className;var b;if((b=this.box.parentNode)===null)a+="\n(box has no parent)";else{a+="\nParent tag: "+b.tagName;if(b.id)a+="\nParent ID: "+b.id;if(b.className)a+="\nParent class: "+b.className}if(c===undefined)c="warning";return "curvyObject "+c+":\n"+d+a};curvyObject.prototype.newError=function(a){return new Error(this.errmsg(a,"exception"))};curvyObject.IntToHex=function(b){var a=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];return a[b>>>4]+""+a[b&15]};curvyObject.BlendColour=function(c,b,a){if(c==="transparent"||b==="transparent")throw this.newError("Cannot blend with transparent");if(c.charAt(0)!=="#")c=curvyObject.format_colour(c);if(b.charAt(0)!=="#")b=curvyObject.format_colour(b);var h=parseInt(c.substr(1,2),16),l=parseInt(c.substr(3,2),16),j=parseInt(c.substr(5,2),16),g=parseInt(b.substr(1,2),16),k=parseInt(b.substr(3,2),16),i=parseInt(b.substr(5,2),16);if(a>1||a<0)a=1;var f=Math.round(h*a+g*(1-a));if(f>255)f=255;if(f<0)f=0;var e=Math.round(l*a+k*(1-a));if(e>255)e=255;if(e<0)e=0;var d=Math.round(j*a+i*(1-a));if(d>255)d=255;if(d<0)d=0;return "#"+curvyObject.IntToHex(f)+curvyObject.IntToHex(e)+curvyObject.IntToHex(d)};curvyObject.pixelFraction=function(f,e,j){var g,i=j*j,b=new Array(2),c=new Array(2),d=0,h="",a=Math.sqrt(i-Math.pow(f,2));if(a>=e&&a<e+1){h="Left";b[d]=0;c[d]=a-e;++d}a=Math.sqrt(i-Math.pow(e+1,2));if(a>=f&&a<f+1){h+="Top";b[d]=a-f;c[d]=1;++d}a=Math.sqrt(i-Math.pow(f+1,2));if(a>=e&&a<e+1){h+="Right";b[d]=1;c[d]=a-e;++d}a=Math.sqrt(i-Math.pow(e,2));if(a>=f&&a<f+1){h+="Bottom";b[d]=a-f;c[d]=0}switch(h){case "LeftRight":g=Math.min(c[0],c[1])+(Math.max(c[0],c[1])-Math.min(c[0],c[1]))/2;break;case "TopRight":g=1-(1-b[0])*(1-c[1])/2;break;case "TopBottom":g=Math.min(b[0],b[1])+(Math.max(b[0],b[1])-Math.min(b[0],b[1]))/2;break;case "LeftBottom":g=c[0]*b[1]/2;break;default:g=1}return g};curvyObject.rgb2Array=function(a){var b=a.substring(4,a.indexOf(")"));return b.split(", ")};curvyObject.rgb2Hex=function(c){try{var a=curvyObject.rgb2Array(c),f=parseInt(a[0]),e=parseInt(a[1]),b=parseInt(a[2]),d="#"+curvyObject.IntToHex(f)+curvyObject.IntToHex(e)+curvyObject.IntToHex(b)}catch(h){var g="getMessage" in h?h.getMessage():h.message;throw new Error("Error ("+g+") converting RGB value to Hex in rgb2Hex")}return d};curvyObject.setOpacity=function(a,b){b=b==100?99.999:b;if(curvyBrowser.isSafari&&a.tagName!="IFRAME"){var c=curvyObject.rgb2Array(a.style.backgroundColor),f=parseInt(c[0]),e=parseInt(c[1]),d=parseInt(c[2]);a.style.backgroundColor="rgba("+f+", "+e+", "+d+", "+b/100+")"}else if(typeof a.style.opacity!=="undefined")a.style.opacity=b/100;else if(typeof a.style.MozOpacity!=="undefined")a.style.MozOpacity=b/100;else if(typeof a.style.filter!="undefined")a.style.filter="alpha(opacity="+b+")";else if(typeof a.style.KHTMLOpacity!="undefined")a.style.KHTMLOpacity=b/100};function addEvent(a,c,b,d){if(a.addEventListener){a.addEventListener(c,b,d);return true}if(a.attachEvent)return a.attachEvent("on"+c,b);a["on"+c]=b;return false}curvyObject.getComputedColour=function(e){var a=document.createElement("DIV");a.style.backgroundColor=e;document.body.appendChild(a);if(window.getComputedStyle){var c=document.defaultView.getComputedStyle(a,null).getPropertyValue("background-color");a.parentNode.removeChild(a);if(c.substr(0,3)==="rgb")c=curvyObject.rgb2Hex(c);return c}else{var b=document.body.createTextRange();b.moveToElementText(a);b.execCommand("ForeColor",false,e);var d=b.queryCommandValue("ForeColor"),f="rgb("+(d&255)+", "+((d&65280)>>8)+", "+((d&16711680)>>16)+")";a.parentNode.removeChild(a);b=null;return curvyObject.rgb2Hex(f)}};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(a,g){var e=[];if(g===undefined)g=document;a=a.split(".");var d="*";if(a.length===1){d=a[0];a=false}else{if(a[0])d=a[0];a=a[1]}var b,c,f;if(d.charAt(0)==="#"){c=document.getElementById(d.substr(1));if(c)e.push(c)}else{c=g.getElementsByTagName(d);f=c.length;if(a){var h=new RegExp("(^|\\s)"+a+"(\\s|$)");for(b=0;b<f;++b)if(h.test(c[b].className))e.push(c[b])}else for(b=0;b<f;++b)e.push(c[b])}return e};if(curvyBrowser.isMoz||curvyBrowser.isWebKit)var curvyCornersNoAutoScan=true;else{curvyCorners.scanStyles=function(){function d(a){var b=/^[\d.]+(\w+)$/.exec(a);return b[1]}var a,b,c;if(curvyBrowser.isIE){function e(i){var a=i.style;if(curvyBrowser.ieVer>6)var f=a["-webkit-border-radius"]||0,g=a["-webkit-border-top-right-radius"]||0,c=a["-webkit-border-top-left-radius"]||0,e=a["-webkit-border-bottom-right-radius"]||0,h=a["-webkit-border-bottom-left-radius"]||0;else var f=a["webkit-border-radius"]||0,g=a["webkit-border-top-right-radius"]||0,c=a["webkit-border-top-left-radius"]||0,e=a["webkit-border-bottom-right-radius"]||0,h=a["webkit-border-bottom-left-radius"]||0;if(f||c||g||e||h){var b=new curvyCnrSpec(i.selectorText);if(f)b.setcorner(null,null,parseInt(f),d(f));else{if(g)b.setcorner("t","r",parseInt(g),d(g));if(c)b.setcorner("t","l",parseInt(c),d(c));if(h)b.setcorner("b","l",parseInt(h),d(h));if(e)b.setcorner("b","r",parseInt(e),d(e))}curvyCorners(b)}}for(a=0;a<document.styleSheets.length;++a){if(document.styleSheets[a].imports)for(b=0;b<document.styleSheets[a].imports.length;++b)for(c=0;c<document.styleSheets[a].imports[b].rules.length;++c)e(document.styleSheets[a].imports[b].rules[c]);for(b=0;b<document.styleSheets[a].rules.length;++b)e(document.styleSheets[a].rules[b])}}else if(curvyBrowser.isOp){for(a=0;a<document.styleSheets.length;++a)if(operasheet.contains_border_radius(a)){c=new operasheet(a);for(b in c.rules)if(!isNaN(b))curvyCorners(c.rules[b])}}else curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox")};curvyCorners.init=function(){if(arguments.callee.done)return;arguments.callee.done=true;if(curvyBrowser.isWebKit&&curvyCorners.init.timer){clearInterval(curvyCorners.init.timer);curvyCorners.init.timer=null}curvyCorners.scanStyles()}}if(typeof curvyCornersNoAutoScan==="undefined"||curvyCornersNoAutoScan===false)if(curvyBrowser.isOp)document.addEventListener("DOMContentLoaded",curvyCorners.init,false);else addEvent(window,"load",curvyCorners.init,false)
