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