jQuery.fn.corners=function(z){var n="rounded_by_jQuery_corners";var e=aa(z);var w=false;try{w=(document.body.style.WebkitBorderRadius!==undefined);var b=navigator.userAgent.indexOf("Chrome");if(b>=0){w=false}}catch(x){}var d=false;try{d=(document.body.style.MozBorderRadius!==undefined);var b=navigator.userAgent.indexOf("Firefox");if(b>=0&&parseInt(navigator.userAgent.substring(b+8))<3){d=false}}catch(x){}return this.each(function(A,D){$e=jQuery(D);if($e.hasClass(n)){return}$e.addClass(n);var B=/{(.*)}/.exec(D.className);var G=B?aa(B[1],e):e;var C=D.nodeName.toLowerCase();if(C=="input"){D=m(D)}if(w&&G.webkit){q(D,G)}else{if(d&&G.mozilla&&(G.sizex==G.sizey)){o(D,G)}else{var F=y(D.parentNode);var E=y(D);switch(C){case"a":case"input":a(D,G,F,E);break;default:j(D,G,F,E);break}}}});function q(C,D){var B=""+D.sizex+"px "+D.sizey+"px";var A=jQuery(C);if(D.tl){A.css("WebkitBorderTopLeftRadius",B)}if(D.tr){A.css("WebkitBorderTopRightRadius",B)}if(D.bl){A.css("WebkitBorderBottomLeftRadius",B)}if(D.br){A.css("WebkitBorderBottomRightRadius",B)}}function o(C,D){var B=""+D.sizex+"px";var A=jQuery(C);if(D.tl){A.css("-moz-border-radius-topleft",B)}if(D.tr){A.css("-moz-border-radius-topright",B)}if(D.bl){A.css("-moz-border-radius-bottomleft",B)}if(D.br){A.css("-moz-border-radius-bottomright",B)}}function a(D,A,C,L){var B=i("table");var F=i("tbody");B.appendChild(F);var E=i("tr");var I=i("td","top");E.appendChild(I);var G=i("tr");var J=h(D,A,i("td"));G.appendChild(J);var H=i("tr");var K=i("td","bottom");H.appendChild(K);if(A.tl||A.tr){F.appendChild(E);c(I,A,C,L,true)}F.appendChild(G);if(A.bl||A.br){F.appendChild(H);c(K,A,C,L,false)}D.appendChild(B);if(jQuery.browser.msie){B.onclick=k}D.style.overflow="hidden"}function k(){if(!this.parentNode.onclick){this.parentNode.click()}}function m(C){var A=document.createElement("a");A.id=C.id;A.className=C.className;if(C.onclick){A.href="javascript:";A.onclick=C.onclick}else{jQuery(C).parent("form").each(function(){A.href=this.action});A.onclick=t}var B=document.createTextNode(C.value);A.appendChild(B);C.parentNode.replaceChild(A,C);return A}function t(){jQuery(this).parent("form").each(function(){this.submit()});return false}function j(D,B,A,E){var C=h(D,B,document.createElement("div"));D.appendChild(C);if(B.tl||B.tr){c(D,B,A,E,true)}if(B.bl||B.br){c(D,B,A,E,false)}}function h(E,F,D){var A=jQuery(E);var C;while(C=E.firstChild){D.appendChild(C)}if(E.style.height){var G=parseInt(A.css("height"));D.style.height=G+"px";G+=parseInt(A.css("padding-top"))+parseInt(A.css("padding-bottom"));E.style.height=G+"px"}if(E.style.width){var B=parseInt(A.css("width"));D.style.width=B+"px";B+=parseInt(A.css("padding-left"))+parseInt(A.css("padding-right"));E.style.width=B+"px"}D.style.paddingLeft=A.css("padding-left");D.style.paddingRight=A.css("padding-right");if(F.tl||F.tr){D.style.paddingTop=f(E,F,A.css("padding-top"),true)}else{D.style.paddingTop=A.css("padding-top")}if(F.bl||F.br){D.style.paddingBottom=f(E,F,A.css("padding-bottom"),false)}else{D.style.paddingBottom=A.css("padding-bottom")}E.style.padding=0;return D}function f(C,B,D,E){if(D.indexOf("px")<0){try{console.error("%s padding not in pixels",(E?"top":"bottom"),C)}catch(A){}D=B.sizey+"px"}D=parseInt(D);if(D-B.sizey<0){try{console.error("%s padding is %ipx for %ipx corner:",(E?"top":"bottom"),D,B.sizey,C)}catch(A){}D=B.sizey}return D-B.sizey+"px"}function i(A,B){var C=document.createElement(A);C.style.border="none";C.style.borderCollapse="collapse";C.style.borderSpacing=0;C.style.padding=0;C.style.margin=0;if(B){C.style.verticalAlign=B}return C}function y(A){try{var C=jQuery.css(A,"background-color");if(C.match(/^(transparent|rgba\(0,\s*0,\s*0,\s*0\))$/i)&&A.parentNode){return y(A.parentNode)}if(C==null){return"#ffffff"}if(C.indexOf("rgb")>-1){C=ab(C)}if(C.length==4){C=p(C)}return C}catch(B){return"#ffffff"}}function p(A){return"#"+A.substring(1,2)+A.substring(1,2)+A.substring(2,3)+A.substring(2,3)+A.substring(3,4)+A.substring(3,4)}function ab(C){var B=255;var F="";var A;var E=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;var D=E.exec(C);for(A=1;A<4;A++){F+=("0"+parseInt(D[A]).toString(16)).slice(-2)}return"#"+F}function aa(A,D){var A=A||"";var E={sizex:5,sizey:5,tl:false,tr:false,bl:false,br:false,webkit:true,mozilla:true,transparent:false};if(D){E.sizex=D.sizex;E.sizey=D.sizey;E.webkit=D.webkit;E.transparent=D.transparent;E.mozilla=D.mozilla}var B=false;var C=false;jQuery.each(A.split(" "),function(H,F){F=F.toLowerCase();var G=parseInt(F);if(G>0&&F==G+"px"){E.sizey=G;if(!B){E.sizex=G}B=true}else{switch(F){case"no-native":E.webkit=E.mozilla=false;break;case"webkit":E.webkit=true;break;case"no-webkit":E.webkit=false;break;case"mozilla":E.mozilla=true;break;case"no-mozilla":E.mozilla=false;break;case"anti-alias":E.transparent=false;break;case"transparent":E.transparent=true;break;case"top":C=E.tl=E.tr=true;break;case"right":C=E.tr=E.br=true;break;case"bottom":C=E.bl=E.br=true;break;case"left":C=E.tl=E.bl=true;break;case"top-left":C=E.tl=true;break;case"top-right":C=E.tr=true;break;case"bottom-left":C=E.bl=true;break;case"bottom-right":C=E.br=true;break}}});if(!C){if(!D){E.tl=E.tr=E.bl=E.br=true}else{E.tl=D.tl;E.tr=D.tr;E.bl=D.bl;E.br=D.br}}return E}function l(B,D,A){var C=Array(parseInt("0x"+B.substring(1,3)),parseInt("0x"+B.substring(3,5)),parseInt("0x"+B.substring(5,7)));var E=Array(parseInt("0x"+D.substring(1,3)),parseInt("0x"+D.substring(3,5)),parseInt("0x"+D.substring(5,7)));r="0"+Math.round(C[0]+(E[0]-C[0])*A).toString(16);g="0"+Math.round(C[1]+(E[1]-C[1])*A).toString(16);D="0"+Math.round(C[2]+(E[2]-C[2])*A).toString(16);return"#"+r.substring(r.length-2)+g.substring(g.length-2)+D.substring(D.length-2)}function c(C,B,A,D,E){if(B.transparent){v(C,B,A,E)}else{s(C,B,A,D,E)}}function s(G,K,B,M,D){var H,I;var F=document.createElement("div");F.style.fontSize="1px";F.style.backgroundColor=B;var L=0;for(H=1;H<=K.sizey;H++){var P,Q,A;arc=Math.sqrt(1-Math.pow(1-H/K.sizey,2))*K.sizex;var J=K.sizex-Math.ceil(arc);var N=Math.floor(L);var O=K.sizex-J-N;var C=document.createElement("div");var E=F;C.style.margin="0px "+J+"px";C.style.height="1px";C.style.overflow="hidden";for(I=1;I<=O;I++){if(I==1){if(I==O){P=((arc+L)*0.5)-N}else{Q=Math.sqrt(1-Math.pow(1-(J+1)/K.sizex,2))*K.sizey;P=(Q-(K.sizey-H))*(arc-N-O+1)*0.5}}else{if(I==O){Q=Math.sqrt(1-Math.pow((K.sizex-J-I+1)/K.sizex,2))*K.sizey;P=1-(1-(Q-(K.sizey-H)))*(1-(L-N))*0.5}else{A=Math.sqrt(1-Math.pow((K.sizex-J-I)/K.sizex,2))*K.sizey;Q=Math.sqrt(1-Math.pow((K.sizex-J-I+1)/K.sizex,2))*K.sizey;P=((Q+A)*0.5)-(K.sizey-H)}}u(K,C,E,D,l(B,M,P));E=C;var C=E.cloneNode(false);C.style.margin="0px 1px"}u(K,C,E,D,M);L=arc}if(D){G.insertBefore(F,G.firstChild)}else{G.appendChild(F)}}function u(E,B,C,D,A){if(D&&!E.tl){B.style.marginLeft=0}if(D&&!E.tr){B.style.marginRight=0}if(!D&&!E.bl){B.style.marginLeft=0}if(!D&&!E.br){B.style.marginRight=0}B.style.backgroundColor=A;if(D){C.appendChild(B)}else{C.insertBefore(B,C.firstChild)}}function v(I,A,D,G){var H=document.createElement("div");H.style.fontSize="1px";var K=document.createElement("div");K.style.overflow="hidden";K.style.height="1px";K.style.borderColor=D;K.style.borderStyle="none solid";var C=A.sizex-1;var F=A.sizey-1;if(!F){F=1}for(var J=0;J<A.sizey;J++){var B=C-Math.floor(Math.sqrt(1-Math.pow(1-J/F,2))*C);if(J==2&&A.sizex==6&&A.sizey==6){B=2}var E=K.cloneNode(false);E.style.borderWidth="0 "+B+"px";if(G){E.style.borderWidth="0 "+(A.tr?B:0)+"px 0 "+(A.tl?B:0)+"px"}else{E.style.borderWidth="0 "+(A.br?B:0)+"px 0 "+(A.bl?B:0)+"px"}G?H.appendChild(E):H.insertBefore(E,H.firstChild)}if(G){I.insertBefore(H,I.firstChild)}else{I.appendChild(H)}}};
