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