(function(A){A.fn.corner=function(G){var K=A.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);var I=A.browser.msie&&A.browser.version=="8.0";function N(R,S){return parseInt(A.css(R,S))||0}function O(R){var R=parseInt(R).toString(16);return(R.length<2)?"0"+R:R}function F(T){for(;T&&T.nodeName.toLowerCase()!="html";T=T.parentNode){var R=A.css(T,"backgroundColor");if(R.indexOf("rgb")>=0){if(A.browser.safari&&R=="rgba(0, 0, 0, 0)"){continue}var S=R.match(/\d+/g);return"#"+O(S[0])+O(S[1])+O(S[2])}if(R&&R!="transparent"){return R}}return"#ffffff"}function Q(R){switch(J){case"round":return Math.round(E*(1-Math.cos(Math.asin(R/E))));case"cool":return Math.round(E*(1+Math.cos(Math.asin(R/E))));case"sharp":return Math.round(E*(1-Math.cos(Math.acos(R/E))));case"bite":return Math.round(E*(Math.cos(Math.asin((E-R-1)/E))));case"slide":return Math.round(E*(Math.atan2(R,E/R)));case"jut":return Math.round(E*(Math.atan2(E,(E-R-1))));case"curl":return Math.round(E*(Math.atan(R)));case"tear":return Math.round(E*(Math.cos(R)));case"wicked":return Math.round(E*(Math.tan(R)));case"long":return Math.round(E*(Math.sqrt(R)));case"sculpt":return Math.round(E*(Math.log((E-R-1),E)));case"dog":return(R&1)?(R+1):E;case"dog2":return(R&2)?(R+1):E;case"dog3":return(R&3)?(R+1):E;case"fray":return(R%2)*E;case"notch":return E;case"bevel":return R+1}}G=(G||"").toLowerCase();var C=/keep/.test(G);var H=((G.match(/cc:(#[0-9a-f]+)/)||[])[1]);var M=((G.match(/sc:(#[0-9a-f]+)/)||[])[1]);var E=parseInt((G.match(/(\d+)px/)||[])[1])||10;var P=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var J=((G.match(P)||["round"])[0]);var L={T:0,B:1};var B={TL:/top|tl/.test(G),TR:/top|tr/.test(G),BL:/bottom|bl/.test(G),BR:/bottom|br/.test(G)};if(!B.TL&&!B.TR&&!B.BL&&!B.BR){B={TL:1,TR:1,BL:1,BR:1}}var D=document.createElement("div");D.style.overflow="hidden";D.style.height="1px";D.style.backgroundColor=M||"transparent";D.style.borderStyle="solid";return this.each(function(V){var S={T:parseInt(A.css(this,"paddingTop"))||0,R:parseInt(A.css(this,"paddingRight"))||0,B:parseInt(A.css(this,"paddingBottom"))||0,L:parseInt(A.css(this,"paddingLeft"))||0};if(A.browser.msie){this.style.zoom=1}if(!C){this.style.border="none"}D.style.borderColor=H||F(this.parentNode);var X=A.curCSS(this,"height");for(var T in L){var Y=L[T];if((Y&&(B.BL||B.BR))||(!Y&&(B.TL||B.TR))){D.style.borderStyle="none "+(B[T+"R"]?"solid":"none")+" none "+(B[T+"L"]?"solid":"none");var Z=document.createElement("div");A(Z).addClass("jquery-corner");var R=Z.style;Y?this.appendChild(Z):this.insertBefore(Z,this.firstChild);if(Y&&X!="auto"){if(A.css(this,"position")=="static"){this.style.position="relative"}R.position="absolute";R.bottom=R.left=R.padding=R.margin="0";if(A.browser.msie&&!I){R.setExpression("width","this.parentNode.offsetWidth")}else{R.width="100%"}}else{if(!Y&&A.browser.msie){if(A.css(this,"position")=="static"){this.style.position="relative"}R.position="absolute";R.top=R.left=R.right=R.padding=R.margin="0";var a=0;if(K||!A.boxModel){a=N(this,"borderLeftWidth")+N(this,"borderRightWidth")}K?R.setExpression("width","this.parentNode.offsetWidth - "+a+'+ "px"'):R.width="100%"}else{R.margin=!Y?"-"+S.T+"px -"+S.R+"px "+(S.T-E)+"px -"+S.L+"px":(S.B-E)+"px -"+S.R+"px -"+S.B+"px -"+S.L+"px"}}for(var U=0;U<E;U++){var b=Math.max(0,Q(U));var W=D.cloneNode(false);W.style.borderWidth="0 "+(B[T+"R"]?b:0)+"px 0 "+(B[T+"L"]?b:0)+"px";Y?Z.appendChild(W):Z.insertBefore(W,Z.firstChild)}}}})};A.fn.uncorner=function(B){return A(".jquery-corner",this).remove()}})(jQuery);
