function checkFee(){ if(!IsInt(document.frmREG.Fee.value,true)){ alert('The fee must be a number.'); document.frmREG.Fee.value = ''; document.frmREG.VAT.value = ''; document.frmREG.TotalFee.value = ''; } else{ document.frmREG.ServiceCharge.value = 0; document.frmREG.ServiceCharge.value = (Math.round(document.frmREG.Fee.value.replace(',','')*8)); document.frmREG.ServiceCharge.value = document.frmREG.ServiceCharge.value.substring(0,document.frmREG.ServiceCharge.value.length-2) + '.' + document.frmREG.ServiceCharge.value.substring(document.frmREG.ServiceCharge.value.length-2,document.frmREG.ServiceCharge.value.length); document.frmREG.VAT.value = ( (Math.round(document.frmREG.Fee.value.replace(',','')) + Math.round(document.frmREG.ServiceCharge.value.replace(',',''))) * 19 ); document.frmREG.VAT.value = document.frmREG.VAT.value.substring(0,document.frmREG.VAT.value.length-2) + '.' + document.frmREG.VAT.value.substring(document.frmREG.VAT.value.length-2,document.frmREG.VAT.value.length); if(document.frmREG.VAT.value.length>6){ document.frmREG.VAT.value = document.frmREG.VAT.value.substring(0,document.frmREG.VAT.value.length-6) + ',' + document.frmREG.VAT.value.substring(document.frmREG.VAT.value.length-6,document.frmREG.VAT.value.length)}; document.getElementById('id_mytax').value=19; document.frmREG.TotalFee.value = (Math.round((document.frmREG.Fee.value.replace(',','')*100)+(document.frmREG.VAT.value.replace(',','')*100)+(document.frmREG.ServiceCharge.value.replace(',','')*100))); document.frmREG.TotalFee.value = document.frmREG.TotalFee.value.substring(0,document.frmREG.TotalFee.value.length-2) + '.' + document.frmREG.TotalFee.value.substring(document.frmREG.TotalFee.value.length-2,document.frmREG.TotalFee.value.length); if(document.frmREG.TotalFee.value.length>6){ document.frmREG.TotalFee.value = document.frmREG.TotalFee.value.substring(0,document.frmREG.TotalFee.value.length-6) + ',' + document.frmREG.TotalFee.value.substring(document.frmREG.TotalFee.value.length-6,document.frmREG.TotalFee.value.length)}; } } function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function IsInt(checkStr,bReal) { var checkOK = "0123456789,"; var allValid = true; var allNum = ""; if (bReal){ checkOK = checkOK + '.';} for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } if (ch != ",") allNum += ch; } if (!allValid) { return false; } else return true; } function updateFee(){ var theFee; // automatically populate gross fee for // package type switch (document.frmREG.NoM.value) { case "Silver#SILVER": theFee = "15,950.00"; break; case "Gold#GOLD": theFee = "25,950.00"; break; case "Platinum#PLATINUM": theFee = "33,950.00"; break; case "Lead Sponsor#LD SPONSOR": theFee = "0"; break; case "Wireless Lounge Sponsor": theFee = "0"; break; case "Lunch Sponsorship Package": theFee = "0"; break; case "Champagne Reception Sponsor": theFee = "0"; break; case "Exhibitor Package#EXHIBITOR": theFee = "7,950"; break; case "Workshop Package#WORKSHOP": theFee = "0"; break; default: theFee = "0.00"; break; } // update fee box document.frmREG.Fee.value = theFee; // ensure tax and total is calculated checkFee(); } function updateDelFee(){ var theFee; // automatically populate gross fee for delegate // package type var w = document.frmREG.delno.selectedIndex; document.getElementById('DelNum').value = document.frmREG.delno.options[w].text; switch (document.frmREG.delno.value) { case "one": theFee = "150.00"; break; case "two": theFee = "300.00"; break; case "three": theFee = "360.00"; break; case "four": theFee = "480.00"; break; case "five": theFee = "600.00"; break; case "six": theFee = "720.00"; break; case "seven": theFee = "840.00"; break; case "eight": theFee = "960.00"; break; case "nine": theFee = "1080.00"; break; //case "ten": // theFee = "2825.00"; // break; case "ten": theFee = "1995.00"; break; case "eleven": theFee = "1650.00"; break; case "twelve": theFee = "1800.00"; break; case "thirteen": theFee = "1950.00"; break; case "fourteen": theFee = "2100.00"; break; case "fifteen": theFee = "2250.00"; break; default: theFee = "0.00"; break; } // update fee box document.frmREG.Fee.value = (theFee); document.getElementById('id_NrMlPackCost').value=(theFee); // ensure tax and total is calculated checkFee(); }