function OpenCenterWindow(a){var g=OpenCenterWindow.arguments,e=OpenCenterWindow.arguments.length,j=window.screen.width,f=window.screen.height,d=(e>1)?g[1]:600,k=(e>2)?g[2]:f,c=Math.ceil((j-d)/2),b=0;window.open(a,"_blank","top="+b+", left="+c+", width="+d+", height="+k+", scrollbars=1, status=0, menubar=0")}function capitalizeMe(d,b){var f=d.value,a="",e=-1;f=f.split(" ");for(var g=0;g<f.length;g++){a+=f[g].substring(0,1).toUpperCase();switch(b){case"UC":a+=f[g].substring(1,f[g].length).toUpperCase();break;case"LC":e=f[g].search(/\-/);if(e!=-1){a+=f[g].substring(1,e+1).toLowerCase();a+=f[g].substring(e+1,e+2).toUpperCase();a+=f[g].substring(e+2,f[g].length).toLowerCase()}else{a+=f[g].substring(1,f[g].length).toLowerCase()}break;default:a+=f[g].substring(1,f[g].length)}a+=(g==f.length-1?"":" ")}d.value=a}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};function formatPhone(c,b){if(c==8||c==37||c==39||c==46){return}var a=b;a.value=formatPhoneValue(a.value);if(a.value.length>13){a.onkeyup=""}}function formatPhoneValue(c){var b=getDigits(c),a="(";for(i=0;i<b.length;i++){a+=b.charAt(i);if(i==2){a+=") "}else{if(i==5){a+="-"}}}return a}function getDigits(b){var a="";for(i=0;i<b.length;i++){if("0123456789".indexOf(b.charAt(i))!=-1){a+=b.charAt(i)}}return a}function allowedChars(g,c,a,f){var b,d;a=(a?a:"0123456789-");if(window.event){b=window.event.keyCode}else{if(c){b=c.which}else{return true}}d=String.fromCharCode(b);if((b==null)||(b==0)||(b==8)||(b==9)||(b==13)||(b==27)){return true}else{if((a.indexOf(d)>-1)){return true}else{if(f&&(d==".")){g.form.elements[f].focus();return false}else{return false}}}}function Xtend(c,b){var a;c=String(c);if(/e/i.test(c)){return c}while((a=c.indexOf("."))<0){c+="."}while(c.length<=a+b){c+="0"}return c}function toggleBillingAddress(a){var b=document.getElementById("billingDiv");if(a.checked){b.style.display="none";$("#billing_country").val($("#shipping_country").val());$("#billing_company").val($("#shipping_company").val());$("#billing_address").val($("#shipping_address").val());$("#billing_city").val($("#shipping_city").val());$("#billing_state_us").val($("#shipping_state_us").val());$("#billing_state").val($("#shipping_state").val());$("#billing_zip").val($("#shipping_zip").val());$("#billing_country").change()}else{b.style.display="table"}};
