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