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