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