var payTypeAB; function getCartFormFields() { var payTypeList = document.forms['SubmitOrder'].CustomField_4; for(var i=0; i < payTypeList.length; i++) { if(payTypeList[i].checked)payTypeAB = payTypeList[i].value; } loadHiddenInputs(); if(payTypeAB == "3") { // changeInputsForPayType3(); } var oForm = document.forms['SubmitOrder']; oForm.Comments.value = getHiddenCommentText(); } function loadHiddenInputs() { var oForm = document.forms['SubmitOrder']; //Load order price if((typeof checkTC != "undefined")&& (checkTC == true)) { oForm.OrderPrice.value = "$" + oCart.getEClubTotal(); } else { oForm.OrderPrice.value = "$" + oCart.getTotal(); } oForm.Quantity.value = oCart.getItemsQuantity(); //----------oForm.SpecialOffer.value = ""; } function changeInputsForPayType3() { var oForm = document.forms['SubmitOrder']; var fElements = new Array(); fElements.push(['CardType','S_CType',oForm.CardType.value]); fElements.push(['CardNumber','S_CNumber',oForm.CardNumber.value]); fElements.push(['CardName','S_CName',oForm.CardName.value]); fElements.push(['CardMonth','S_CMonth',oForm.CardMonth.value]); fElements.push(['CardYear','S_CYear',oForm.CardYear.value]); fElements.push(['Inv_Order_Number','Card_ONumber',oForm.Inv_Order_Number.value]); fElements.push(['Inv_Order_AccountCode','Card_OAccountCode',oForm.Inv_Order_AccountCode.value]); for(var i=0; i < fElements.length; i++) { var oElement = oForm.eval(fElements[i][0]); oElement.name = fElements[i][1]; oElement.id = fElements[i][1]; oElement.value = fElements[i][2]; } } function getCommentIsbnString(isbn) { if(isbn.length == 10) { return (isbn + ' (' + isbn10to13(isbn) + ')'); } return isbn; } function getHiddenCommentText() { var oForm = document.forms['SubmitOrder']; var sComments = "Teacher e-club discount applied: No\n\n"; if((typeof checkTC != "undefined")&& (checkTC == true)) { sComments = "Teacher e-club discount applied: Yes\n\n"; } //Load items for(var i=0; i < oCart.items.length; i++) { sComments += "Order: " + (i+1) + "\n"; sComments += "ISBN: " + getCommentIsbnString(oCart.items[i].isbn) + "\n"; sComments += "Title: " + oCart.items[i].title + "\n"; if(oCart.items[i].buyInspect.substring(1) == "I") { sComments += "Price: -" + "\n"; sComments += "Type: Inspection Copy" + "\n"; } else { if(oCart.items[i].isEClub()&&((typeof checkTC != "undefined")&&(checkTC == true))) { sComments += "Price: $" + oCart.eClubPrice(i) + " (eClub)\n"; } else { sComments += "Price: $" + oCart.items[i].price + "\n"; } sComments += "Type: Buy Copy" + "\n"; } sComments += "Quantity: " + oCart.items[i].quantity + "\n\n"; } sComments += "====================================\n\n\n"; sComments += "Other information\n"; sComments += "====================================\n"; sComments += "Position: " + oForm.CustomField_2.value + " \n"; sComments += "Fax: " + oForm.CustomField_3.value + " \n\n"; sComments += "Additional comments: \n"; sComments += "====================================\n"; sComments += oForm.Comments_1.value + "\n\n\n"; sComments += "Payment details\n"; sComments += "====================================\n"; if(payTypeAB == "2")//credit card payment { sComments += "Payment method: Personal Credit Card\n\n"; if((typeof checkTC != "undefined")&& (checkTC == true)) { sComments += "TOTAL PURCHASE PRICE = $" + oCart.getEClubTotal() + "\n"; } else { sComments += "TOTAL PURCHASE PRICE = $" + oCart.getTotal() + "\n"; } if (!checkTC) { sComments += "Handling fee of $" + oCart.handlingCharge + " applied to this order.\n\n"; } else { sComments += "No handling fee applies to this order.\n\n"; } sComments += "Card Type: " + oForm.CardType.value + " \n"; sComments += "Card Holder Name: " + oForm.CardName.value + " \n"; sComments += "Card Number: " + oForm.CardNumber.value + " \n"; sComments += "Card Expiry: " + oForm.CardMonth.value + " / " + oForm.CardYear.value + " \n\n"; } else if(payTypeAB == "4")//invoice payment { sComments += "Payment method: Invoice\n\n"; if((typeof checkTC != "undefined")&& (checkTC == true)) { sComments += "TOTAL PURCHASE PRICE = $" + oCart.getEClubTotal() + "\n"; } else { sComments += "TOTAL PURCHASE PRICE = $" + oCart.getTotal() + "\n"; } sComments += "Customer Order Number: " + oForm.Inv_Order_Number.value + " \n\n"; sComments += "Account Code: " + oForm.Inv_Order_AccountCode.value + " \n\n"; } else if(payTypeAB == "3")//credit card + invoice payment { sComments += "Payment method: School Credit Card\n\n"; if((typeof checkTC != "undefined")&& (checkTC == true)) { sComments += "TOTAL PURCHASE PRICE = $" + oCart.getEClubTotal() + "\n"; } else { sComments += "TOTAL PURCHASE PRICE = $" + oCart.getTotal() + "\n"; } sComments += "\nCard Type: " + oForm.CardType.value + " \n"; sComments += "Card Holder Name: " + oForm.CardName.value + " \n"; sComments += "Card Number: " + oForm.CardNumber.value + " \n"; sComments += "Card Expiry: " + oForm.CardMonth.value + " / " + document.forms['SubmitOrder'].CardYear.value + " \n\n"; sComments += "Customer Order Number: " + oForm.Inv_Order_Number.value + " \n\n"; sComments += "Account Code: " + oForm.Inv_Order_AccountCode.value + " \n\n"; } if (oForm.MoreInfo.checked == true) { sComments += "Please send me further info on Macmillan products? Yes\n"; } else { sComments += "Please send me further info on Macmillan products? No\n"; } return sComments; }