/*
 * Author(s): Tricia Woodruff
 * Date: 2004-Mar-24
 * Copyright: Classified Ventures
 * Description: provides error message text for errors in the SIY product
 */

 
/* 
 * Error message constants
 */
var errorText = "";
 
var zipSubglobal_errorsContainer = "<table class='errorbox' border='0' cellspacing='0' cellpadding='0'><tr><td class='errorhdr'><img src='/images/errorMrkr.gif' width='14' height='14' valign='middle'/>&nbsp;&nbsp;Page unavailable. </td></tr><tr><td><ul>Sorry</ul></td></tr></table><br/>"

var generic_password = "This password is not allowed. Please choose another password, using a combination of letters and numbers."
var no_ad_in_session = "There is no ad in session.";

var validation_error_header = "The following field(s) contain invalid or incomplete information:" 
var validation_error_header_link = "The following are reasons your notification email was not successfully sent:"
var required_error_header = "The following field(s) are required:"; 

var payment_charged_but_transaction_failed = "Your payment could not be completed. Please check your credit card number and expiration date and try again.";

var error_start_text = "<table class='errorbox' border='0' cellspacing='0' cellpadding='0'><tr><td class='errorhdr'><img src='/images/errorMrkr.gif' width='14' height='14' valign='middle'/>&nbsp;&nbsp;Please fix the following problems before continuing. </td></tr><tr><td><ul>";

var error_end_text = "</ul></td></tr></table><br/>";

var search_results_start_text = "<table class='errorbox' border='0' cellspacing='0' cellpadding='0'><tr><td class='errorhdr'><img src='/images/errorMrkr.gif' width='14' height='14' valign='middle'/> Try Your Search Again</td></tr><tr><td><ul>";

var global_error_start_text = "<table class='errorbox' border='0' cellspacing='0' cellpadding='0'><tr><td class='errorhdr'><img src='/images/errorMrkr.gif' width='14' height='14' valign='middle'/>&nbsp;&nbsp;Error</td></tr><tr><td><ul>";

var unauthorized_error_start_text = "<table class='errorbox' border='0' cellspacing='0' cellpadding='0'><tr><td class='errorhdr'><img src='/images/errorMrkr.gif' width='14' height='14' valign='middle'/>&nbsp;&nbsp;Unauthorized Access</td></tr><tr><td><ul>";

var no_search_results_info = "<li>There were no results found based on the criteria provided. Please try your search again.</li>";

var too_many_search_results_info = "<li>More than 500 results were found. Please narrow your search criteria and try the search again.</li>";

var bad_zip_code = "This field must be a 5-digit U.S. ZIP Code (like 94043).";

var bad_email_address = "This field must be a valid e-mail address (like user@aol.com)."; 

var invalid_userid_login = "The e-mail address, user name and/or password you entered is invalid. Please check your login information and try again.<br/><br/>Note: Your password is case sensitive, for example \"PASSWORD\" is different than \"password\"";

var contact_customer_service = "You cannot be logged in at this time.  Please <a href='/siy/contactCustomerService.jsp'>contact customer service</a> to re-establish access to your account.";

var unknown_zip = "The ZIP code you entered is not valid. Please enter a valid 5-digit U.S. ZIP code (like 94043).";

var invalid_date = "The date that you entered is invalid, please be sure to choose month, day and year.";

var invalid_exp_date = "The expiration date you entered was invalid. Please check your card's expiration date and try again.";

var generic_save_error = "An error occurred while trying to save this ad.";

var generic_delete_error = "An error occurred while trying to delete this ad.";

var credit_card_invalid = "You entered an invalid credit card number. Please try again.";

var invalid_max_usage = "This field should contain a positive number with no commas or decimal points.";

var csc_error = "The Card Security Code and/or expiration date you entered was incorrect. Please check the reverse side of your card for the three-digit number following your account number on the signature bar and re-enter. In addition, please verify your card's expiration date.";

var session_error_ad = "<table class='errorbox' border='0' cellspacing='0' cellpadding='0'><tr><td class='errorhdr'><img src='/images/errorMrkr.gif' width='14' height='14' valign='middle'/>&nbsp;&nbsp;Page unavailable. </td></tr><tr><td><ul>Your Sell It Yourself session has expired, or you tried to access a page that is otherwise no longer available. Please start building your ad again, or click Sign In to access your My Ads page.</ul></td></tr></table><br/>";

