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