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