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