(function(p){var r=navigator.userAgent;var m=p.browser.mozilla&&/gecko/i.test(r);var k=p.browser.safari&&/Safari\/[5-9]/.test(r);var l=p.browser.msie&&(function(){var a=document.createElement("div");try{a.style.setExpression("width","0+0");a.style.removeExpression("width")}catch(b){return false}return true})();function n(b,a){return parseInt(p.css(b,a))||0}function j(a){var a=parseInt(a).toString(16);return(a.length<2)?"0"+a:a}function q(a){for(;a&&a.nodeName.toLowerCase()!="html";a=a.parentNode){var c=p.css(a,"backgroundColor");if(c=="rgba(0, 0, 0, 0)"){continue}if(c.indexOf("rgb")>=0){var b=c.match(/\d+/g);return"#"+j(b[0])+j(b[1])+j(b[2])}if(c&&c!="transparent"){return c}}return"#ffffff"}function o(a,c,b){switch(a){case"round":return Math.round(b*(1-Math.cos(Math.asin(c/b))));case"cool":return Math.round(b*(1+Math.cos(Math.asin(c/b))));case"sharp":return Math.round(b*(1-Math.cos(Math.acos(c/b))));case"bite":return Math.round(b*(Math.cos(Math.asin((b-c-1)/b))));case"slide":return Math.round(b*(Math.atan2(c,b/c)));case"jut":return Math.round(b*(Math.atan2(b,(b-c-1))));case"curl":return Math.round(b*(Math.atan(c)));case"tear":return Math.round(b*(Math.cos(c)));case"wicked":return Math.round(b*(Math.tan(c)));case"long":return Math.round(b*(Math.sqrt(c)));case"sculpt":return Math.round(b*(Math.log((b-c-1),b)));case"dog":return(c&1)?(c+1):b;case"dog2":return(c&2)?(c+1):b;case"dog3":return(c&3)?(c+1):b;case"fray":return(c%2)*b;case"notch":return b;case"bevel":return c+1}}p.fn.corner=function(c){if(this.length==0){if(!p.isReady&&this.selector){var b=this.selector,a=this.context;p(function(){p(b,a).corner(c)})}return this}return this.each(function(S){var U=p(this);var f=[c||"",U.attr(p.fn.corner.defaults.metaAttr)||""].join(" ").toLowerCase();var L=/keep/.test(f);var h=((f.match(/cc:(#[0-9a-f]+)/)||[])[1]);var Y=((f.match(/sc:(#[0-9a-f]+)/)||[])[1]);var T=parseInt((f.match(/(\d+)px/)||[])[1])||10;var d=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var W=((f.match(d)||["round"])[0]);var X={T:0,B:1};var M={TL:/top|tl|left/.test(f),TR:/top|tr|right/.test(f),BL:/bottom|bl|left/.test(f),BR:/bottom|br|right/.test(f)};if(!M.TL&&!M.TR&&!M.BL&&!M.BR){M={TL:1,TR:1,BL:1,BR:1}}if(p.fn.corner.defaults.useNative&&W=="round"&&(m||k)&&!h&&!Y){if(M.TL){U.css(m?"-moz-border-radius-topleft":"-webkit-border-top-left-radius",T+"px")}if(M.TR){U.css(m?"-moz-border-radius-topright":"-webkit-border-top-right-radius",T+"px")}if(M.BL){U.css(m?"-moz-border-radius-bottomleft":"-webkit-border-bottom-left-radius",T+"px")}if(M.BR){U.css(m?"-moz-border-radius-bottomright":"-webkit-border-bottom-right-radius",T+"px")}return}var R=document.createElement("div");R.style.overflow="hidden";R.style.height="1px";R.style.backgroundColor=Y||"transparent";R.style.borderStyle="solid";var g={T:parseInt(p.css(this,"paddingTop"))||0,R:parseInt(p.css(this,"paddingRight"))||0,B:parseInt(p.css(this,"paddingBottom"))||0,L:parseInt(p.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined){this.style.zoom=1}if(!L){this.style.border="none"}R.style.borderColor=h||q(this.parentNode);var V=p.curCSS(this,"height");for(var Q in X){var O=X[Q];if((O&&(M.BL||M.BR))||(!O&&(M.TL||M.TR))){R.style.borderStyle="none "+(M[Q+"R"]?"solid":"none")+" none "+(M[Q+"L"]?"solid":"none");var e=document.createElement("div");p(e).addClass("jquery-corner");var K=e.style;O?this.appendChild(e):this.insertBefore(e,this.firstChild);if(O&&V!="auto"){if(p.css(this,"position")=="static"){this.style.position="relative"}K.position="absolute";K.bottom=K.left=K.padding=K.margin="0";if(l){K.setExpression("width","this.parentNode.offsetWidth")}else{K.width="100%"}}else{if(!O&&p.browser.msie){if(p.css(this,"position")=="static"){this.style.position="relative"}K.position="absolute";K.top=K.left=K.right=K.padding=K.margin="0";if(l){var w=n(this,"borderLeftWidth")+n(this,"borderRightWidth");K.setExpression("width","this.parentNode.offsetWidth - "+w+'+ "px"')}else{K.width="100%"}}else{K.position="relative";K.margin=!O?"-"+g.T+"px -"+g.R+"px "+(g.T-T)+"px -"+g.L+"px":(g.B-T)+"px -"+g.R+"px -"+g.B+"px -"+g.L+"px"}}for(var N=0;N<T;N++){var P=Math.max(0,o(W,N,T));var i=R.cloneNode(false);i.style.borderWidth="0 "+(M[Q+"R"]?P:0)+"px 0 "+(M[Q+"L"]?P:0)+"px";O?e.appendChild(i):e.insertBefore(i,e.firstChild)}}}})};p.fn.uncorner=function(){if(m||k){this.css(m?"-moz-border-radius":"-webkit-border-radius",0)}p("div.jquery-corner",this).remove();return this};p.fn.corner.defaults={useNative:true,metaAttr:"data-corner"}})(jQuery);