function processcommcardcalc() { var my_po = document.mytool.num_po.value; if (my_po == '') {alert('Number of P.O.s placed monthly must be specified.'); document.mytool.num_po.focus();return false;} if (my_po != parseInt(my_po)) {alert('Please enter integers to specify the number of P.O.s'); document.mytool.num_po.value=""; document.mytool.num_po.focus();return false;} var my_pc = document.mytool.cost_po.value; if (my_pc == '') {alert('Processing cost per. P.O. must be specified.'); document.mytool.cost_po.focus();return false;} if (my_pc != parseInt(my_pc)) {alert('Please enter integers to specify the processing cost per P.O.'); document.mytool.cost_po.value=""; document.mytool.cost_po.focus();return false;} var my_current_cost= my_po * my_pc; var my_comm = my_po * 30; var my_savingsm = my_current_cost - my_comm; var my_annual = my_savingsm * 12; document.mytool.manual_po.value = my_current_cost; document.mytool.comm.value = my_comm; document.mytool.monthly.value = my_savingsm; document.mytool.savings.value = my_annual; } if (document.images) { //Preload house image var houseoff = new Image(); houseoff.src = "images/footer_house.gif"; var houseon = new Image(); houseon.src = "images/footer_house_ro.gif"; } function swapImg(img,dir){ if (document.images){ if(dir=="off"){document[img].src=eval(img+"off.src");} else if(dir=="on"){document[img].src=eval(img+"on.src");} } } function open_window(url) { var win = window.open(url,'preWin','width=625,height=345,scrollbars=yes,resizable=1') } // --> function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i'); window.location.href('https://prepaid.bankofamerica.com/bulkgiftcard/Pages/Home.aspx'); } function initialValue() { document.all["float"].innerHTML = 35; document.epayform.dummy.value = 35; } function termsValues() { var billtype = document.epayform.elements["select_billcycle"].value; if(billtype=="monthly") { document.epayform.dummy.value = 35; document.all["float"].innerHTML = 35; } if(billtype=="bi-weekly") { document.epayform.dummy.value = 12; document.all["float"].innerHTML = 12; } if(billtype=="weekly") { document.epayform.dummy.value = 1.5; document.all["float"].innerHTML = 1.5; } } function process() { alert("inside process"); var avg_checks; var checksavings; var annual_float; var savings_value; var days; var disp_annual_float; var disp_savings_value; if(document.epayform.non_paychecks.value=="") { alert("Please enter number of non payroll checks your company issues annually "); document.epayform.non_paychecks.focus(); return false; } else if(document.epayform.nonpayroll_AP.value=="") { alert("Please enter your company's annual non-payroll AP spend "); document.epayform.nonpayroll_AP.focus(); return false; } else if(document.epayform.select_billcycle.value=="") { alert("Please enter number of non payroll checks your company issues annually "); document.epayform.select_billcycle.focus(); return false; } else { var my_payroll = document.epayform.nonpayroll_AP.value; if(my_payroll>69999999) { toggleOn("exceedpay"); } else { toggleOff("exceedpay"); } var my_non_paychecks = document.epayform.non_paychecks.value; if (my_non_paychecks == '') { alert('Number of non-payroll checks issued per year.'); document.epayform.non_paychecks.focus();return false; } if (my_non_paychecks != parseInt(my_non_paychecks)) { alert('Please enter integers to specify the number of non-payroll checks.'); document.epayform.non_paychecks.value=""; document.epayform.non_paychecks.focus();return false; } var my_payroll = document.epayform.nonpayroll_AP.value; if (my_payroll == '') { alert('Annual non-payroll must be specified.'); document.epayform.nonpayroll_AP.focus();return false; } if (my_payroll != parseInt(my_payroll)) { alert('Please enter the annual non-payroll AP amount as an integer value (without commas).'); document.epayform.nonpayroll_AP.value=""; document.epayform.nonpayroll_AP.focus();return false; } var percheck = document.epayform.checks.value; var len = percheck.length; var my_percheck; if(percheck.indexOf('%')>0) { my_percheck = percheck.substr(0,[len-1]); } else { my_percheck= percheck; } if (my_percheck == '') { alert('Average % of checks must be specified.'); document.epayform.checks.focus();return false; } var checkcost = document.epayform.check_cost.value; if (checkcost == '') { alert('Average cost per check must be specified.'); document.epayform.check_cost.focus();return false; } var costfund = document.epayform.cost_funds.value; var len = costfund.length; if(costfund.indexOf('%')>0) { var my_costfunds = costfund.substr(0,[len-1]);} else { my_costfunds = costfund; } if (my_costfunds == '') { alert('Daily cost of funds must be specified.'); document.epayform.cost_funds.focus();return false; } days=document.epayform.dummy.value; avg_checks = (my_non_paychecks*my_percheck)/100; checksavings = checkcost*avg_checks; annual_float = (((my_payroll*days) * (my_percheck/100)) * ((my_costfunds) / (365*100))); annual_float = parseFloat(roundOff(annual_float,0)); savings_value = annual_float + checksavings; savings_value = parseFloat(roundOff(savings_value,0)); savings_value = savings_value+'.'; annual_float = annual_float+'.'; disp_annual_float=CommaFormatted(annual_float); disp_savings_value=CommaFormatted(savings_value); document.all["avgchecks"].innerHTML = avg_checks; document.all["float"].innerHTML = days; document.all["savings"].innerHTML = '$'+checksavings; document.all["annual"].innerHTML = '$'+disp_annual_float; document.all["totalsavings"].innerHTML = '$'+disp_savings_value; } } function CommaFormatted(amount) { var delimiter = ","; // replace comma if desired var a = amount.split('.') var d = a[1]; var i = parseInt(a[0]); if(isNaN(i)) { return ''; } var minus = ''; if(i < 0) { minus = '-'; } i = Math.abs(i); var n = new String(i); var a = []; while(n.length > 3) { var nn = n.substr(n.length-3); a.unshift(nn); n = n.substr(0,n.length-3); } if(n.length > 0) { a.unshift(n); } n = a.join(delimiter); if(d.length < 1) { amount = n; } else { amount = n + '.' + d; } amount = minus + amount; return amount; } function roundOff(value, precision) { value = "" + value; precision = parseInt(precision); var whole = "" + Math.round(value * Math.pow(10, precision)); var decPoint = whole.length - precision; if(decPoint != 0) { result = whole.substring(0, decPoint); result += "."; result += whole.substring(decPoint, whole.length); } else { result = whole; } return result; } function toggleOn(divname) { thediv = document.getElementById(divname); if (thediv != null) { thediv.style.visibility='visible'; thediv.style.display='block'; } } function toggleOff(divname) { thediv = document.getElementById(divname); if (thediv != null) { thediv.style.visibility == 'hidden'; thediv.style.display='none'; } }