var session_error_user = "<table class='errorbox' border='0' cellspacing='0' cellpadding='0'><tr><td class='errorhdr'><img src='/images/errorMrkr.gif' width='14' height='14' valign='middle'/>&nbsp;&nbsp;Page unavailable. </td></tr><tr><td><ul>Your Sell It Yourself session has expired, or you tried to access a page that is otherwise no longer available. Please sign in to access your My Ads page.</ul></td></tr></table><br/>";

// NOTE: Filth filter violations are handled in the process errors jsp since they requirs server side input

/*
 * Create an array defining labels, error codes and associated messages for each field 
 */

/* Registration form fields */
var error = new Array();




//Create/Edit Package Fields
	//packageName
	error["packageName,label"] = "Package Name";
	//peoplesoftId
	error["peoplesoftId,label"] = "PeopleSoft Id";
	//displayName
	error["displayName,label"] = "Display Name";
	//price
	error["price,label"] = "Default Price";
	//packageDescription
	error["packageDescription,label"] = "Description";
	
	//maxPhotos
	error["maxPhotos,label"] = "Number of Photos";
	error["maxPhotos,too_many_photos"] = "The number of photos cannot exceed 12.";
	
	
	//renewalPeriod
	error["renewalPeriod,label"] = "Ad Duration";
	error["renewalPeriod,adDuration_tooLarge"] = "The Ad Duration cannot exceed 90 days.";
		
	//renewalsLeftbox
	error["renewalsLeftbox,label"] = "Number of Renewals";
	
	


//Upgrade
error["global_errors,ad_not_upgradeable"] = "Your ad can not be upgraded at this time";




// ufname
error["ufname,label"] = "First Name";

// ulname
error["ulname,label"] = "Last Name";

// uaddr1
error["uaddr1,label"] = "Address";

// ucity
error["ucity,label"] = "City";

// ustate
error["ustate,label"] = "State";

//Credit Card
error["uccNumber,label"] = "Last 4 CC Digits";
//Exp Date
error["uccExpDate,label"] = "Expiration Date";

// uzipcode
error["uzipcode,label"] = "ZIP Code";
error["uzipcode,invalid_zip_format"] = bad_zip_code;
error["uzipcode,unknown_zip"] = unknown_zip;
// utype
error["utype,label"] = "Seller Type";
error["utype,invalid_user_type"] = "The seller type you selected is invalid";

// uemail
error["uemail,label"] = "E-mail Address";
error["uemail,invalid_email_address"] = bad_email_address;
error["uemail,invalid_login"] = invalid_userid_login;
//error["uemail,login_id_already_exists"] = "The e-mail address you entered is already in our system. If you already have an account with us, click \"Back to My Ads Page,\" and then the “Sign out” button.  Next use the \"Returning Users\" box at right to sign in. If you forgot your password, click the \"Forgot Your Password\" link. ";
error["uemail,login_id_already_exists"] = "The e-mail address you provided is already in our system. Please re-enter it on the right side of the page, in the Email Address space below \"Returning Users.\" If you forgot your password, click \"Forgot Your Password?\" next to the Sign In button.";
error["uemail,cs_login_id_already_exists"] = "You are attempting to change the user e-mail address to an email address that already exists in another user account.  A user email address cannot be associated with more than one account. You can change the contact email address, which is the email address where leads are sent, on the Edit Ad Page.";
error["uemail,www_found"] = "\"www.\" is typically not part of an e-mail address. Please check to verify that you have entered your correct address.";
error["uemail,user_is_disabled"] = contact_customer_service;
error["uemail,user_is_deleted"] = contact_customer_service;
error["uemail,user_does_not_exist"] = "This e-mail address is not in our system. Please check your e-mail address carefully and re-enter."


//uemformat
error["uemformat,label"] = "E-Mail Format";
error["uemformat,invalid_email_format_type"] = "The e-mail format you selected is invalid";

