function validateCoupon(value){if(value.length==0)return true;if(value.length<4){alert("You have entered an invalid referral code.\\n"+"Please revise the code or leave the field blank.");return false;}return true;}function CheckOut(){var f=document.order;if(!validateCoupon(f.coupon))return;f.submit();}function getInt(v){var p=parseInt(v);if(isNaN(p))return 0;return p;}function BuyDNS(){var f=document.calc;if(f.register.checked)f.buy_dns.checked=true;}var bundle_alert=0;function validate(){var notices="";var f=document.calc;var t="email";var i;for(i=0;i<f.buy.length;i++)if(f.buy[i].checked)t=f.buy[i].value;sEC("show_services",t);sEC("show_services2",t);tabbar.adjustSize();if(f.register.checked){f.buy_dns.checked=true;f.subdom.checked=false;}var hipaa=f.hipaa.checked?1:0;f.host_own_dns.value=(f.buy_dns.checked)?0:1;var d=f.domains.options[f.domains.selectedIndex].value;if(t=="hosting"&&d==0){notices+="You must have your own domain name in order to use web hosting services.\n";}if(t=="premiumhv"&&d==0){notices+="You must have your own domain name in order to use Premium High Volume services.\n";}if(t=="hosting"&&f.host_own_dns.value=="1"&&!f.subdom.checked){f.host_own_dns.value=0;f.buy_dns.checked=true;notices+="LuxSci must manage the DNS services for web hosting accounts that are not using subdomains.\n";}if(t=='email'||t=='hosting'){var gb=parseFloat(f.disk_quota_gb.value);var disk=getInt(gb*1000);if(disk<2000){notices+="2 GB is the minimum amount of space you can order.\n";disk=2000;f.disk_quota_gb.value="2.00";}if(disk>150000){disk=150000;notices+="For accounts with more than 150GB of disk space, you must contact sales.\n";}f.disk_quota.value=disk;}if(t=='premiumhv'){var gb=parseFloat(f.disk_quota_gb.value);var disk=getInt(gb*1000);if(disk<5000){notices+="5 GB is the minimum amount of space you can order with a Premium High Volume account.\n";disk=5000;f.disk_quota_gb.value="5.00";}if(disk>150000){disk=150000;notices+="For accounts with more than 150GB of disk space, you must contact sales.\n";}f.disk_quota.value=disk;}if(t=='luxhv'&&hipaa){notices+="Regular High Volume accounts are not eligible for HIPAA Compliance.\n";}var is_arch=(f.archive.checked)?1:0;if(f.antispam[1].checked&&t=="defense"){notices+="Basic spam &amp; Virus Filtering is only avaialable to customers hosting their email with LuxSci.\n";f.antispam[0].checked=true;}if(t=="defense"&&f.antispam[0].checked&&!is_arch){notices+="You must select Email Filtering and/or Email Archival services for this package.\n";}var is_pf=(f.antispam[2].checked||f.antispam[3].checked||f.antispam[4].checked||f.antispam[5].checked||f.antispam[6].checked)?1:0;if((is_pf||is_arch)&&d==0){notices+="You must have your own domain name in order to use premium email filtering or archival services.\n\n";}if(is_arch&&is_pf&&f.archive_pkg.selectedIndex>=0){f.antispam[6].checked=true;}if(f.hipaa.checked){if(t=='luxhv'){notices+="Non-Premium High Volume accounts can not be HIPAA Compliant.\n";}if(t=='email'||t=='hosting'){if(!f.secline_type[0].checked){notices+="HIPAA Compliant accounts with email hosting must have SecureLine for all users.\nWe have updated your order accordingly.";f.secline_type[0].checked=1;}}}var users=getInt(f.user_quota.value);if(users<1){users=1;notices+="Your account must contain at least 1 user.\n";}if(users>2000){users=2000;notices+="For accounts with more than 2,000 users, you must contact sales for dedicated server pricing.\n";}if(users<5&&t=="defense"){users=5;notices+="There is a 5 user minimum when ordering Email Defense or Archival Only services.\n";}f.user_quota.value=users;if(t=='premiumhv'){f.smtp.checked=1;f.pop.checked=1;f.imap.checked=1;f.secline_type[0].checked=1;}if(t=='email'||t=='hosting'){if(!f.smtp.checked&&(f.pop.checked||f.imap.checked)){alert("You have selected POP and/or IMAP services without SMTP services. "+"Without SMTP, users will not be able to send outgoing email through our "+"servers from their POP or IMAP email programs.  This may be OK if they "+"have other outbound email (SMTP) services, for example through their ISP, and do not need ours. "+"Otherwise, you should check the SMTP checkbox on this 'Revise Order' page.");}}if(t=='email'||t=='hosting'){f.secline.value=(f.secline_type[0].checked)?-1:getInt(f.secline_n.value);var sl=f.secline.value;if(sl!=-1&&sl<0){sl=0;f.secline.value=0;f.secline_type[1].checked=true;f.secline_n.value=0;notices+="Your selected SecureLine license count has been corrected to 0 licenses.\n";}if(sl>2000){sl=-1;f.secline.value=-1;f.secline_type[0].checked=true;notices+="Your selected SecureLine license count has been corrected to 'for all users'.\n";}}var pms=0;if(t=='email'||t=='hosting'||t=='premiumhv'){f.ejournals.value=(f.webaide_type[0].checked)?-1:getInt(f.webaide_n.value);var wa=f.ejournals.value;if(wa!=-1&&wa<0){wa=0;f.ejournals.value=0;f.webaide_type[1].checked=true;f.webaide_n.value=0;notices+="Your selected WebAide license count has been corrected to 0 licenses.\n";}if(wa>2000){wa=-1;f.ejournals.value=-1;f.webaide_type[0].checked=true;notices+="Your selected WebAide license count has been corrected to 'for all users'.\n";}f.bms.value=(f.bms_type[0].checked)?-1:getInt(f.bms_n.value);var ms=f.bms.value;if(ms!=-1&&ms<0){ms=0;f.bms.value=0;f.bms_type[1].checked=true;f.bmse_n.value=0;notices+="Your selected Basic Mobile Sync license count has been corrected to 0 licenses.\n";}if(ms>2000){ms=-1;f.bms.value=-1;f.bms_type[0].checked=true;notices+="Your selected Basic Mobile Sync license count has been corrected to 'for all users'.\n";}f.pms.value=(f.pms_type[0].checked)?-1:getInt(f.pms_n.value);var ms=f.pms.value;pms=ms;if(ms!=-1&&ms<0){ms=0;f.pms.value=0;f.pms_type[1].checked=true;f.pmse_n.value=0;notices+="Your selected Basic Mobile Sync license count has been corrected to 0 licenses.\n";}if(ms>2000){ms=-1;f.pms.value=-1;f.pms_type[0].checked=true;notices+="Your selected Basic Mobile Sync license count has been corrected to 'for all users'.\n";}}if(parseInt(f.pms.value)!=0&&!f.smtp.checked){notices+="SMTP is required if you are purchasing Premium Mobile Sync.\n";}var luxhv_tier=selectedListValue(f.luxhv_tier);var luxhv_days=selectedListValue(f.luxhv_days);if(t=='luxhv'){if(luxhv_tier==1000&&luxhv_days*users<5||luxhv_tier==2500&&luxhv_days*users<3){notices+="High Volume email has a minimum of $5.00/month; the service level you have chosen would place you below this minimum level.  Please revise your selected limits so that the total price is at least \$5.00/month.  The 7,500 recipients/day limit is $5.00/user/day, for example.";}}if(notices.length){alert(notices);return false;}return true;}function changeOrder(){var f=document.calc;if(!validate())return;f.submit();}function xGetElementById(e){if(typeof(e)=='string'){if(document.getElementById)e=document.getElementById(e);else if(document.all)e=document.all[e];else e=null;}return e;}function sEC(id,cl){var c=xGetElementById(id);if(c)c.className=cl;return false;}function Details(x){sEC("container",x);tabbar.adjustSize();}function Save(){var f=document.save;if(!f.title.value.length){alert("Please enter a title for your saved order.");return;}if(!validateCoupon(f.coupon.value))return;f.submit();}function Show(id){var e=xGetElementById(id);if(e)e.style.display="block";}function Hide(id){var e=xGetElementById(id);if(e)e.style.display="none";}function ShowSave(){document.save.coupon.value=document.order.coupon.value;Hide("save_hidden");Show("save_shown");tabbar.adjustSize();}function updateOrder(){var f=document.revise2;var g=document.revise;var t=g.buy.value;if(g.hipaa.checked){if(t=='luxhv'){alert("Non-Premium High Volume accounts can not be HIPAA Compliant.  Please select a different kind of account in the Revise Order Tab.");return;}if(t=='email'||t=='hosting'){if(g.secline.value!="-1"){alert("HIPAA Compliant accounts with email hosting must have SecureLine for all users. Please use the Revise Order tab to add this service.\n");return;}}}g.pay_period.value=f.pay_period[0].checked?"monthly":"yearly";g.hipaa.value=f.hipaa.checked?1:0;if(f.private_reg)g.private_reg.value=f.private_reg.checked?1:0;g.submit();}


