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