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