// upassword
error["upassword,label"] = "Password";
error["upassword,passwords_dont_match"] = "Your original password and confirmed password do not match. Please re-enter.";
error["upassword,invalid_password"] = "Your password must be between 6 and 12 characters and may not contain spaces or special characters.";
error["upassword,invalid_login"] = invalid_userid_login;
error["upassword,user_does_not_exist"] = invalid_userid_login;
error["upassword,generic_password"] = generic_password;
// upasswordVal
error["upasswordVal,label"] = "Confirm Password";

/*CS user form fields*/
//user role
error["urole,label"] = "User Role";
error["urole,invalid_role_type"] = "The user role you selected is invalid";



/* Payment form fields */
//promotionCode
error["promotionCode,label"] = "Promotion Code";
error["promotionCode,invalid_promotion_code"] = "The promotion code that you entered is invalid";
error["promotionCode,expired_promotion_code"] = "The promotion code that you entered has expired, please try another code.";

//billingFirstName
error["billingFirstName,label"] = "First Name";

//billingLastName
error["billingLastName,label"] = "Last Name";

// billingAddress1
error["billingAddress1,label"] = "Address";

//billingCity
error["billingCity,label"] = "City";

//billingState
error["billingState,label"] = "State";

// billingZip
error["billingZip,label"] = "ZIP Code";
error["billingZip,invalid_zip_format"] = bad_zip_code;
error["billingZip,value_not_integer"] = bad_zip_code;
error["billingZip,unknown_zip"] = unknown_zip;

//creditCardName
error["creditCardName,label"] = "Credit Card";

//ccExpire
error["ccExpire,label"] = "Expiration Date";
error["ccExpire,invalid_expiration_date"] = invalid_exp_date;
error["ccExpireMonth,label"] = "Expiration Month";
error["ccExpireYear,label"] = "Expiration Year";

//ccSecurityCode
error["ccSecurityCode,label"] = "Security Code";

//ccNum
error["ccNum,label"] = "Card Number";
error["ccNum,value_not_big_decimal"] = credit_card_invalid;
error["ccNum,bad_cc_type_known"] = "The number you entered is not a valid ";  //page should fill in card type

//Verisign Errors
error["global_errors,label"] = "Error";
//declined
//error["global_errors,11"] = payment_charged_but_transaction_failed;
//error["global_errors,100"] = payment_charged_but_transaction_failed;
//error["global_errors,102"] = payment_charged_but_transaction_failed;
//error["global_errors,103"] = payment_charged_but_transaction_failed;
error["global_errors,104"] = "The payment processor timed out waiting for a response. Please try again. If you still receive this error, please send a message to cars.com <a href='contactCustomerService.jsp'>Sell It Yourself Support</a>. (Error Code 104)";
//error["global_errors,106"] = payment_charged_but_transaction_failed;
//error["global_errors,109"] = payment_charged_but_transaction_failed;
error["global_errors,12"] = "The credit card system declined your card. Please double check your card information including the Card Security Code and re-submit. If you still receive this error, please send a message to cars.com <a href='contactCustomerService.jsp'>Sell It Yourself Support</a>. (Error Code 12)";
//error["ccNum,1"] = "Your payment could not be authenticated. Please try again later.";
//invalid
error["global_errors,23"] = "You entered an invalid credit card number. Please check the number carefully and re-enter. (Error Code 23)";
//expiriation invalid
error["global_errors,24"] = "The expiration date you entered was invalid. Please check your card's expiration date and try again. (Error Code 24)";
//bad CSC
error["global_errors,114"] = csc_error;
error["global_errors,13"] = "Your transaction returned a referral error from our credit-card processing network. Please try your transaction again. If it fails a second time, please contact your bank to correct the problem or try a different credit card. (Error Code 13)";
error["global_errors,0"] = "The Card Security Code and/or expiration date you entered was incorrect. Please check the reverse side of your card for the three-digit number following your account number on the signature bar and re-enter. In addition, please verify your card's expiration date. (Error Code 0)";
//insufficient funds
//error["global_errors,50"] = "Insufficient funds. Please try another credit card.";
//system busy
//error["global_errors,115"] = "The credit card processing system is busy.  Please try again later.";
error["global_errors,lost_contact_with_veriSign"] = "Unable to contact the credit card processing system.  Please try again later.";

/* Promotions Entry Form Fields */

