(function($){$.fn.corner=function(o){var k=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);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.indexOf('rgb')>=0){if($.browser.safari&&v=='rgba(0, 0, 0, 0)')continue;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 getW(i){switch(t){case'round':return Math.round(q*(1-Math.cos(Math.asin(i/q))));case'cool':return Math.round(q*(1+Math.cos(Math.asin(i/q))));case'sharp':return Math.round(q*(1-Math.cos(Math.acos(i/q))));case'bite':return Math.round(q*(Math.cos(Math.asin((q-i-1)/q))));case'slide':return Math.round(q*(Math.atan2(i,q/i)));case'jut':return Math.round(q*(Math.atan2(q,(q-i-1))));case'curl':return Math.round(q*(Math.atan(i)));case'tear':return Math.round(q*(Math.cos(i)));case'wicked':return Math.round(q*(Math.tan(i)));case'long':return Math.round(q*(Math.sqrt(i)));case'sculpt':return Math.round(q*(Math.log((q-i-1),q)));case'dog':return(i&1)?(i+1):q;case'dog2':return(i&2)?(i+1):q;case'dog3':return(i&3)?(i+1):q;case'fray':return(i%2)*q;case'notch':return q;case'bevel':return i+1}};o=(o||"").toLowerCase();var l=/keep/.test(o);var m=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var n=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var q=parseInt((o.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 t=((o.match(r)||['round'])[0]);var u={T:0,B:1};var x={TL:/top|tl/.test(o),TR:/top|tr/.test(o),BL:/bottom|bl/.test(o),BR:/bottom|br/.test(o)};if(!x.TL&&!x.TR&&!x.BL&&!x.BR)x={TL:1,TR:1,BL:1,BR:1};var y=document.createElement('div');y.style.overflow='hidden';y.style.height='1px';y.style.backgroundColor=n||'transparent';y.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($.browser.msie)this.style.zoom=1;if(!l)this.style.border='none';y.style.borderColor=m||gpc(this.parentNode);var c=$.curCSS(this,'height');for(var j in u){var f=u[j];if((f&&(x.BL||x.BR))||(!f&&(x.TL||x.TR))){y.style.borderStyle='none '+(x[j+'R']?'solid':'none')+' none '+(x[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($.browser.msie)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';var h=0;if(k||!$.boxModel)h=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');k?g.setExpression('width','this.parentNode.offsetWidth - '+h+'+ "px"'):g.width='100%'}else{g.margin=!f?'-'+b.T+'px -'+b.R+'px '+(b.T-q)+'px -'+b.L+'px':(b.B-q)+'px -'+b.R+'px -'+b.B+'px -'+b.L+'px'}for(var i=0;i<q;i++){var w=Math.max(0,getW(i));var e=y.cloneNode(false);e.style.borderWidth='0 '+(x[j+'R']?w:0)+'px 0 '+(x[j+'L']?w:0)+'px';f?d.appendChild(e):d.insertBefore(e,d.firstChild)}}}})};$.fn.uncorner=function(o){return $('.jquery-corner',this).remove()}})(jQuery);$(function(){$('.corner').each(function(){$(this).corner()});$('[@class*="corner_"]').each(function(){var a=$(this).attr('class');var b=new RegExp("(.* )?(corner_[^ ]*)( .*)?","g");a=a.replace(b,"$2");b=new RegExp("_parent","g");a=a.replace(b,".parent()");b=new RegExp("_css_(.*)_corner","g");a=a.replace(b,".css('$1').corner");a=a.replace("__","', '","g");b=new RegExp("corner_([^\.]*)","g");a=a.replace(b,"corner('$1')");a=a.replace("_"," ","g");a='$(this).'+a;eval(a)})});
