function SwapImage(imgObj,imgSrc) { imgObj.src = "images/" + imgSrc; } function ValidateTerms() { var x; var alertmsg; x=0; alertmsg = "You must agree to the Terms and Conditions before checking out."; if (document.checkout.agree.checked != true) { x = x + 1; } if (x == 0) { document.checkout.submit(); } else { alert(alertmsg); return false; } } function ValidateContact() { var x; var alertmsg; x=0; alertmsg = "The following fields are required: "; if (document.contact.name.value == "") { if (x > 0) { alertmsg = alertmsg + ", "; } alertmsg = alertmsg + "Name"; x = x + 1; } if (document.contact.email.value == "") { if (x > 0) { alertmsg = alertmsg + ", "; } alertmsg = alertmsg + "Email"; x = x + 1; } if (document.contact.subject.value == "") { if (x > 0) { alertmsg = alertmsg + ", "; } alertmsg = alertmsg + "Subject"; x = x + 1; } if (document.contact.body.value == "") { if (x > 0) { alertmsg = alertmsg + ", "; } alertmsg = alertmsg + "Body"; x = x + 1; } if (x == 0) { document.contact.submit(); } else { alert(alertmsg); return false; } } function ValidateCheckout() { var x; var alertmsg; x=0; alertmsg = "The following fields are required: "; if (document.register.first.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "First Name"; x = x + 1; } if (document.register.last.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Last Name"; x = x + 1; } if (document.register.phone1.value == "" || document.register.phone2.value == "" || document.register.phone3.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Phone"; x = x + 1; } if (document.register.email.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Email"; x = x + 1; } if (document.register.cctype.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Credit Card"; x = x + 1; } if (document.register.ccnumber.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Credit Card Number"; x = x + 1; } if (document.register.cccsc.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "CSC (3 Digit Code)"; x = x + 1; } if (document.register.ccmonth.value == "" || document.register.ccyear.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Expires"; x = x + 1; } if (document.register.address1.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Address1"; x = x + 1; } if (document.register.city.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "City"; x = x + 1; } if (document.register.state.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "State"; x = x + 1; } if (document.register.zip.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Zip"; x = x + 1; } if (x == 0) { document.register.submit(); } else { alert(alertmsg); return false; } } function ValidateAddress() { var x; var alertmsg; x=0; alertmsg = "The following fields are required: "; if (document.address.address1.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Address1"; x = x + 1; } if (document.address.city.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "City"; x = x + 1; } if (document.address.state.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "State"; x = x + 1; } if (document.address.zip.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Zip"; x = x + 1; } if (x == 0) { document.address.submit(); } else { alert(alertmsg); return false; } } function ShowMsg(msg) { alert(msg); return false; } function borderit(which,color){ if (document.all||document.getElementById) { which.style.borderColor=color } } function Redirect(url) { document.location.href = url; }