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