//promoType
error["promoType,label"] = "Promotion Type";
error["promoType,invalid_numeric_value"] = "You must enter a promotion type";

//promoCode
error["promoCode,label"] = "Promotion Code";
error["promoCode,exhausted_promotion_code"] = "That promotion code has been used, please try another code.";
error["promoCode,space_in_promo"] = "Promotion codes cannot contain spaces.";
error["promoCode,invalid_promo_code"] = "Promotion codes can only be composed of letters and/or numbers.";

//startDateComplete
error["startDateComplete,label"] = "Start Date";
error["startDateComplete,invalid_date"] = invalid_date;
error["startDateComplete,past_date"] = "The start date cannot be in the past.  Please choose another date.";

//endDateComplete
error["endDateComplete,label"] = "End Date";
error["endDateComplete,invalid_date"] = invalid_date;
//renewDateComplete
error["renewDateComplete,label"] = "Renewal Date";
error["renewDateComplete,invalid_date"] = invalid_date;

  //server side uses this for start date not before end date
error["promoDateRange,label"] = "End Date";
error["promoDateRange,date_out_of_range"] = "The end date must come after the start date.";

//description
error["description,label"] = "Description";

//discount (discountDollar and discountPercentage are treated as one field discount)
error["discount,label"] = "Discount";
error["discount,invalid_discount"] = "The discount must be either a valid percentage or a valid dollar amount.";
error["discount,invalid_promotion_discount_percentage"] = "The discount must be a percentage between 0 and 100.";
error["discount,two_discounts_specified"] = "Please enter either a dollar discount or a percent discount, but not both.";

//maxUsageTotal
error["maxUsageTotal,label"] = "Max Usage (Total)";
error["maxUsageTotal,invalid_numeric_value"] = invalid_max_usage + " Enter -1 for unlimited total usage.";
error["maxUsageTotal,invalid_promotion_usage_count"] = invalid_max_usage + " Enter -1 for unlimited total usage.";

//maxUsageUser
error["maxUsagePerUser,label"] = "Max Usage/User";
error["maxUsagePerUser,invalid_numeric_value"] = invalid_max_usage + " Enter -1 for unlimited usage per user.";
error["maxUsagePerUser,invalid_promotion_usage_counte"] = invalid_max_usage + " Enter -1 for unlimited usage per user.";
error["maxUsagePerUser,max_usage_too_big"] = "The max usage per user is higher than the total max usage.  Please modify so that max usage per user is equal to or less than max usage.";
//***************************************************
//locationZip - zip entry and build your ad pages
error["locationZip,label"] = "ZIP Code";
error["locationZip,unknown_zip"] = unknown_zip;
error["locationZip,invalid_zip_format"] = bad_zip_code;
error["locationZip,value_not_integer"] = bad_zip_code;
error["locationZip,missing_field"] = "ZIP field is empty";


//***************************************************
//build your ad fields


error["year,label"] = "Year";
error["year,missing_field"] = "Year field is empty";

error["makeId,label"] = "Make";
error["makeId,missing_field"] = "Make field is empty";

error["modelId,label"] = "Model";
error["modelId,missing_field"] = "Model field is empty";

error["trimId,label"] = "Trim";
error["bodyStyleId,label"] = "Body Style";

error["askingPrice,label"] = "Asking Price";
error["askingPrice,missing_field"] = "Asking Price field is empty";
error["askingPrice,not_non_negative_integer"] = "Asking Price value is not valid";

error["acceptBestOffer,label"] = "Accept Best Offer";

error["mileage,label"] = "Mileage";
error["mileage,missing_field"] = "Mileage field is empty";
error["mileage,not_non_negative_integer"] = "Mileage value is not valid";

