/**
* Form error strings
* Multi-dimentional array, in the format:
*
* element_name : this is the name of the SPAN element where the error message appears
* |_ error_type
* |_ short_message
* |_ long_message
*/
var form_error_strings =
{
'email': {
'empty': {
'short': 'Required field',
'long': 'Email field in the "Account Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Email field in the "Account Details" part contain illegal email address.'
}
},
'password': {
'empty': {
'short': 'Required field',
'long': 'Password field in the "Account Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Password field in the "Account Details" part, should be 6-10 digits and/or characters.'
}
},
'password_confirm': {
'invalid': {
'short': 'Passwords do not match',
'long': 'Password confirm field in the "Account Details" part do not match the password field.'
}
},
'bill_first_name': {
'empty': {
'short': 'Required field',
'long': 'First name field in the "Billing Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'First name field in the "Billing Details" part contain illegal character/s.'
}
},
'bill_last_name': {
'empty': {
'short': 'Required field',
'long': 'Last name field in the "Billing Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Last name field in the "Billing Details" part contain illegal character/s.'
}
},
'bill_address': {
'empty': {
'short': 'Required field',
'long': 'Street address field in the "Billing Details" part is required.'
},
'invalid1': {
'short': 'Invalid input',
'long': 'Street address field in the "Billing Details" part contain illegal character/s.'
},
'invalid2': {
'short': 'Invalid input',
'long': 'Street name in "Billing Details" is required'
}
},
'bill_city': {
'empty': {
'short': 'Required field',
'long': 'City field in the "Billing Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'City field in the "Billing Details" part contain illegal character/s.'
}
},
'bill_zip_code': {
'empty': {
'short': 'Required field',
'long': 'Zip code field in the "Billing Details" part is required.'
},
'invalid1': {
'short': 'Invalid input',
'long': 'Zip code field in the "Billing Details" part should contain your 5-digit zip code and not your state abbreviation.'
},
'invalid2': {
'short': 'Invalid input',
'long': 'Zip code field in the "Billing Details" part contain illegal character/s.'
}
},
'bill_country': {
'empty': {
'short': 'Required field',
'long': 'Country field in the "Billing Details" part is required.'
}
},
'bill_state_canada': {
'empty': {
'short': 'Required field',
'long': 'State field in the "Billing Details" part is required.'
}
},
'bill_state_us': {
'empty': {
'short': 'Required field',
'long': 'State field in the "Billing Details" part is required.'
}
},
'bill_phone': {
'empty1': {
'short': 'Country code required',
'long': 'Phone country code field in the "Billing Details" part is required.'
},
'invalid1': {
'short': 'Invalid input',
'long': 'Phone country code field in the "Billing Details" can only include numbers.'
},
'empty2': {
'short': 'Area code required',
'long': 'Phone area code field in the "Billing Details" part is required.'
},
'invalid2': {
'short': 'Invalid input',
'long': 'Phone area code field in the "Billing Details" can only include numbers.'
},
'empty3': {
'short': 'Phone number required',
'long': 'Phone number field in the "Billing Details" part is required.'
},
'invalid3': {
'short': 'Invalid input',
'long': 'Phone number field in the "Billing Details" can only include numbers.'
}
},
'ship_first_name': {
'empty': {
'short': 'Required field',
'long': 'First name field in the "Shipping Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'First name field in the "Shipping Details" part contain illegal character/s.'
}
},
'ship_last_name': {
'empty': {
'short': 'Required field',
'long': 'Last name field in the "Shipping Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Last name field in the "Shipping Details" part contain illegal character/s.'
}
},
'ship_address': {
'empty': {
'short': 'Required field',
'long': 'Street address field in the "Shipping Details" part is required.'
},
'invalid1': {
'short': 'Invalid input',
'long': 'Street address field in the "Shipping Details" part contain illegal character/s.'
},
'invalid2': {
'short': 'Invalid input',
'long': 'Street name in "Shipping Details" is required'
}
},
'ship_city': {
'empty': {
'short': 'Required field',
'long': 'City field in the "Shipping Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'City field in the "Shipping Details" part contain illegal character/s.'
}
},
'ship_zip_code': {
'empty': {
'short': 'Required field',
'long': 'Zip code field in the "Shipping Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Zip code field in the "Shipping Details" part contain illegal character/s.'
}
},
'ship_country': {
'empty': {
'short': 'Required field',
'long': 'Country field in the "Shipping Details" part is required.'
}
},
'ship_state_canada': {
'empty': {
'short': 'Required field',
'long': 'State field in the "Shipping Details" part is required.'
}
},
'ship_state_us': {
'empty': {
'short': 'Required field',
'long': 'State field in the "Shipping Details" part is required.'
}
},
'ship_phone': {
'empty1': {
'short': 'Country code required',
'long': 'Phone country code field in the "Shipping Details" part is required.'
},
'invalid1': {
'short': 'Invalid input',
'long': 'Phone country code field in the "Shipping Details" can only include numbers.'
},
'empty2': {
'short': 'Area code required',
'long': 'Phone area code field in the "Shipping Details" part is required.'
},
'invalid2': {
'short': 'Invalid input',
'long': 'Phone area code field in the "Shipping Details" can only include numbers.'
},
'empty3': {
'short': 'Phone number required',
'long': 'Phone number field in the "Shipping Details" part is required.'
},
'invalid3': {
'short': 'Invalid input',
'long': 'Phone number field in the "Shipping Details" can only include numbers.'
}
},
'pay_full_name': {
'empty': {
'short': 'Required field',
'long': 'Cardholder name field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Cardholder name field in the "Payment Details" part contain illegal character/s.'
}
},
'pay_cc_card_number': {
'empty': {
'short': 'Required field',
'long': 'Credit card number field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Credit card number field in the "Payment Details" can contain only numbers.'
},
'invalidmastercard1': {
'short': 'Invalid input',
'long': 'Credit card number field in the "Payment Details" part contains non-valid MasterCard number.'
},
'invalidmastercard2': {
'short': 'Invalid input',
'long': 'Sorry, temporarily we are not processing MasterCard. Please try again using a Visa-, American Express-, Diners- or JCB Credit Card. We also accept E-check payments.'
},
'invalidvisa': {
'short': 'Invalid input',
'long': 'Credit card number field in the "Payment Details" part contain not valid Visa number.'
},
'invaliddiners': {
'short': 'Invalid input',
'long': 'Sorry, temporarily we are not processing Diners, please switch to VISA or E-check'
},
'invalidamex': {
'short': 'Invalid input',
'long': 'Sorry, temporarily we are not processing American Express, please switch to VISA or E-check.'
}
},
'pay_cc_exp': {
'empty1': {
'short': 'Month required',
'long': 'Expiration month field in the "Payment Details" part is required.'
},
'empty2': {
'short': 'Year required',
'long': 'Expiration year field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Exp. date in the past',
'long': 'Expiration date in the "Payment Details" part must be in future.'
}
},
'pay_cc_cvv': {
'empty': {
'short': 'Required field',
'long': 'CVV Code field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'CVV Code field in the "Payment Details" part contain illegal character/s. must contain 3 digits'
}
},
'turing_key': {
'empty': {
'short': 'Required field',
'long': 'Confirm code field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Confirm code field in the "Payment Details" section contains illegal characters, it must contain 5 characters from the image above the field.'
}
},
'pay_echeck_routing_number': {
'empty': {
'short': 'Required field',
'long': 'Routing number field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Routing number field in the "Payment Details" part contain illegal character/s. must contain only digits'
}
},
'pay_echeck_account_number': {
'empty': {
'short': 'Required field',
'long': 'Account number field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Account number field in the "Payment Details" part contain illegal character/s. must contain only digits'
}
},
'pay_echeck_bank_name': {
'empty': {
'short': 'Required field',
'long': 'Bank Name field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Bank name field in the "Payment Details" part contain illegal character/s.'
}
},
'echeck_bank_state_canada': {
'empty': {
'short': 'Required field',
'long': 'Bank state field in the "Payment Details" part is required.'
}
},
'echeck_bank_state_us': {
'empty': {
'short': 'Required field',
'long': 'Bank state field in the "Payment Details" part is required.'
}
},
'pay_pp_email': {
'empty': {
'short': 'Required field',
'long': 'Email field in the "Payment Details" part is required.'
},
'invalid': {
'short': 'Invalid input',
'long': 'Email field in the "Payment Details" part contain illegal email address.'
}
},
'pay_elv_account_holder': {
'empty': {
'short': 'Required field',
'long': 'Account Holder Name field in the "Payment Details" part is required.'
}
},
'pay_elv_account_number': {
'empty': {
'short': 'Required field',
'long': 'Account number field in the "Payment Details" part is required.'
}
},
'pay_elv_routing_number': {
'empty': {
'short': 'Required field',
'long': 'Bank Code field in the "Payment Details" part is required.'
}
},
'pay_elv_bankcode': {
'empty': {
'short': 'Required field',
'long': 'Bank Code field in the "Payment Details" part is required.'
}
},
'pay_elv_bankname': {
'empty': {
'short': 'Required field',
'long': 'Bank Name field in the "Payment Details" part is required.'
}
},
'pay_elv_id_card': {
'invalid1': {
'short': 'Part I invalid',
'long': 'ID card part I contains invalid information'
},
'invalid2': {
'short': 'Part II invalid',
'long': 'ID card part II contains invalid information'
},
'invalid3': {
'short': 'Part III invalid',
'long': 'ID card part III contains invalid information'
},
'invalid4': {
'short': 'Part IV invalid',
'long': 'ID card part IV contains invalid information'
}
},
'statement_confirm': {
'invalid': {
'short': 'Please confirm',
'long': 'Please Certify the Terms of Use statement.'
}
},
'payment_confirm': {
'invalid': {
'short': 'Please confirm',
'long': 'Please check the box confirming that you read and confirmed your order details.'
}
}
}
/**
* Retrieve the appropriate error string.
* @param {string} element ID
* @param {string} error type
* @param {bool} long_msg
*/
function get_form_error_string(element, type, long_msg)
{
var msg;
if (element != '')
{
element = form_error_resolve_span_name(element);
if (element)
{
if (type != '' && form_error_strings[element])
{
if (typeof(long_msg) == 'boolean' && form_error_strings[element][type])
{
msg = form_error_strings[element][type][(long_msg?'long':'short')];
return msg || false;
}
msg = form_error_strings[element][type];
return msg || false;
}
msg = form_error_strings[element];
return msg || false;
}
return false;
}
return false;
}
/**
* Since we have a few elements that show their error in the same span,
* we need to find the correct span element for the input elements.
* @param {string} element_name
*/
function form_error_resolve_span_name(element_name)
{
if (typeof(element_name) != 'string')
{
return false;
}
var element_name_excep = ['pay_cc_exp','bill_country','bill_phone','ship_phone','pay_elv_id_card'];
for (var i in element_name_excep)
{
if (element_name.indexOf(element_name_excep[i]) != -1)
{
return element_name_excep[i];
}
}
return element_name;
}
var object_error_text = new Object;
object_error_text['email_required'] = "Please insert an Email!";
object_error_text['email_email'] = "The e-mail address you entered appears to be incorrect. Please verify it!";
object_error_text['password_required'] = "Please insert a password!";
object_error_text['password_length'] = "Password should be 6-10 characters and/or digits!";
object_error_text['first_name_required'] = "Please insert a First Name!";
object_error_text['last_name_required'] = "Please insert a Last Name!";
object_error_text['re_email_required'] = "Email confirmation is required!";
object_error_text['re_email_equalTo'] = "Email confirmation does not match the Email!";
object_error_text['re_password_equalTo'] = "Password confirmation does not match the password!";
object_error_text['re_password_required'] = "Please insert a Password confirmation!";
object_error_text['phone_required'] = "Please insert a phone number!";
object_error_text['phone_has_digits'] = "The Phone number may only include numbers!";
object_error_text['phone_country_code_required'] = "Please insert the country code of the phone number!";
object_error_text['phone_country_code_has_digits'] = "The country code of the phone number can only include numbers!";
object_error_text['phone_area_code_required'] = "Please insert the area code of the phone number!";
object_error_text['phone_area_code_has_digits'] = "The area code of the phone number can only include numbers!";
object_error_text['bill_first_name_required'] = "Please insert a First Name in Billing Details!";
object_error_text['bill_last_name_required'] = "Please insert a Last Name in Billing Details!";
object_error_text['bill_address_required'] = "Please insert a Street Address in Billing Details!";
object_error_text['bill_city_required'] = "Please insert a city in Billing Details!";
object_error_text['bill_phone_required'] = "Please insert a phone number in Billing Details!";
object_error_text['bill_phone_has_digits'] = "The Phone number in Billing Details may only include numbers!";
object_error_text['bill_zip_code_required'] = "Please insert a Zip Code in Billing Details!";
object_error_text['bill_zip_code_zipcode_no_state'] = "The Zip/Postal code field in theBilling Details should contain your zip/postal code and not your state abbreviation.";
object_error_text['bill_zip_code_has_digits'] = "The Zip/Postal code in Billing Details appears to be incorrect. Please verify it!";
object_error_text['bill_phone_country_code_required'] = "Please insert the country code of the phone in Billing Details!";
object_error_text['bill_phone_country_code_has_digits'] = "The country code of the phone number in Billing Details may only include numbers!";
object_error_text['bill_phone_area_code_required'] = "Please insert the area code of the phone number in Billing Details!";
object_error_text['bill_phone_area_code_has_digits'] = "The area code of the phone number in Billing Details may only include numbers!";
object_error_text['bill_countryID_required'] = "Please select a country in Billing Details!";
object_error_text['bill_state_us_required'] = "Please select a state in Billing Details!";
object_error_text['bill_state_canada_required'] = "Please select a province in Billing Details!";
object_error_text['ship_first_name_required'] = "Please insert a First Name in Shipment Destination!";
object_error_text['ship_last_name_required'] = "Please insert a Last Name in Shipment Destination!";
object_error_text['ship_address_required'] = "Please insert a Street Address in Shipment Destination!";
object_error_text['ship_city_required'] = "Please insert a city in Shipment Destination!";
object_error_text['ship_zip_code_required'] = "Please insert a Zip Code in Shipment Destination!";
object_error_text['ship_zip_code_zipcode_no_state'] = "The Zip/Postal code field in the Shipment Destination should contain your zip/postal code and not your state abbreviation.";
object_error_text['ship_zip_code_has_digits'] = "The Zip/Postal code in Shipment Destination appears to be incorrect. Please verify it!";
object_error_text['ship_phone_country_code_required'] = "Please insert the country code of the phone in Shipment Destination!";
object_error_text['ship_phone_country_code_has_digits'] = "The country code of the phone number in Shipment Destination may only include numbers!";
object_error_text['ship_phone_area_code_required'] = "Please insert the area code of the phone number in Shipment Destination!";
object_error_text['ship_phone_area_code_has_digits'] = "The area code of the phone number in Shipment Destination may only include numbers!";
object_error_text['ship_phone_required'] = "Please insert a phone number in Shipment Destination!";
object_error_text['ship_phone_has_digits'] = "The Phone number in Shipment Destination may only include numbers!";
object_error_text['ship_countryID_required'] = "Please select a country in Shipment Destination!";
object_error_text['ship_state_us_required'] = "Please select a state in Shipment Destination!";
object_error_text['ship_state_canada_required'] = "Please select a province in Shipment Destination!";
object_error_text['pay_cc_card_number_required'] = "Please insert a credit card number!";
object_error_text['pay_cc_card_number_length'] = "Credit Card number must consist of 16 digits (Visa, MasterCard) or 15 digits (Amex)!";
object_error_text['pay_cc_card_number_digits'] = "Credit Card number may consist only of digits!";
object_error_text['pay_cc_card_number_cc_valid_mastercard'] = "MasterCard number is invalid!";
object_error_text['pay_cc_card_number_cc_valid_visa'] = "Visa Card number is invalid!";
object_error_text['pay_cc_card_number_cc_disabled_mastercard'] = "Sorry, temporarily we are not processing MasterCard. Please try again using a Visa Card, E-check, Bill Payment or Money Orders! To select a different payment method, please click here.";
object_error_text['pay_cc_card_number_cc_disabled_diners'] = "Sorry, temporarily we are not processing Diners. Please try again using a Visa Card or AMEX. We also accept E-check, Bill Payments or Money Orders! To select a different payment method, please click here.";
object_error_text['pay_cc_card_number_cc_disabled_amex'] = "Sorry, temporarily we are not processing AmEx. Please try again using a Visa Card, E-check, Bill Payment or Money Orders! To select a different payment method, please click here.";
object_error_text['pay_cc_exp_month_required'] = "Please select the Expiry Month of your Credit Card!";
object_error_text['pay_cc_exp_month_cc_month_not_expired'] = "The Credit Card seems to have expired! Please verify the Month of your Credit Card expiry date!";
object_error_text['pay_cc_exp_year_required'] = "Please select the Expiry Year of your Credit Card!";
object_error_text['pay_cc_exp_year_cc_year_not_expired'] = "The Credit Card seems to have expired! Please verify the Year of your Credit Card expiry date!";
object_error_text['pay_cc_cvv_required'] = "Please insert the CVV code of your Credit Card!";
object_error_text['pay_cc_cvv_digits'] = "The CVV code of your Credit Card may only include numbers!";
object_error_text['pay_cc_cvv_length'] = "The CVV code of you Credit Card number must consist of 3 digits (Visa, MasterCard) or 4 digits (Amex)!";
object_error_text['pay_full_name_required'] = "Please insert the card holder name of your Credit Card!";
object_error_text['pay_full_name_length'] = "The card holder name of your Credit Card may only consist of letters or numbers!";
object_error_text['pay_echeck_routing_number_required'] = "Please insert the routing number!";
object_error_text['pay_echeck_routing_number_digits'] = "The routing number may only contain digits!";
object_error_text['pay_echeck_account_number_required'] = "Please insert the account number!";
object_error_text['pay_echeck_account_number_digits'] = "The account number may only contain digits!";
object_error_text['pay_echeck_bank_name_required'] = "Please insert the Bank Name!";
object_error_text['echeck_bank_state_us_required'] = "Please select the State of your Bank!";
object_error_text['echeck_bank_state_canada_required'] = "Please select the Province of your Bank!";
object_error_text['pay_elv_account_number_required'] = "Please insert the account number number!";
object_error_text['pay_elv_account_number_digits'] = "The account number may only contain digits!";
object_error_text['pay_elv_routing_number_required'] = "Please insert the BLZ!";
object_error_text['pay_elv_routing_number_digits'] = "The BLZ may only contain digits!";
object_error_text['pay_elv_id_card_a_required'] = "Please insert the part I of your German ID card!";
object_error_text['pay_elv_id_card_a_length'] = "The part I of your ID must consist of 11 characters!";
object_error_text['pay_elv_id_card_b_required'] = "Please insert the part II of your German ID card!";
object_error_text['pay_elv_id_card_b_digits'] = "The part II of your ID may only contain digits!";
object_error_text['pay_elv_id_card_b_length'] = "The part II of your ID must consist of 7 digits!";
object_error_text['pay_elv_id_card_c_required'] = "Please insert the part III of your German ID card!";
object_error_text['pay_elv_id_card_c_digits'] = "The part III of your ID may only contain digits!";
object_error_text['pay_elv_id_card_c_length'] = "The part III of your ID must consist of 7 digits!";
object_error_text['pay_elv_id_card_d_required'] = "Please insert the part IV of your German ID card!";
object_error_text['pay_elv_id_card_d_digits'] = "The part IV of your ID may only contain digit!";
object_error_text['pay_elv_id_card_d_length'] = "The part IV of your ID must consist of 1 digit!";
object_error_text['statement_confirm_required'] = "Please mark at the bottom of the page the checkbox to confirm that you have read the conditions of payment!";
object_error_text['terms_and_conditions_required'] = "Please check the first box, confirming you have read, understood and agree to the Terms of Use!";