;(function($){var C=document.createElement('div').style;var D=C['MozBorderRadius']!==undefined;var E=C['WebkitBorderRadius']!==undefined;var F=C['borderRadius']!==undefined||C['BorderRadius']!==undefined;var G=document.documentMode||0;var H=$.browser.msie&&(($.browser.version<8&&!G)||G<8);var I=$.browser.msie&&(function(){var a=document.createElement('div');try{a.style.setExpression('width','0+0');a.style.removeExpression('width')}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){while(a){var v=$.css(a,'backgroundColor');if(v&&v!='transparent'&&v!='rgba(0, 0, 0, 0)'){if(v.indexOf('rgb')>=0){var b=v.match(/\d+/g);return'#'+hex2(b[0])+hex2(b[1])+hex2(b[2])}return v}a=a.parentNode}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'dogfold':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'bevelfold':case'bevel':return i+1}};$.fn.corner=function(B){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).corner(B)})}return this}return this.each(function(a){var b=$(this);var o=[b.attr($.fn.corner.defaults.metaAttr)||'',B||''].join(' ').toLowerCase();var f=/keep/.test(o);var g=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var h=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var k=parseInt((o.match(/(\d+)px/)||[])[1])||10;var l=/round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/;var m=((o.match(l)||['round'])[0]);var n=/dogfold|bevelfold/.test(o);var p={T:0,B:1};var q={TL:/top|tl|left/.test(o),TR:/top|tr|right/.test(o),BL:/bottom|bl|left/.test(o),BR:/bottom|br|right/.test(o)};if(!q.TL&&!q.TR&&!q.BL&&!q.BR)q={TL:1,TR:1,BL:1,BR:1};if($.fn.corner.defaults.useNative&&m=='round'&&(F||D||E)&&!g&&!h){if(q.TL)b.css(F?'border-top-left-radius':D?'-moz-border-radius-topleft':'-webkit-border-top-left-radius',k+'px');if(q.TR)b.css(F?'border-top-right-radius':D?'-moz-border-radius-topright':'-webkit-border-top-right-radius',k+'px');if(q.BL)b.css(F?'border-bottom-left-radius':D?'-moz-border-radius-bottomleft':'-webkit-border-bottom-left-radius',k+'px');if(q.BR)b.css(F?'border-bottom-right-radius':D?'-moz-border-radius-bottomright':'-webkit-border-bottom-right-radius',k+'px');return}var r=document.createElement('div');$(r).css({overflow:'hidden',height:'1px',minHeight:'1px',fontSize:'1px',backgroundColor:h||'transparent',borderStyle:'solid'});var s={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(!f)this.style.border='none';r.style.borderColor=g||gpc(this.parentNode);var t=$(this).outerHeight();for(var j in p){var u=p[j];if((u&&(q.BL||q.BR))||(!u&&(q.TL||q.TR))){r.style.borderStyle='none '+(q[j+'R']?'solid':'none')+' none '+(q[j+'L']?'solid':'none');var d=document.createElement('div');$(d).addClass('jquery-corner');var v=d.style;u?this.appendChild(d):this.insertBefore(d,this.firstChild);if(u&&t!='auto'){if($.css(this,'position')=='static')this.style.position='relative';v.position='absolute';v.bottom=v.left=v.padding=v.margin='0';if(I)v.setExpression('width','this.parentNode.offsetWidth');else v.width='100%'}else if(!u&&$.browser.msie){if($.css(this,'position')=='static')this.style.position='relative';v.position='absolute';v.top=v.left=v.right=v.padding=v.margin='0';if(I){var x=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');v.setExpression('width','this.parentNode.offsetWidth - '+x+'+ "px"')}else v.width='100%'}else{v.position='relative';v.margin=!u?'-'+s.T+'px -'+s.R+'px '+(s.T-k)+'px -'+s.L+'px':(s.B-k)+'px -'+s.R+'px -'+s.B+'px -'+s.L+'px'}for(var i=0;i<k;i++){var w=Math.max(0,getWidth(m,i,k));var e=r.cloneNode(false);e.style.borderWidth='0 '+(q[j+'R']?w:0)+'px 0 '+(q[j+'L']?w:0)+'px';u?d.appendChild(e):d.insertBefore(e,d.firstChild)}if(n&&$.support.boxModel){if(u&&H)continue;for(var c in q){if(!q[c])continue;if(u&&(c=='TL'||c=='TR'))continue;if(!u&&(c=='BL'||c=='BR'))continue;var y={position:'absolute',border:'none',margin:0,padding:0,overflow:'hidden',backgroundColor:r.style.borderColor};var z=$('<div/>').css(y).css({width:k+'px',height:'1px'});switch(c){case'TL':z.css({bottom:0,left:0});break;case'TR':z.css({bottom:0,right:0});break;case'BL':z.css({top:0,left:0});break;case'BR':z.css({top:0,right:0});break}d.appendChild(z[0]);var A=$('<div/>').css(y).css({top:0,bottom:0,width:'1px',height:k+'px'});switch(c){case'TL':A.css({left:k});break;case'TR':A.css({right:k});break;case'BL':A.css({left:k});break;case'BR':A.css({right:k});break}d.appendChild(A[0])}}}}})};$.fn.uncorner=function(){if(F||D||E)this.css(F?'border-radius':D?'-moz-border-radius':'-webkit-border-radius',0);$('div.jquery-corner',this).remove();return this};$.fn.corner.defaults={useNative:true,metaAttr:'data-corner'}})(jQuery);