error["vin,label"] = "VIN";
error["condition,label"] = "Condition";
error["exteriorColor,label"] = "Exterior Color";
error["interiorColor,label"] = "Interior Color";
error["transmission,label"] = "Transmission";
error["doorCount,label"] = "Number of Doors";
error["cylinderCount,label"] = "Number of  Cylinders";
error["driveTrain,label"] = "Drivetrain";
error["locationCity,label"] = "City";
error["locationState,label"] = "State";
error["features,label"] = "Features";
error["sellingPoints,label"] = "Selling Point Notes";
error["conditionDescription,label"] = "Condition Description";
error["contactName,label"] = "Contact Name";
error["sellerType,label"] = "Seller Type";
error["contactEmail,label"] = "E-mail Address";
error["contactEmail,invalid_email_address"] = bad_email_address;
error["contactAreaCode1,label"] = "Contact Area Code 1";
error["contactExchange1,label"] = "Contact Exchange Number 1";
error["contactNumber1,label"] = "Contact Number 1";
error["contactExtension1,label"] = "Contact Extension 1";
error["contactType1,label"] = "Contact Type2";
error["contactAreaCode2,label"] = "Contact Area Code 2";
error["contactExchange2,label"] = "Contact Exchange 2";
error["contactNumber2,label"] = "Contact Number 2";
error["contactExtension2,label"] = "Contact Extension 2";
error["contactType2,label"] = "Contact Type 2";


//cs notes

error["eventnote,label"] = "Note Comments";
error["eventnote,missing_field"] = "Note Comments field is empty";

/* Contact Customer service form fields */

// name
error["uname,label"] = "Name";

//phone
error["phone,label"] = "Phone";
error["phone,invalid_phone_number"] = "The phone number you entered is invalid. Please be sure that you entered an area code, prefix and phone number." ;

//email (uses uemail - see registration above)

//inquiryreason
error["inquiryreason,label"] = "Reason for Inquiry";

//problemdescription
error["problemdescription,label"] = "Detailed Description of Question or Problem";


//payment adjustment refundAmt,reasonForRefundId,notes

error["refundAmt,label"] = "Refund Amount";
error["refundAmt,missing_field"] = "Refund Amount field is empty";
error["refundAmt,not_non_negative_integer"] = "Refund amount value is not valid";
error["refundAmt,invalid_numeric_value"] = "Refund amount exceeds remaining balance of the original transaction. Please lower the refund amount and try again.";

error["reasonForRefundId,label"] = "Refund Reason";
error["reasonForRefundId,missing_field"] = "Refund reason field is empty";


error["notes,label"] = "Notes";
error["notes,missing_field"] = "Notes field is empty";


// Global Errors
error["global_errors,no_ad_in_session"] = no_ad_in_session;
error["global_errors,persistence_layer_error"] = generic_save_error;
error["global_errors,incomplete_contact_info"] = "Please enter either an e-mail address or a phone number for prospective buyers to contact you.";
error["global_errors,no_declared_fields"] = generic_save_error;
error["global_errors,no_ad_update_rights"] = generic_save_error;
error["global_errors,ad_validation_failed"] = generic_save_error;
error["global_errors,no_ad_id_sent_for_delete"] = generic_delete_error;
error["global_errors,no_ad_delete_rights"] = "You do not have permission to delete this ad";
error["global_errors,encrypted_data_expected"] = "We are experiencing some problems accessing your ad.  Please log in to your My Ads page from the link below to renew your ad."
error["global_errors,decryption_error"] = "We are experiencing some problems accessing your ad.  Please log in to your My Ads page from the link below to renew your ad."
error["global_errors,paypal_financial_error"] = "We were unable to complete your transaction using PayPal.  Please retry or edit your payment information to use your credit card to checkout."
//error["global_errors,[no_ad_in_session]"] = "123there is no ad in session.";
error["global_errors,ADID_NOT_FOUND"] = "No Ad Id available on request";
error["global_errors,no_user_in_session"] = "No User available";
error["global_errors,invalid_ad_id"] = "Couldn't load ad based on ad id";
error["global_errors,invalid_ad_status"] = "Ad is not in correct status (Rejected/Fraud)";
error["global_errors,invalid_ad_type"] = "Attempting to reject non-combo ad";
error["global_errors,no_rejected_combo_ad_aff_notify_rights"] = "User does not have permission to send affiliate rejection notification";
error["global_errors,reject_combo_affiliate_notify_failure"] = "Failed to send email to affiliate";
error["global_errors,ad_rejection_failed"] = "Ad Rejection failed. Please contact SiteOps for more information.";
//Ad did not reject
error["failed_rejection_ids,label"] = "The following ad or ads were not rejected";


