(function(d){function r(a,b){return parseInt(d.css(a,b))||0}function o(a){a=parseInt(a).toString(16);return a.length<2?"0"+a:a}function v(a){for(;a&&a.nodeName.toLowerCase()!="html";a=a.parentNode){var b=d.css(a,"backgroundColor");if(b!="rgba(0, 0, 0, 0)"){if(b.indexOf("rgb")>=0){a=b.match(/\d+/g);return"#"+o(a[0])+o(a[1])+o(a[2])}if(b&&b!="transparent")return b}}return"#ffffff"}function w(a,b,c){switch(a){case "round":return Math.round(c*(1-Math.cos(Math.asin(b/c))));case "cool":return Math.round(c*
(1+Math.cos(Math.asin(b/c))));case "sharp":return Math.round(c*(1-Math.cos(Math.acos(b/c))));case "bite":return Math.round(c*Math.cos(Math.asin((c-b-1)/c)));case "slide":return Math.round(c*Math.atan2(b,c/b));case "jut":return Math.round(c*Math.atan2(c,c-b-1));case "curl":return Math.round(c*Math.atan(b));case "tear":return Math.round(c*Math.cos(b));case "wicked":return Math.round(c*Math.tan(b));case "long":return Math.round(c*Math.sqrt(b));case "sculpt":return Math.round(c*Math.log(c-b-1,c));case "dog":return b&
1?b+1:c;case "dog2":return b&2?b+1:c;case "dog3":return b&3?b+1:c;case "fray":return b%2*c;case "notch":return c;case "bevel":return b+1}}var g=d.browser.mozilla&&/gecko/i.test(navigator.userAgent),p=d.browser.safari&&d.browser.version>=3,s=!g&&!p&&function(){if(!d.browser.msie)return false;var a=document.createElement("div");try{a.style.setExpression("width","0+0")}catch(b){return false}return true}();d.fn.corner=function(a){if(this.length==0){if(!d.isReady&&this.selector){var b=this.selector,c=
this.context;d(function(){d(b,c).corner(a)})}return this}a=(a||"").toLowerCase();var x=/keep/.test(a),y=(a.match(/cc:(#[0-9a-f]+)/)||[])[1],z=(a.match(/sc:(#[0-9a-f]+)/)||[])[1],h=parseInt((a.match(/(\d+)px/)||[])[1])||10,A=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/,t=(a.match(A)||["round"])[0],u={T:0,B:1},f={TL:/top|tl/.test(a),TR:/top|tr/.test(a),BL:/bottom|bl/.test(a),BR:/bottom|br/.test(a)};if(!f.TL&&!f.TR&&!f.BL&&!f.BR)f={TL:1,TR:1,BL:1,BR:1};
if(d.fn.corner.defaults.useNative&&t=="round"&&(g||p)){if(f.TL)this.css(g?"-moz-border-radius-topleft":"-webkit-border-top-left-radius",h+"px");if(f.TR)this.css(g?"-moz-border-radius-topright":"-webkit-border-top-right-radius",h+"px");if(f.BL)this.css(g?"-moz-border-radius-bottomleft":"-webkit-border-bottom-left-radius",h+"px");if(f.BR)this.css(g?"-moz-border-radius-bottomright":"-webkit-border-bottom-right-radius",h+"px");return this}var j=document.createElement("div");j.style.overflow="hidden";
j.style.height="1px";j.style.backgroundColor=z||"transparent";j.style.borderStyle="solid";return this.each(function(){var i={T:parseInt(d.css(this,"paddingTop"))||0,R:parseInt(d.css(this,"paddingRight"))||0,B:parseInt(d.css(this,"paddingBottom"))||0,L:parseInt(d.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined)this.style.zoom=1;if(!x)this.style.border="none";j.style.borderColor=y||v(this.parentNode);var B=d.curCSS(this,"height");for(var m in u){var k=u[m];if(k&&(f.BL||f.BR)||!k&&
(f.TL||f.TR)){j.style.borderStyle="none "+(f[m+"R"]?"solid":"none")+" none "+(f[m+"L"]?"solid":"none");var l=document.createElement("div");d(l).addClass("jquery-corner");var e=l.style;k?this.appendChild(l):this.insertBefore(l,this.firstChild);if(k&&B!="auto"){if(d.css(this,"position")=="static")this.style.position="relative";e.position="absolute";e.bottom=e.left=e.padding=e.margin="0";if(s)e.setExpression("width","this.parentNode.offsetWidth");else e.width="100%"}else if(!k&&d.browser.msie){if(d.css(this,
"position")=="static")this.style.position="relative";e.position="absolute";e.top=e.left=e.right=e.padding=e.margin="0";if(s){var n=r(this,"borderLeftWidth")+r(this,"borderRightWidth");e.setExpression("width","this.parentNode.offsetWidth - "+n+'+ "px"')}else e.width="100%"}else{e.position="relative";e.margin=!k?"-"+i.T+"px -"+i.R+"px "+(i.T-h)+"px -"+i.L+"px":i.B-h+"px -"+i.R+"px -"+i.B+"px -"+i.L+"px"}for(e=0;e<h;e++){n=Math.max(0,w(t,e,h));var q=j.cloneNode(false);q.style.borderWidth="0 "+(f[m+"R"]?
n:0)+"px 0 "+(f[m+"L"]?n:0)+"px";k?l.appendChild(q):l.insertBefore(q,l.firstChild)}}}})};d.fn.uncorner=function(){if(g||p)this.css(g?"-moz-border-radius":"-webkit-border-radius",0);d("div.jquery-corner",this).remove();return this};d.fn.corner.defaults={useNative:true}})(jQuery);
