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