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