/*
* jQuery corner plugin: simple corner rounding
* Examples and documentation at: http://jquery.malsup.com/corner/
* version 1.98 (02-JUN-2009)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function(c){var e=(function(){if(!c.browser.msie){return false}var h=document.createElement("div");try{h.style.setExpression("width","0+0")}catch(g){return false}return true})();function d(g,h){return parseInt(c.css(g,h))||0}function b(g){var g=parseInt(g).toString(16);return(g.length<2)?"0"+g:g}function f(i){for(;i&&i.nodeName.toLowerCase()!="html";i=i.parentNode){var g=c.css(i,"backgroundColor");if(g=="rgba(0, 0, 0, 0)"){continue}if(g.indexOf("rgb")>=0){var h=g.match(/\d+/g);return"#"+b(h[0])+b(h[1])+b(h[2])}if(g&&g!="transparent"){return g}}return"#ffffff"}function a(j,g,h){switch(j){case"round":return Math.round(h*(1-Math.cos(Math.asin(g/h))));case"cool":return Math.round(h*(1+Math.cos(Math.asin(g/h))));case"sharp":return Math.round(h*(1-Math.cos(Math.acos(g/h))));case"bite":return Math.round(h*(Math.cos(Math.asin((h-g-1)/h))));case"slide":return Math.round(h*(Math.atan2(g,h/g)));case"jut":return Math.round(h*(Math.atan2(h,(h-g-1))));case"curl":return Math.round(h*(Math.atan(g)));case"tear":return Math.round(h*(Math.cos(g)));case"wicked":return Math.round(h*(Math.tan(g)));case"long":return Math.round(h*(Math.sqrt(g)));case"sculpt":return Math.round(h*(Math.log((h-g-1),h)));case"dog":return(g&1)?(g+1):h;case"dog2":return(g&2)?(g+1):h;case"dog3":return(g&3)?(g+1):h;case"fray":return(g%2)*h;case"notch":return h;case"bevel":return g+1}}c.fn.corner=function(k){if(this.length==0){if(!c.isReady&&this.selector){var t=this.selector,p=this.context;c(function(){c(t,p).corner(k)})}return this}k=(k||"").toLowerCase();var h=/keep/.test(k);var l=((k.match(/cc:(#[0-9a-f]+)/)||[])[1]);var q=((k.match(/sc:(#[0-9a-f]+)/)||[])[1]);var j=parseInt((k.match(/(\d+)px/)||[])[1])||10;var r=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var m=((k.match(r)||["round"])[0]);var n={T:0,B:1};var g={TL:/top|tl/.test(k),TR:/top|tr/.test(k),BL:/bottom|bl/.test(k),BR:/bottom|br/.test(k)};if(!g.TL&&!g.TR&&!g.BL&&!g.BR){g={TL:1,TR:1,BL:1,BR:1}}var i=document.createElement("div");i.style.overflow="hidden";i.style.height="1px";i.style.backgroundColor=q||"transparent";i.style.borderStyle="solid";return this.each(function(x){var s={T:parseInt(c.css(this,"paddingTop"))||0,R:parseInt(c.css(this,"paddingRight"))||0,B:parseInt(c.css(this,"paddingBottom"))||0,L:parseInt(c.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined){this.style.zoom=1}if(!h){this.style.border="none"}i.style.borderColor=l||f(this.parentNode);var z=c.curCSS(this,"height");for(var u in n){var A=n[u];if((A&&(g.BL||g.BR))||(!A&&(g.TL||g.TR))){i.style.borderStyle="none "+(g[u+"R"]?"solid":"none")+" none "+(g[u+"L"]?"solid":"none");var B=document.createElement("div");c(B).addClass("jquery-corner");var o=B.style;A?this.appendChild(B):this.insertBefore(B,this.firstChild);if(A&&z!="auto"){if(c.css(this,"position")=="static"){this.style.position="relative"}o.position="absolute";o.bottom=o.left=o.padding=o.margin="0";if(e){o.setExpression("width","this.parentNode.offsetWidth")}else{o.width="100%"}}else{if(!A&&c.browser.msie){if(c.css(this,"position")=="static"){this.style.position="relative"}o.position="absolute";o.top=o.left=o.right=o.padding=o.margin="0";if(e){var C=d(this,"borderLeftWidth")+d(this,"borderRightWidth");o.setExpression("width","this.parentNode.offsetWidth - "+C+'+ "px"')}else{o.width="100%"}}else{o.margin=!A?"-"+s.T+"px -"+s.R+"px "+(s.T-j)+"px -"+s.L+"px":(s.B-j)+"px -"+s.R+"px -"+s.B+"px -"+s.L+"px"}}for(var v=0;v<j;v++){var D=Math.max(0,a(m,v,j));var y=i.cloneNode(false);y.style.borderWidth="0 "+(g[u+"R"]?D:0)+"px 0 "+(g[u+"L"]?D:0)+"px";A?B.appendChild(y):B.insertBefore(y,B.firstChild)}}}})};c.fn.uncorner=function(){c("div.jquery-corner",this).remove();return this}})(jQuery);