function showcollapse(what){
a=document.getElementById(what)
if (a.style.display==''){
a.style.display='none';
} else {
a.style.display='';
a.focus();
}
}
function checkrecievedvalue(element)
{
if (document.getElementById(element).value < 5)
{
document.getElementById(element).value = 5;
}
}
function cancelsubmit(msg,element){
alert(msg);
document.getElementById(element).focus();
return false
}
function isNumeric(what){
if (what.search(/^[-+]?\d+(\.\d+)?$/) != -1)
return true;
else
return false;
}
function isInteger(what){
if (what.search(/^[-+]?[1-9]\d*.?[0]*$/) != -1)
return true;
else
return false;
}
function isEmail(what) {
// Works
if (what.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
return false;
}
function isAlphanumeric(what){
// ANY alphanumeric string with spaces, commas, dashes.
if (what.search(/^[a-zA-Z0-9\s.\-]+$/) != -1)
return true;
else
return false;
}
function isAlphabetic(what){
if (what.search(/^[a-zA-Z\s]+$/) != -1)
return true;
else
return false;
}
function noSpaces(what){
if (what.search(/\s/) != -1)
return false;
else
return true;
}
function isCC(what){
if (what.search(/^((4\d{3})|(5[1-5]\d{2})|(6011))-?\d{4}-?\d{4}-?\d{4}|3[4,7]\d{13}$/) != -1)
return true;
else
return false;
}
function _trim(value){
return value.replace(/^\s+|\s+$/g, '');
}
function wwsAFPget(what){
return(document.getElementById(what));
}
function wwsAFPexists(what){
if (document.getElementById(what))
return true;
else
return false;
}//Ajax starting from here
function popUrl(file){
window.showModalDialog(file,window,'dialogWidth:650px;dialogHeight:600px;edge:Raised;center:Yes;help:No;status:No;scroll:1;');
}
function storePage(pgid){
document.getElementById('ajaxBlock').innerHTML = '
Loading... |
';
loadFragmentInToElement('../../client/storepage.php?pgid='+pgid,'ajaxBlock','');
}
function storePackage(pgid,maid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storepackage.php?pgid='+pgid+'&maid='+maid,'ajaxBlock','');
}
function storeGiftCard(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/giftrcard.php','ajaxBlock','');
}
function storeAdvertising(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storeadvt.php','ajaxBlock','');
}
function storeAdvertisingNext(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storeadvtnext.php','ajaxBlock','');
}
function storeAdvertisingOrder(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storeadvtorder.php','ajaxBlock','');
}
function storeLeadType(ltid,maid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storeleadtype.php?ltid='+ltid+'&maid='+maid,'ajaxBlock','');
}
function storeLocalLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storelocalleadtype.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function storeNationwideLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storenationwideleadtype.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function storeNewNationwideLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storenewnationwideleadtype.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function storeChristianLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storechristianleadtype.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function storeNewChristianLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storenewchristianleadtype.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function storeChristianAgedLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storeagedchristian.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function storeDaniAgedLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storeageddani.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function storeDietLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storedietleadtype.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function orderLeadType(ltid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/orderlocalleadtype.php?ltid='+ltid,'ajaxBlock','');
}
function orderNWLeadType(ltid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/ordernationwideleadtype.php?ltid='+ltid,'ajaxBlock','');
}
function orderNewNWLeadType(ltid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/ordernewnationwideleadtype.php?ltid='+ltid,'ajaxBlock','');
}
function orderNewCHLeadType(ltid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/ordernewchristianleadtype.php?ltid='+ltid,'ajaxBlock','');
}
function orderSurveyedLeadType(ltid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/ordersurveyedleadtype.php?ltid='+ltid,'ajaxBlock','');
}
function storeSurveyedLeadType(ltid,from){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storesurveyedleadtype.php?ltid='+ltid+'&from='+from,'ajaxBlock','');
}
function storeLogin(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storelogin.php','ajaxBlock','');
}
function storeForgot(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/storeforgot.php','ajaxBlock','');
}
function sentPassword(){
if (wwsAFPexists('Email ID')){
if (wwsAFPget('Email ID').value==''){return cancelsubmit('Field \'Email ID\' is required','Email ID')}
if (!isEmail(wwsAFPget('Email ID').value)){return cancelsubmit('Field \'Email ID\' does not contain a valid e-mail address.','Email ID')}
}
document.getElementById('Action').value = 'forgotpassword';
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=login';
}
function storeCart(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/cart.php','ajaxBlock','');
}
function editCartLTDS(basketid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/editstoreltds.php?basketid='+basketid,'ajaxBlock','');
}
function checkOut(){
if (wwsAFPexists('XCartCoupon')){
if (parseFloat(wwsAFPget('XCartCoupon').value)>parseFloat(wwsAFPget('EPL Coupon').value)){
alert('DaniJohnson Rewards greater than actual rewards');
wwsAFPget('XCartCoupon').value = wwsAFPget('EPL Coupon').value;
wwsAFPget('XCartCoupon').focus();
return false;
}
if (parseFloat(wwsAFPget('XCartCoupon').value)>parseFloat(wwsAFPget('Grand Total').value)){
alert('DaniJohnson Rewards greater than Grand Total');
wwsAFPget('XCartCoupon').focus();
return false;
}
document.getElementById('Action').value = 'setxcartcoupon';
document.getElementById('formName').submit();
}else{
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/checkout.php','ajaxBlock','');
}
}
function storeThankYou(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/thankyou.php','ajaxBlock','');
}
function signupThankyou(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/signupthankyou.php','ajaxBlock','');
}
function paypalCancel(){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/paypalcancel.php','ajaxBlock','');
}
function saveReferralClient() {
if (document.getElementById('Referral ID').checked==true){
if (wwsAFPexists('Field Referral ID')){
if (wwsAFPget('Field Referral ID').value==''){return cancelsubmit('Field \'Referral ID\' is required','Field Referral ID')}
}
}
if (document.getElementById('Referral Email').checked==true){
if (wwsAFPexists('Field Referral Email')){
if (wwsAFPget('Field Referral Email').value==''){return cancelsubmit('Field \'Referral E-Mail\' is required','Field Referral Email')}
if (!isEmail(wwsAFPget('Field Referral Email').value)){return cancelsubmit('Field \'Referral E-Mail\' does not contain a valid e-mail address.','Field Referral Email')}
}
}
document.getElementById('formName').submit();
//window.document.location.href = 'index.php';
}
function saveClient() {
if (wwsAFPexists('Frist Name')){
if (wwsAFPget('Frist Name').value==''){return cancelsubmit('Field \'Frist Name\' is required','Frist Name')}
}
if (wwsAFPexists('Last Name')){
if (wwsAFPget('Last Name').value==''){return cancelsubmit('Field \'Last Name\' is required','Last Name')}
}
if (wwsAFPexists('Email ID')){
if (wwsAFPget('Email ID').value==''){return cancelsubmit('Field \'Email ID\' is required','Email ID')}
if (!isEmail(wwsAFPget('Email ID').value)){return cancelsubmit('Field \'Email ID\' does not contain a valid e-mail address.','Email ID')}
}
if (wwsAFPexists('Re-type Email ID')){
if (wwsAFPget('Re-type Email ID').value==''){return cancelsubmit('Field \'Re-type E-Mail\' is required','Re-type Email ID')}
if (!isEmail(wwsAFPget('Re-type Email ID').value)){return cancelsubmit('Field \'Re-type E-Mail\' does not contain a valid e-mail address.','Re-type Email ID')}
}
if (wwsAFPget('Email ID').value!=wwsAFPget('Re-type Email ID').value){return cancelsubmit('Mismatch E-Mail','Email ID')}
if (wwsAFPexists('Address')){
if (wwsAFPget('Address').value==''){return cancelsubmit('Field \'Address\' is required','Address')}
}
if (wwsAFPexists('City')){
if (wwsAFPget('City').value==''){return cancelsubmit('Field \'City\' is required','City')}
}
if (wwsAFPexists('Zip/Postal Code')){
if (wwsAFPget('Zip/Postal Code').value==''){return cancelsubmit('Field \'Zip/Postal Code\' is required','Zip/Postal Code')}
}
if (wwsAFPexists('Phone')){
if (wwsAFPget('Phone').value==''){return cancelsubmit('Field \'Phone\' is required','Phone')}
}
if (wwsAFPexists('Username')){
if (wwsAFPget('Username').value==''){return cancelsubmit('Field \'Username\' is required','Username')}
}
if (wwsAFPexists('Password')){
var password = _trim(wwsAFPget('Password').value);
if (password==''){
return cancelsubmit('Field \'Password\' is required','Password')
}
}
if (wwsAFPexists('Re-type Password')){
var rePassword = _trim(wwsAFPget('Re-type Password').value);
if (rePassword==''){
return cancelsubmit('Field \'Re-type Password\' is required','Re-type Password')
}
}
if (wwsAFPexists('Password')){
if (wwsAFPget('Password').value!=wwsAFPget('Re-type Password').value){return cancelsubmit('Mismatch \'Password\'','Password')}
}
document.getElementById('formName').submit();
//window.document.location.href = 'index.php?page=checksignup';
}
function checkUnicode(e){
var unicode=e.keyCode? e.keyCode : e.charCode
if(unicode == 13) loginCheck();
}
function loginCheck(){
if (wwsAFPexists('Username')){
if (wwsAFPget('Username').value==''){return cancelsubmit('Field \'E-Mail\' is required','Username')}
}
if (wwsAFPexists('Password')){
if (wwsAFPget('Password').value==''){return cancelsubmit('Field \'Password\' is required','Password')}
}
document.getElementById('Action').value = 'login';
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=login';
}
function termsCheck(){
if (document.getElementById('Standard Terms').checked == false){
alert('Please read the Standard Terms');
document.getElementById('Standard Terms').focus();
return false;
}
ltid = document.getElementById('ltid').value;
var form = document.frmBlock;
var quantity;
for (i = 0; i < form.length; i++) {
if(form[i].type == 'radio'){
if(form[i].checked == true)
quantity = form[i].value;
}
}
document.getElementById('formName').submit();
postUserTraceUpload('../../client/storeltds.php?ltid='+ltid+'&quantity='+quantity);
}
function dietToCart(){
if (wwsAFPexists('Primary Business Opportunity')){
if (wwsAFPget('Primary Business Opportunity').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
if (wwsAFPget('Primary Business Opportunity').value=='Other'){
if (wwsAFPexists('Other Company')){
if (wwsAFPget('Other Company').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
}
}
}
if (document.getElementById('Standard Terms').checked == false){
alert('Please read the Terms and Conditions');
document.getElementById('Standard Terms').focus();
return false;
}
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=cart';
}
function dsCheck(){
if (wwsAFPexists('cRURL')){
if (wwsAFPget('cRURL').value=='http://www.yourwebsite.com'){
alert('Please Specify Redirect URL');
document.getElementById('cRURL').focus();
return false;
}
if (wwsAFPget('cRURL').value==''){
alert('Please Specify Redirect URL');
document.getElementById('cRURL').focus();
return false;
}
}
if (wwsAFPexists('USERNAME')){
if (wwsAFPget('USERNAME').value==''){
alert('Please Specify Username');
document.getElementById('USERNAME').focus();
return false;
}
}
if (document.getElementById('Standard Terms').checked == false){
alert('Please read the Terms and Conditions');
document.getElementById('Standard Terms').focus();
return false;
}
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=cart';
}
function goUpsellPackage(ltid,upid){
if (wwsAFPexists('cRURL')){
if (wwsAFPget('cRURL').value=='http://www.yourwebsite.com'){
alert('Please Specify Redirect URL');
document.getElementById('cRURL').focus();
return false;
}
if (wwsAFPget('cRURL').value==''){
alert('Please Specify Redirect URL');
document.getElementById('cRURL').focus();
return false;
}
}
if (wwsAFPexists('USERNAME')){
if (wwsAFPget('USERNAME').value==''){
alert('Please Specify Username');
document.getElementById('USERNAME').focus();
return false;
}
}
if (document.getElementById('Standard Terms').checked == false){
alert('Please read the Terms and Conditions');
document.getElementById('Standard Terms').focus();
return false;
}
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=upsellpackage<id='+ltid+'&upid='+upid;
}
function loadUpsellPackage(ltid,maid,upid){
document.getElementById('ajaxBlock').innerHTML = ' Loading... |
';
loadFragmentInToElement('../../client/upsellpackage.php?ltid='+ltid+'&maid='+maid+'&upid='+upid,'ajaxBlock','');
}
function AddtoCart(){
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=cart';
}
function christianAddtoCart(){
if (wwsAFPexists('Primary Business Opportunity')){
if (wwsAFPget('Primary Business Opportunity').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
if (wwsAFPget('Primary Business Opportunity').value=='Other'){
if (wwsAFPexists('Other Company')){
if (wwsAFPget('Other Company').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
}
}
}
if (wwsAFPexists('cRURL')){
if (wwsAFPget('cRURL').value=='http://www.yourwebsite.com'){
document.getElementById('cRURL').value = '';
}
}
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=cart';
}
function christiangoUpsellPackage(ltid,upid){
if (wwsAFPexists('Primary Business Opportunity')){
if (wwsAFPget('Primary Business Opportunity').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
if (wwsAFPget('Primary Business Opportunity').value=='Other'){
if (wwsAFPexists('Other Company')){
if (wwsAFPget('Other Company').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
}
}
}
if (wwsAFPexists('cRURL')){
if (wwsAFPget('cRURL').value=='http://www.yourwebsite.com'){
document.getElementById('cRURL').value = '';
}
}
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=upsellpackage<id='+ltid+'&upid='+upid;
}
function orderSurveyedLeads(){
if (document.getElementById('Standard Terms').checked == false){
alert('Please read the Terms and Conditions');
document.getElementById('Standard Terms').focus();
return false;
}
var allValid = 1;
var a = eval("document['frmBlock']['ltid[]']");
var checked = false;
if(a.length > 0){
for(var i = 0; i < a.length; i++){
var x = eval("document['frmBlock']['cb_fresh" + a[i].value + "[]']");
if(x && parseInt(x.value) > 0){
if(x.checked){
checked = true;
break;
}
}else if(x && x.length > 0){
for(var i2 = 0; i2 < x.length; i2++){
if(x[i2].checked){
checked = true;
break;
}
}
}
}
}
if(!checked){
alert('Please select one or more lead packages by placing a check mark into the box left of the quantity desired.');
allValid = 0;
}
if(allValid == 1){
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=cart';
}
}
function ordergoUpsellPackage(ltid,upid){
if (document.getElementById('Standard Terms').checked == false){
alert('Please read the Terms and Conditions');
document.getElementById('Standard Terms').focus();
return false;
}
var allValid = 1;
var a = eval("document['frmBlock']['ltid[]']");
var checked = false;
if(a.length > 0){
for(var i = 0; i < a.length; i++){
var x = eval("document['frmBlock']['cb_fresh" + a[i].value + "[]']");
if(x && parseInt(x.value) > 0){
if(x.checked){
checked = true;
break;
}
}else if(x && x.length > 0){
for(var i2 = 0; i2 < x.length; i2++){
if(x[i2].checked){
checked = true;
break;
}
}
}
}
}
if(!checked){
alert('Please select one or more lead packages by placing a check mark into the box left of the quantity desired.');
allValid = 0;
}
if(allValid == 1){
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=upsellpackage<id='+ltid+'&upid='+upid;
}
}
function checkAreaCode(){
var flag = 0;
if (wwsAFPexists('AreaCode0')){
if (wwsAFPget('AreaCode0').value!='') flag = 1;
}
if (wwsAFPexists('AreaCode1')){
if (wwsAFPget('AreaCode1').value!='') flag = 1;
}
if (wwsAFPexists('AreaCode2')){
if (wwsAFPget('AreaCode2').value!='') flag = 1;
}
if (wwsAFPexists('AreaCode3')){
if (wwsAFPget('AreaCode3').value!='') flag = 1;
}
if (wwsAFPexists('AreaCode4')){
if (wwsAFPget('AreaCode4').value!='') flag = 1;
}
if(flag==0){
return cancelsubmit('You must enter at least 1 Area Code','AreaCode0');
}
if (wwsAFPexists('Primary Business Opportunity')){
if (wwsAFPget('Primary Business Opportunity').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
if (wwsAFPget('Primary Business Opportunity').value=='Other'){
if (wwsAFPexists('Other Company')){
if (wwsAFPget('Other Company').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
}
}
}
document.getElementById('formName').submit();
}
function checkNationwide(){
var flag = 0;
if (wwsAFPexists('Primary Business Opportunity')){
if (wwsAFPget('Primary Business Opportunity').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
if (wwsAFPget('Primary Business Opportunity').value=='Other'){
if (wwsAFPexists('Other Company')){
if (wwsAFPget('Other Company').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
}
}
}
if (wwsAFPexists('cRURL')){
if (wwsAFPget('cRURL').value=='http://www.yourwebsite.com'){
document.getElementById('cRURL').value = '';
}
}
document.getElementById('formName').submit();
}
function checkSurveyedLeadType(){
var flag = 0;
if (wwsAFPexists('Primary Business Opportunity')){
if (wwsAFPget('Primary Business Opportunity').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
if (wwsAFPget('Primary Business Opportunity').value=='Other'){
if (wwsAFPexists('Other Company')){
if (wwsAFPget('Other Company').value==''){
return cancelsubmit('Please select or enter your Primary Business Opportunity','Primary Business Opportunity');
}
}
}
}
document.getElementById('formName').submit();
}
function editdsCheck(){
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=cart';
}
function popDeleteCoupon(basketid){
var flag = confirm('Do you want to delete this item from cart');
if(flag){
saveData('../../client/deleteitem.php?basketid='+basketid);
window.document.location.href = 'index.php?page=cart';
}
}
function checkCoupon(){
if (wwsAFPexists('Coupon Code')){
if (wwsAFPget('Coupon Code').value==''){return cancelsubmit('Field \'Promotional Code\' is required','Coupon Code')}
}
document.getElementById('Action').value = 'checkcoupon';
document.getElementById('formName').submit();
//window.document.location.href = 'index.php?page=cart';
}
function removeCoupon(){
saveData('../../client/deletecoupon.php');
window.document.location.href = 'index.php?page=cart';
}
function savePaypalOrder(){
if (wwsAFPexists('Auto Ship')){
if (wwsAFPget('Auto Ship').value!='0'){return cancelsubmit('Auto-Ship is not possible when paying by Paypal.','Auto Ship')}
}
document.getElementById('Action').value = 'paypal';
document.getElementById('formName').submit();
document.getElementById('Pay by Credit Card').disabled=true;
document.getElementById('Pay by Paypal').disabled=true;
}
function saveCCOrder(){
if (wwsAFPexists('Frist name')){
if (wwsAFPget('Frist name').value==''){return cancelsubmit('Field \'Frist name\' is required','Frist name')}
}
if (wwsAFPexists('Last name')){
if (wwsAFPget('Last name').value==''){return cancelsubmit('Field \'Last name\' is required','Last name')}
}
if (wwsAFPexists('Address')){
if (wwsAFPget('Address').value==''){return cancelsubmit('Field \'Address\' is required','Address')}
}
if (wwsAFPexists('City')){
if (wwsAFPget('City').value==''){return cancelsubmit('Field \'City\' is required','City')}
}
if (wwsAFPexists('Zip/Postal Code')){
if (wwsAFPget('Zip/Postal Code').value==''){return cancelsubmit('Field \'Zip/Postal Code\' is required','Zip/Postal Code')}
}
if (wwsAFPexists('Email ID')){
if (wwsAFPget('Email ID').value==''){return cancelsubmit('Field \'Email ID\' is required','Email ID')}
if (!isEmail(wwsAFPget('Email ID').value)){return cancelsubmit('Field \'Email ID\' does not contain a valid e-mail address.','Email ID')}
}
if (wwsAFPexists('Phone')){
if (wwsAFPget('Phone').value==''){return cancelsubmit('Field \'Phone\' is required','Phone')}
}
if (wwsAFPexists('Card Number')){
if (wwsAFPget('Card Number').value==''){return cancelsubmit('Field \'Card Number\' is required','Card Number')}
if(!Mod10(wwsAFPget('Card Number').value)){return cancelsubmit('This is NOT a valid Credit Card Number!','Card Number')};
}
if (wwsAFPexists('Card Type')){
if (wwsAFPget('Card Type').value==''){return cancelsubmit('Field \'Card Type\' is required','Card Type')}
}
if (wwsAFPexists('CV Code')){
if (wwsAFPget('CV Code').value==''){return cancelsubmit('Field \'CV Code\' is required','CV Code')}
}
document.getElementById('Action').value = 'cccheckout';
document.getElementById('formName').submit();
document.getElementById('CC Payment').value='Process Beginning...';
document.getElementById('CC Payment').disabled=true;
}
function saveGCOrder(){
if (wwsAFPexists('Frist name')){
if (wwsAFPget('Frist name').value==''){return cancelsubmit('Field \'Frist name\' is required','Frist name')}
}
if (wwsAFPexists('Last name')){
if (wwsAFPget('Last name').value==''){return cancelsubmit('Field \'Last name\' is required','Last name')}
}
if (wwsAFPexists('Address')){
if (wwsAFPget('Address').value==''){return cancelsubmit('Field \'Address\' is required','Address')}
}
if (wwsAFPexists('City')){
if (wwsAFPget('City').value==''){return cancelsubmit('Field \'City\' is required','City')}
}
if (wwsAFPexists('Zip/Postal Code')){
if (wwsAFPget('Zip/Postal Code').value==''){return cancelsubmit('Field \'Zip/Postal Code\' is required','Zip/Postal Code')}
}
if (wwsAFPexists('Email ID')){
if (wwsAFPget('Email ID').value==''){return cancelsubmit('Field \'Email ID\' is required','Email ID')}
if (!isEmail(wwsAFPget('Email ID').value)){return cancelsubmit('Field \'Email ID\' does not contain a valid e-mail address.','Email ID')}
}
if (wwsAFPexists('Phone')){
if (wwsAFPget('Phone').value==''){return cancelsubmit('Field \'Phone\' is required','Phone')}
}
if (wwsAFPexists('Gift Card Number')){
if (wwsAFPget('Gift Card Number').value==''){return cancelsubmit('Field \'Gift Card Number\' is required','Gift Card Number')}
}
document.getElementById('Action').value = 'gccheckout';
document.getElementById('formName').submit();
document.getElementById('CC Payment').value='Process Beginning...';
document.getElementById('CC Payment').disabled=true;
}
function checkOut2(){
if (wwsAFPexists('Auto Ship')){
if (wwsAFPget('Auto Ship').value==''){return cancelsubmit('Field \'Auto Ship\' is required','Auto Ship')}
}
document.getElementById('Action').value = 'creditcard';
document.getElementById('formName').submit();
//document.getElementById('Pay by Paypal').disabled=true;
document.getElementById('Pay by Credit Card').disabled=true;
window.document.location.href = 'index.php?page=checkout2';
}
function checkOut3(){
document.getElementById('formName').submit();
document.getElementById('Pay by Gift Card').disabled=true;
window.document.location.href = 'index.php?page=checkout3';
}
function check(){
var form = document.frmLoginForm;
if (wwsAFPexists('Site Email ID')){
if (wwsAFPget('Site Email ID').value==''){
alert('Field \'Email ID\' is required');
form.email.focus();
return false;
}
if (!isEmail(wwsAFPget('Site Email ID').value)){
alert('Field \'Email ID\' is invalid');
form.email.focus();
return false;
}
}
if (wwsAFPexists('Site Password')){
if (wwsAFPget('Site Password').value==''){
alert('Field \'Password\' is required');
form.lpassword.focus();
return false;
}
}
return true;
}
function autoshipHelp(file){
window.showModalDialog(file,window,'dialogWidth:700px;dialogHeight:550px;edge:Raised;center:Yes;help:No;status:No;scroll:1;');
}
function privacyPolicy(file){
window.showModalDialog(file,window,'dialogWidth:700px;dialogHeight:550px;edge:Raised;center:Yes;help:No;status:No;scroll:1;');
}
function autoshipDiscount(){
document.getElementById('Action').value = 'autoshipdiscount';
document.getElementById('formName').submit();
loadFragmentInToElement('../../client/checkout.php','ajaxBlock','');
}
function sendContactUs(){
if (wwsAFPexists('First Name')){
if (wwsAFPget('First Name').value==''){return cancelsubmit('Field \'First Name\' is required','First Name')}
}
if (wwsAFPexists('Last Name')){
if (wwsAFPget('Last Name').value==''){return cancelsubmit('Field \'Last Name\' is required','Last Name')}
}
if (wwsAFPexists('Email ID')){
if (wwsAFPget('Email ID').value==''){return cancelsubmit('Field \'Email ID\' is required','Email ID')}
if (!isEmail(wwsAFPget('Email ID').value)){return cancelsubmit('Field \'Email ID\' does not contain a valid e-mail address.','Email ID')}
}
if (wwsAFPexists('Company Name')){
if (wwsAFPget('Company Name').value==''){return cancelsubmit('Field \'Company Name\' is required','Company Name')}
}
if (wwsAFPexists('Contact Phone')){
if (wwsAFPget('Contact Phone').value==''){return cancelsubmit('Field \'Contact Phone\' is required','Contact Phone')}
}
if (wwsAFPexists('Questions or Comments')){
if (wwsAFPget('Questions or Comments').value==''){return cancelsubmit('Field \'Questions or Comments\' is required','Questions or Comments')}
}
document.getElementById('formName').submit();
window.document.location.href = 'index.php?page=checksignup';
}
function checkTZ() {
var f = document['frmBlock']['timezone[]'];
var x = 0;
for(var i = 1; i < f.length; i++){
if (f[i].checked) {
x++;
}
if(f[i].checked){
ischecked = true;
}
}
if(x > 0){
f[0].checked = false;
}
if (x >= f.length -1) {
allTZ();
}
}
function allTZ() {
var f = document['frmBlock']['timezone[]'];
for(var i = 1; i < f.length; i++){
f[i].checked = false;
}
f[0].checked = true;
}
function checkRURL(x){
if(x == 'http://www.yourwebsite.com' || x == ''){
document.frmBlock.cRURL.value = '';
} else {
var urlRegxp = /^http[s]{0,1}:\/\/[a-z|A-Z|0-9]*\.(\w)\.*/
return(urlRegxp.test(x))
}
}
function disableRadios(x) {
if (x == 1) {
enableDisable(document.frmBlock.countries, false);
enableDisable(document['frmBlock']['timezone[]'], false);
clearSels(document['frmBlock']['states[]']);
clearSels(document['frmBlock']['areas[]']);
document['frmBlock']['states[]'].disabled = true;
document['frmBlock']['areas[]'].disabled = true;
} else if (x == 2) {
enableDisable(document.frmBlock.countries, true);
enableDisable(document['frmBlock']['timezone[]'], true);
clearSels(document['frmBlock']['areas[]']);
document['frmBlock']['states[]'].disabled = false;
document['frmBlock']['areas[]'].disabled = true;
} else if (x == 3) {
enableDisable(document.frmBlock.countries, true);
enableDisable(document['frmBlock']['timezone[]'], true);
clearSels(document['frmBlock']['states[]']);
document['frmBlock']['states[]'].disabled = true;
document['frmBlock']['areas[]'].disabled = false;
}
}
function clearSels(f){
for(var i = 0; i < f.length; i++){
f[i].selected = false;
}
}
function enableDisable(x, y) {
var f = x;
for(var i = 0; i < f.length; i++){
f[i].disabled = y;
}
if (x = document['frmBlock']['timezone[]'] && y == false) {
checkTZ();
}
}
function checkPkg(group, id, forced){
var x = eval("document['frmBlock']['cb_fresh" + group + "[]']");
if(x.length > 0){
for(var i = 0; i < x.length; i++){
if(x[i].checked && x[i].value != id ){
x[i].checked=false;
}else if(forced && x[i].value == id){
x[i].checked=true;
}
}
} else {
if (x.checked && x.value != id) {
x.checked=false
} else if (forced && x.value == id) {
x.checked=true;
}
}
}
function Mod10(ccNumb) {
var valid = '0123456789'
var len = ccNumb.length;
var iCCN = parseInt(ccNumb);
var sCCN = ccNumb.toString();
sCCN = sCCN.replace (/^\s+|\s+$/g,'');
var iTotal = 0;
var bNum = true;
var bResult = false;
var temp;
var calc;
for (var j=0; j= 15){
for(var i=len;i>0;i--){
calc = parseInt(iCCN) % 10;
calc = parseInt(calc);
iTotal += calc;
i--;
iCCN = iCCN / 10;
calc = parseInt(iCCN) % 10 ;
calc = calc *2;
switch(calc){
case 10: calc = 1; break;
case 12: calc = 3; break;
case 14: calc = 5; break;
case 16: calc = 7; break;
case 18: calc = 9; break;
default: calc = calc;
}
iCCN = iCCN / 10;
iTotal += calc;
} // END OF LOOP
if ((iTotal%10)==0){
bResult = true;
} else {
bResult = false;
}
}
}
return bResult;
}