function CartForm() { this.step = 1; this.payType = "2"; this.overview = document.getElementById('overview'); //this.cardOverview = document.getElementById('cardOverview'); this.checkoutCart = document.getElementById('checkoutCart'); this.SubmitOrder = document.getElementById('SubmitOrder'); this.errorMessage = document.getElementByClassName('p','errormessage'); this.personalDetails = document.getElementById('personalDetails'); this.information = document.getElementById('information'); this.formCreditCard = document.getElementById('formCreditCard'); this.formSchoolInvoice = document.getElementById('formSchoolInvoice'); this.checkoutConfirmation = document.getElementById('checkoutConfirmation'); if(typeof CartForm._initialized == "undefined") { CartForm.prototype.hideAll = function() { this.overview.style.display = "none"; //this.cardOverview.style.display = "none"; this.checkoutCart.style.display = "none"; //this.buyersInfo.style.display = "none"; this.errorMessage.style.display = "none"; this.personalDetails.style.display = "none"; this.information.style.display = "none"; this.formCreditCard.style.display = "none"; this.formSchoolInvoice.style.display = "none"; this.checkoutConfirmation.style.display = "none"; if((this.step == 2)&&(this.payType == "3")) { var oExtras = document.getInnerElementByClassName(this.formSchoolInvoice,'div','formExtras'); oExtras.style.display = "block"; oExtras = document.getInnerElementByClassName(this.formCreditCard, 'div','formExtras'); oExtras.style.display = "none"; } }; CartForm.prototype.goTo2 = function() { if(!oCart.loaded)return false; if(this.payType == "2" && oCart.hasInspectedItem()) { alert("Inspection copies may only be requested by schools."); return false; } var validate = this.validateStep1(); if(!validate) return false; this.hideAll(); this.step++; this.overview.innerHTML = ""; if(this.payType == "2") { var oText = '
';
oText += 'Please enter your payment details.
';
if((typeof checkTC != "undefined")&&(checkTC == true))
{
//oText += 'Your total purchase is $' + (Number(oCart.getEClubTotal())- oCart.handlingCharge).toFixed(2) + '
';
//oText += 'A handling charge of $' + oCart.handlingCharge + ' applies to personal orders.
';
oText += 'Your total charge will be $' + oCart.getEClubTotal() + '';
} else {
oText += 'Your total purchase is $' + (Number(oCart.getTotal())- oCart.handlingCharge).toFixed(2) + '
';
oText += 'A handling charge of $' + oCart.handlingCharge + ' applies to personal orders.
';
oText += 'Your total charge will be $' + (Number(oCart.getTotal())).toFixed(2) + '';
}
oText += '
'; } else { var oText = '
';
}
oText += 'Please enter your payment details.
';
if((typeof checkTC != "undefined")&&(checkTC == true))
{
oText += 'Your total purchase is $' + oCart.getEClubTotal() + '
';
} else {
oText += 'Your total purchase is $' + oCart.getTotal() + '
';
}
oText += '
';
oText += 'If you are a Teacher e-Club member and not logged in, login now to receive your discount.
';
oText += 'Non members, register now.
';
oText += 'Inspection copies can be made by schools only.';
oText += '
';
oText += 'Please enter your payment details.
';
if((typeof checkTC != "undefined")&&(checkTC == true))
{
oText += 'Your total purchase is $' + (Number(oCart.getEClubTotal())- oCart.handlingCharge).toFixed(2) + '
';
oText += 'A handling charge of $' + oCart.handlingCharge + ' applies to personal orders.
';
oText += 'Your total charge will be $' + (Number(oCart.getEClubTotal())).toFixed(2) + '';
} else {
oText += 'Your total purchase is $' + (Number(oCart.getTotal())- oCart.handlingCharge).toFixed(2) + '
';
oText += 'A handling charge of $' + oCart.handlingCharge + ' applies to personal orders.
';
oText += 'Your total charge will be $' + (Number(oCart.getTotal())).toFixed(2) + '';
}
oText += '
'; } else { var oText = '
';
}
oText += 'Please enter your payment details.
';
if((typeof checkTC != "undefined")&&(checkTC == true))
{
oText += 'Your total purchase is $' + oCart.getEClubTotal() + '
';
} else {
oText += 'Your total purchase is $' + oCart.getTotal() + '
';
}
oText += '
Your delivery details:
';
oText += document.forms['SubmitOrder'].Firstname.value + " " + document.forms['SubmitOrder'].Lastname.value + "
";
if(document.forms['SubmitOrder'].Organisation.value != "")
{
oText += document.forms['SubmitOrder'].Organisation.value + "
";
}
oText += document.forms['SubmitOrder'].PostalCity.value + " " + document.forms['SubmitOrder'].PostalState.value + " " + document.forms['SubmitOrder'].PostalCode.value;
oText += "
Your payment information:
';
if(this.payType == "2" || this.payType =="3")
{
var nCard = "xxxx xxxx xxxx " + document.forms['SubmitOrder'].CardNumber.value.substring(12);
oText += "Your ";
if(this.payType == "3")oText += " school ";
oText += document.forms['SubmitOrder'].CardType.value + " credit card ending in ";
oText += nCard + " will be charged.
";
}
if(this.payType == "3" || this.payType =="4")
{
oText += "Customer Order Number: " + document.forms['SubmitOrder'].Inv_Order_Number.value + ".
";
oText += "Account Code: " + document.forms['SubmitOrder'].Inv_Order_AccountCode.value + ".
";
oText += "On verification by our Customer Service department the transaction will be processed.
";
}
return oText;
};
}
CartForm._initialized = true;
}