window.errors={dnatube:"DNA tube quality option is a required field",required:"Please complete all of the required fields, and try again.",requireOneOfMany:"At least one field in the group must be filled out",password:"Password does not conform to the password policy",passwordConfirm:"The Password and Confirm Password fields you entered do not match. Please try again.",emailConfirm:"Email and Confirm Email do not match",secretConfirm:"The Secret Answer and Confirm Secret Answer fields you entered do not match. Please try again.",alphanumeric:"Value must be alphanumeric",InvalidReserveNumber:"Please enter an alphanumeric value (no spaces or special characters) when specifying a Reserve Number.",numericOrderNumber:"The Order Number must be numeric.",phone:"Phone number or Fax number provided were non-numeric values",email:"The email address you entered is not valid. Please verify the format, and try again.",date:"Date is in an invalid format (ex. MM/DD/YYYY)",expirationDate:"The expiration date you entered is not valid. Please verify your information, and try again.",currency:"Currency is in an invalid format",creditCard:"The credit card number you entered is not valid. Please verify your information, and try again.",quantity:"Please enter a quantity in the range of 1 to 999.",acceptance:"The terms and conditions must be accepted to continue",checkboxes:"Please select at least one item, and try again.",checkboxesQuoteItemDeleted:"You appear to be removing an item that is tied to a quote or promotion.  Please remove the quote/promotion before removing the item.",twoOrMorecheckboxes:"Merging carts requires multiple carts to be selected",file:"A file must be selected to upload",fileType:"There was an error reading your upload file. Please ensure your upload template is saved as an .xls file type.",fileExtension:"The online oligo order system accepts Excel files (.xls/.xlsx) and comma (.csv) or tab delimited (.txt) files only",invalid:"Cart ID's may only include numbers. Please enter a valid cart ID number and try your search again.",invalidQuoteID:"Quote ID's may only include numbers. Please enter a valid Quote ID number and try your search again.",numericCheck:"Please enter 4 numeric digits for Ledger",noCreditCard:"No credit card selected",notWithin30DayWindow:"End date cannot exceed the specified date range of 30 Days.",notWithin7DayWindow:"End date cannot exceed the specified date range of 7 Days.",StartEndDatePairs:"End date cannot be before start date.",pairOfDates:"Please provide both the dates for searching order with in a date range.",atleastOne:"Please provide at least one criteria to search an order.",B2COrderStatus:"Please provide either E1 Order Number or a Customer PO Number to search the orders with specific statuses.",B2BOrderStatus:"Please provide either PO Number or E1 Order Number or a date range to search the orders with specific statuses.",B2BPartnerNameOrderStatus:"Please provide a date range for Order Search based on Partner Name.",B2CDate:"Please select an Order Status or provide an E1 order number or customer PO Number",B2BDate:"Please select an Order Status and Date Range or provide an E1 order number or provide a PO Number.",textareaempty:"Please enter valid data in the textarea to upload",iCardNumber:"We're sorry, but the SimpleSci&trade; Card Number you entered is not valid. Numbers must be 19 to 22 digits. Please try again.",iCardAccessCode:"We're sorry, but the SimpleSci&trade; security ID you provided is invalid. Security ID must be six digits. Please try again.",CardIDAccessCode:"Please enter a valid Card Number and Security ID ",iCardValidate:"We're sorry, but please validate the  SimpleSci&trade; Card by clicking on the Validate & Check Balance button before checkout.",noResponse:"We are sorry, we are unable to accept SimpleSci&trade; as the only mode of payment at this time. Please select a different mode of payment or combine the selected SimpleSci&trade; with a second mode of payment.",noResponseRecharge:"We're sorry, but we're experiencing technical difficulties that prevent us from processing SimpleSci&trade; orders. Please try again later. If you have other items in your cart that you want to order now, please delete the SimpleSci&trade; Recharge SKU from your cart and complete the checkout steps.",invalidCardIDCodeCombination:"We're sorry, but we were not able to validate your information. Please check your SimpleSci&trade; Number and Security ID, and try again. If you continue to have problems, please contact customer service.",repeatIcardNumber:"We are sorry, but same SimpleSci&trade; Number cannot be used for placing the Order.",phoneNumber:"Phone Number provided were non-numeric values",changeShipToAccount:"Please select any of the Ship To Account's",validatePwdQA:"Please enter a new password and security question/answer.",validatePwd:"Please enter a new password.",validateQA:"Please enter a security question/answer.",invalidEmail:"Invalid email address.  Please enter a valid email address.",validateSpendingLimit:"Please enter a spending limit.",validateStartEndDate:"Please enter an effective start date and/or effective end date.",validateInformation:"Please provide all required information.",validateApprover:'Please enter an approver. An approver is required for the "apply during routing" payment method.',validatePaymentMethod:"Missing payment information.  Please enter a valid payment method.",validateRejectRationale:"Please enter a rejection rationale.",validateKey_Approver_Approvee:"Approver and Approvee may not be same. Please change the search criteria.",validateKey_Approver_Proxy:"Approver and Proxy Approver may not be same. Please change the search criteria.",validateKey_Approvee_Proxy:"Approvee and Proxy Approver may not be same. Please change the search criteria.",InvalidShipTo:"The Account Number you entered is invalid. Please verify the number and try again.",invalidStandardOligo:"Special Oligo shipping options are only supported by the Premium Oligo quality option. Please select the Premium Oligo quality option (at no additional cost) or unselect the special shipping option(s).",showDnaShipTo:"Please select one DNA Ship to option.",billToAccountNumber:"Please enter Primary Bill To account Number.",rejectMultiple:"Please enter single value.",grantNumLengthValidation:"Grant numbers must be 6 to 50 characters.",doublechar:"Double Byte Characters not allowed."};window.pageErrors=[];window.modalErrors=[];window.errorScope="page";$(document).ready(function(){initializeValidation("")});function initializeValidation(a){$(a+"form.validateForm").unbind("submit");$(a+"form.validateForm").submit(function(){return formValidation($(this))})}function formValidation(a){resetErrors();alphanumericValidationWithComma(a);requiredValidation(a);rejectMultipleValidation(a);requireOneOfManyValidation(a);confirmValidation(a);phoneValidation(a);faxValidation(a);emailValidation(a);quantityValidation(a);alphanumericValidation(a);passwordValidation(a);expirationDateValidation(a);creditCardValidation(a);orderNumberValidation(a);reserveNumberValidation(a);currencyValidation(a);datePickerValidation(a);acceptanceValidation(a);fileValidation(a);fileTypeValidation(a);validateTextArea(a);validateLedger(a);if(thereAreValidationErrors()||thereAreServerErrors()){$("div.transferCart #pageError").html("");$("div.transferCart #modalError").html("")}var b="checkout";iCardValidation(a,b);showErrors();if(thereAreValidationErrors()){return false}else{return confirmCustomerStatus(a)}}function isValidICardNumber(a){numValue=a.replace(/\D/,"");if(numValue.match(/\d{19,22}/)&&numValue.length<=22){return true}else{return false}}function isValidICardAccessCode(a){if(a.match(/\d{6}/)&&a.length==6){return true}else{return false}}function confirmCustomerStatus(b){var c="";var a="";b.find("select.UserStatus").each(function(){c=$(this)[0].value});b.find("input.userStatusDescription").each(function(){a=$(this)[0].value});if(c=="Closed"&&a=="Open"){if(confirm("Are you sure you want to close the selected user account?  Please note that when a user account is closed, all pending orders associated to the account will be cancelled.")){}else{return false}}return true}function requiredValidation(a){a.find("input.validateRequired").each(function(){if(isEmpty($(this)[0].value.split(" ").join(""))){addError("required",$(this));$(this)[0].value=""}else{removeError("required",$(this))}});a.find("textarea.validateRequired").each(function(){if(isEmpty($(this)[0].value)){addError("required",$(this))}else{removeError("required",$(this))}});a.find("select.validateRequired").each(function(){if(isEmpty($(this)[0].value)){addError("required",$(this));$(this).removeClass("error");$(this).parent().addClass("select_error")}else{removeError("required",$(this));$(this).parent().removeClass("select_error")}});a.find("ul.validateRequired").each(function(){if($("ul.validateRequired input:checkbox:checked").length<1){addError("required",$(this));$("ul.validateRequired input:checkbox").parent().addClass("error")}else{removeError("required",$(this));$("ul.validateRequired input:checkbox").parent().removeClass("error")}});return false}function rejectMultipleValidation(a){a.find("input.validateSingle").each(function(){if(($(this)[0].value.split(" ").join("")).indexOf(",")!=-1){addError("rejectMultiple",$(this));$(this)[0].value=""}else{removeError("rejectMultiple",$(this))}});return false}function requireOneOfManyValidation(a){if(a.find(".validateOneOfManyRequired").length>0){var b=false;a.find(".validateOneOfManyRequired").each(function(){if(!isEmpty($(this)[0].value)){b=true}});if(b){$(".validateOneOfManyRequired").each(function(){$(this).removeClass("requiredError error")});removeError("requireOneOfMany")}else{$(".validateOneOfManyRequired").each(function(){$(this).addClass("requiredError error")});addError("requireOneOfMany")}}}function confirmValidation(a){a.find("input.validateConfirm").each(function(){$theSecondField=$(this);$theFirstField=previousInputListField($theSecondField);$theFirstLabel=$theFirstField.siblings("span.label").text();$theSecondLabel=$theSecondField.siblings("span.label").text();var c=$theFirstField[0].value;var b=$theSecondField[0].value;if(c!=b){if($theFirstLabel.indexOf("Password")>=0){addError("passwordConfirm",$theFirstField);addError("passwordConfirm",$theSecondField)}else{if($theFirstLabel.indexOf("Email")>=0){if(c.toLowerCase()!=b.toLowerCase()){addError("emailConfirm",$theFirstField);addError("emailConfirm",$theSecondField)}}else{addError("secretConfirm",$theFirstField);addError("secretConfirm",$theSecondField)}}}else{if($theFirstLabel.indexOf("Password")>=0){removeError("passwordConfirm",$theFirstField);removeError("passwordConfirm",$theSecondField)}else{if($theFirstLabel.indexOf("Email")>=0){removeError("emailConfirm",$theFirstField);removeError("emailConfirm",$theSecondField)}else{removeError("secretConfirm",$theFirstField);removeError("secretConfirm",$theSecondField)}}}});return false}function phoneValidation(a){a.find("input.validatePhone").each(function(){$(this)[0].value=stripNonNumericCharacters($(this)[0].value);if(isEmpty($(this)[0].value)){addError("required",$(this))}else{removeError("required",$(this))}if(isValidPhone($(this)[0].value)){removeError("phone",$(this))}else{addError("phone",$(this))}});return false}function faxValidation(a){a.find("input.validateFax").each(function(){$(this)[0].value=stripNonNumericCharacters($(this)[0].value);if(isValidPhone($(this)[0].value)){removeError("phone",$(this))}else{addError("phone",$(this))}});return false}function emailValidation(a){a.find("input.validateEmail").each(function(){if(isEmpty($(this)[0].value)||isValidEmail($(this)[0].value)){removeError("email",$(this))}else{addError("email",$(this))}});return false}function passwordValidation(a){a.find("input.validatePassword").each(function(){if(isValidPassword($(this)[0].value)){removeError("password",$(this))}else{addError("password",$(this))}});return false}function expirationDateValidation(a){a.find("select.validateExpirationDate").each(function(){if(isValidExpirationDate($(this))){removeError("expirationDate",$(this));$("#year_div").removeClass("select_error");$("#month_div").removeClass("select_error")}else{addError("expirationDate",$(this));$(this).removeClass("error");$("#year_div").addClass("select_error");$("#month_div").addClass("select_error")}})}function alphanumericValidation(a){a.find("input.validateAlphanumeric").each(function(){if(isAlphanumeric($(this)[0].value)){removeError("alphanumeric",$(this))}else{addError("alphanumeric",$(this))}});return false}function reserveNumberValidation(a){a.find("input.validateReserveNumber").each(function(){if(isAlphanumeric($(this)[0].value)){removeError("InvalidReserveNumber",$(this))}else{addError("InvalidReserveNumber",$(this))}});return false}function orderNumberValidation(a){a.find("input.validateOrderNumber").each(function(){if(isInteger($(this)[0].value)){removeError("numericOrderNumber",$(this))}else{addError("numericOrderNumber",$(this))}});return false}function quantityValidation(a){a.find("input.validateQuantity").each(function(){if(isValidQuantity($(this)[0].value)){removeError("quantity",$(this))}else{addError("quantity",$(this))}});return false}function creditCardValidation(a){a.find("input.validateCreditCard").each(function(){if(isEmpty($(this)[0].value)){return}if(isSavedCreditCard($(this)[0].value)){removeError("creditCard",$(this))}else{$(this)[0].value=stripNonNumericCharacters($(this)[0].value);if(isValidCreditCard($(this)[0].value)){removeError("creditCard",$(this))}else{addError("creditCard",$(this))}}});return false}function noCreditCardValidation(a){if(a.find("input.selectedCreditCard:checked").length==0){addError("noCreditCard",$(this))}return false}function currencyValidation(a){a.find("input.validateCurrency").each(function(){if(isEmpty($(this)[0].value)||isValidCurrency($(this)[0].value)){removeError("currency",$(this))}else{addError("currency",$(this))}});return false}function datePickerValidation(a){a.find("input.date-pick").each(function(){if(isEmpty($(this)[0].value)||isValidDatePicked($(this)[0].value)){removeError("date",$(this))}else{addError("date",$(this))}});return false}function acceptanceValidation(a){a.find("input.validateAcceptance").each(function(){if(isAccepted($(this)[0])){removeError("acceptance",$(this));$(this).parent().removeClass("error")}else{addError("acceptance",$(this));$(this).parent().addClass("error")}});return false}function fileValidation(a){a.find("input.validateFile").each(function(){if(isValidFile($(this)[0].value)){removeError("file",$(this))}else{addError("file",$(this))}});return false}function fileTypeValidation(a){a.find("input.validateFileType").each(function(){if(isValidFileType($(this))){removeError("fileType",$(this))}else{resetErrors();addError("fileType",$(this))}});return false}function validateTextArea(a){a.find("textarea.validateTextArea").each(function(){if(isEmpty($(this)[0].value)){addError("textareaempty",$(this))}else{removeError("textareaempty",$(this))}});return false}function validateApprovee(d){var b=true;d.find("input.approveeSpendingLimit").each(function(){if(isEmpty($(this)[0].value)){addError("validateSpendingLimit",$(this));b=false}else{removeError("validateSpendingLimit",$(this));b=true}if(b){if(isValidCurrency($(this)[0].value)){removeError("currency",$(this));b=true}else{addError("currency",$(this));b=false}}return b});function a(){resetErrors();var e=validateRejectRationale($("#confirmDisable"));if(e){document.invoiceForm.Disposition.value="<%=IVGNConstants.APPROVER_FUNCTION_REJECT%>";document.invoiceForm.rejectionRationale.value=document.confirmDisable.rationale.value;document.invoiceForm.action='<%=link("partnerMkt", "ApproverPaymentProcess")%>';document.invoiceForm.submit()}else{showErrors();return e}}if(b){if($("#ApproveeSearchResults input:radio:checked").length>0){var c=$("input[name=approvee]:checked").val();d.find("input#approveeSpendingLimit").each(function(){if(isEmpty($(this)[0].value)){addError("validateSpendingLimit",$(this));b=false}else{removeError("validateSpendingLimit",$(this));b=true}if(b){if(isValidCurrency($(this)[0].value)){removeError("currency",$(this));b=true}else{addError("currency",$(this));b=false}}})}}return b}function validateProxyApprover(b){var a=true;if($("#ProxyApproverSearchResults input:radio:checked").length>0){proxyKey=$("input[name=proxy]:checked").val();b.find("input#setProxyApprover_startDate").each(function(){if(isEmpty($(this)[0].value)){addError("validateStartEndDate",$(this));a=false}else{removeError("validateStartEndDate",$(this));a=true}if(a){if(isValidDatePicked($(this)[0].value)){removeError("validateStartEndDate",$(this));a=true}else{addError("validateStartEndDate",$(this));a=false}}});b.find("input#setProxyApprover_endDate").each(function(){if(isEmpty($(this)[0].value)){addError("validateStartEndDate",$(this));a=false}else{removeError("validateStartEndDate",$(this));a=true}if(a){if(isValidDatePicked($(this)[0].value)){removeError("validateStartEndDate",$(this));a=true}else{addError("validateStartEndDate",$(this));a=false}}})}return a}function validateConfirmationEmailsForm(d){var b=true;var f;var c;var a;if($("#MyApproverSearchResults input:radio:checked").length>0){f=$("input[name=approver]:checked").val()}if($("#ApproveeSearchResults input:radio:checked").length>0){c=$("input[name=approvee]:checked").val()}if($("#ProxyApproverSearchResults input:radio:checked").length>0){a=$("input[name=proxy]:checked").val()}if((f!=undefined)&&(c!=undefined)){if(f==c){addError("validateKey_Approver_Approvee",$("#ApproveeID"));b=false}}if((f!=undefined)&&(a!=undefined)){if(f==a){addError("validateKey_Approver_Proxy",$("#ProxyID"));b=false}}if((c!=undefined)&&(a!=undefined)){if(c==a){addError("validateKey_Approvee_Proxy",$("#ProxyID"));b=false}}(function e(){var h=$("input[name=additionalApprovalEmail]").parents("span.text");emailValidation(h);if($("input[name=additionalApprovalEmail].error").length>0){$("#approveOrdersDiv").show();$("#approveOrdersIcon").attr("src","/shared-static/images/icons/contract.png");b=false}})();(function g(){var h=$("input[name=ConfEmailID1]").parents("ul.inputList");emailValidation(h);if($("input[name=ConfEmailID1].error, input[name=ConfEmailID2].error, input[name=ConfEmailID3].error").length>0){b=false}})();if(b){b=validateApprovee(d)}if(b){b=validateProxyApprover(d)}if(b){b=validateNewApproverDetails(d)}return b}function validateNewApproverDetails(b){var a=true;var c=$("#isExpanded").val();if(c=="true"){b.find("input.validateRequired").each(function(){if(isEmpty($(this)[0].value)){addError("required",$(this));a=false}else{removeError("required",$(this));a=true}});if(a){b.find("input#emailAddress").each(function(){if(!isValidEmail($(this)[0].value)){addError("email",$(this));a=false}else{removeError("email",$(this));a=true}})}if(a){b.find("input#phoneNumber").each(function(){$(this)[0].value=stripNonNumericCharacters($(this)[0].value);if(isEmpty($(this)[0].value)){addError("required",$(this));a=false}else{removeError("required",$(this));a=true}if(a){if(isValidPhone($(this)[0].value)){removeError("phone",$(this));a=true}else{addError("phone",$(this));a=false}}})}}return a}function validateRejectRationale(b){var a=false;b.find("textarea.validateRejectionRationale").each(function(){if(isEmpty($(this)[0].value)){addError("validateRejectRationale",$("#rationale"));a=false}else{removeError("validateRejectRationale",$("#rationale"));a=true}});return a}function iCardValidation(a,b){a.find("input.validateICardNumber").each(function(){if($(this)[0].value.length>0){$(this)[0].value=$.trim($(this)[0].value);if(isValidICardNumber($(this)[0].value)){removeError("iCardNumber",$(this))}else{addError("iCardNumber",$(this))}}});a.find("input.validateICardAccessCode").each(function(){if($(this)[0].value.length>0){if(isValidICardAccessCode($(this)[0].value)){removeError("iCardAccessCode",$(this))}else{addError("iCardAccessCode",$(this))}}});if($("input[name=iCardInCart]").val()=="true"){a.find("input.validateICardPromoCode").each(function(){if($(this)[0].value.length>0){$.extend(window.errors,{invalidPromoCode:"We're sorry, but the code you entered cannot be used for an order that includes a SimpleSci&trade; Card. To continue, please either delete the code or remove the SimpleSci&trade; product from your cart."});if(!$(this).val().match(/^(P|D|p|d)/)){addError("invalidPromoCode",$(this))}else{removeError("invalidPromoCode",$(this))}}});if((b=="checkout")&&$("input.acceptTermsAndConditions:checked").length==0){$.extend(window.errors,{termsAndConditions:"Please review and accept SimpleSci&trade; Terms and Conditions."});addError("termsAndConditions",$("input.acceptTermsAndConditions:checked"))}}if(a.children("td").length==0){if($(".paymentTypeICard input:radio:checked").length>0&&$(".iCard input.radio:checked").length==0){$.extend(window.errors,{noICardSelected:"Please select a payment method."});addError("noICardSelected",$(this))}}return false}function isValidPhone(a){var b=a.replace(/[\(\)\.\-\ ]/g,"");if((isNaN(parseInt(b)))&&(a.length!=0)){return false}else{return true}}function isValidEmail(b){var a=/^([a-zA-Z])+([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!a.test(b)){return false}else{return true}}function isAccepted(a){if(a.checked){return true}else{return false}}function isValidDatePicked(b){var a=/^\d{2}\/\d{2}\/\d{4}$/;if(a.test(b)){return true}else{return false}}function isValidPassword(a){if((a.length<5)||(a.length>15)){return false}else{return true}}function isValidExpirationDate(a){var b=a.parent().prev().find("select");var c=new Date();if((a[0].value<c.getFullYear())||((a[0].value==c.getFullYear())&&(b[0].value<c.getMonth()))){return false}else{return true}}function isAlphanumeric(a){if((a!="")&&!(a.match(/^[a-zA-Z0-9]+$/))){return false}else{return true}}function isValidQuantity(a){if(isEmpty(a)||!isIntegerInRange(a,1,999)){return false}else{return true}}function isValidCurrency(d){var b=stripNonCurrencyCharacters(d);var a=0;var c=d.split("");for(i=0;i<c.length;i++){if(c[i]=="."){a++}}if((d.length!=b.length)||(a>1)){return false}else{return true}}function isSavedCreditCard(d){var c=d.slice(-4);var a=d.substring(0,(d.length-4));var e=false;for(var b=0;b<a.length;b++){e=true;if(a.charAt(b)!="X"){var e=false;break}}if(isInteger(c)&&(c.length==4)&&e){return true}else{return false}}function isValidCreditCard(d){if(isEmpty(d)||!isInteger(d)||(d.length<15)||(d.length>16)){return false}else{var b=0;var c;for(var a=d.length;a>0;a--){c=parseInt(d)%10;c=parseInt(c);b+=c;a--;d=d/10;c=parseInt(d)%10;c=c*2;switch(c){case 10:c=1;break;case 12:c=3;break;case 14:c=5;break;case 16:c=7;break;case 18:c=9;break;default:c=c}d=d/10;b+=c}if((b%10)==0){return true}else{return false}}}function isValidFile(a){if(isEmpty(a)){return false}else{return true}}function isValidFileType(c){var a=c.attr("rel").split(",");var b=false;for(i=0;i<a.length;i++){if($(c).val().match("."+a[i])){b=true}}return b}function isValidICardNumber(a){if(a.match(/^\d{19,22}$/)){return true}else{return false}}function isValidICardAccessCode(a){if(a.match(/\d{6}/)&&a.length==6){return true}else{return false}}function previousInputListField(a){return a.parent().parent().prev().find("input")}function isIntegerInRange(f,d,c){if(isEmpty(f)){if(isIntegerInRange.arguments.length==1){return false}else{return(isIntegerInRange.arguments[1]==true)}}if(!isInteger(f,false)){return false}var e=parseInt(f);return((e>=d)&&(e<=c))}function isInteger(b){var a;if(isEmpty(b)){if(isInteger.arguments.length==1){return 0}else{return(isInteger.arguments[1]==true)}}for(var a=0;a<b.length;a++){var d=b.charAt(a);if(!isDigit(d)){return false}}return true}function isEmpty(a){return((a==null)||(a.length==0))}function isDigit(a){return((a>="0")&&(a<="9"))}function stripNonNumericCharacters(b){var a=new String(b);a=a.replace(/[^0-9]/g,"");return a}function stripNonCurrencyCharacters(b){var a=new String(b);a=a.replace(/[^0-9\.]/g,"");return a}function removeError(b,a){if(!(a===undefined)){if(b=="required"){a.removeClass("requiredError");a.removeClass("error")}else{if(!a.hasClass("requiredError")){a.removeClass("error")}}}}function addError(b,a){window.currentErrors[b]=true;if(!(a===undefined)){if(b=="required"){a.addClass("requiredError");a.addClass("error")}else{if(b=="invalid"){a.addClass("invalidCartID");a.addClass("error")}else{a.addClass("error")}}window.currentErrors[b]=true}}function showErrors(){var a=getPageOrModalErrorContainer();if($(a+" div.error").length==0){$(a).append('<div class="error"><ul></ul></div>')}for(code in window.errorMessages){var b=errorMessages[code];$(a+" ul").append('<li class="client" >'+errorMessagesList[b]+"</li>")}for(type in window.currentErrors){$(a+" ul").append('<li class="client" >'+errors[type]+"</li>")}if(thereAreValidationErrors()||thereAreServerErrors()){scroll(0,0);$(a).hide();if(jQuery.browser.msie){$(a).show();forceIE6Redraw()}else{$(a).fadeIn("slow")}}}function resetErrors(){var a=getPageOrModalErrorContainer();window.currentErrors=[];$(a+" li.client").remove();if($(a+" li").length==0){$(a).hide()}$(".requiredError").each(function(){$(this).removeClass("requiredError")});$("input.error").each(function(){$(this).removeClass("error")});$("select.error").each(function(){$(this).removeClass("error")});$("textarea.error").each(function(){$(this).removeClass("error")});$("div.select_error").each(function(){$(this).removeClass("select_error")})}function getPageOrModalErrorContainer(){if($(".modal").length==0){return"#pageError"}else{return"#modalError"}}function thereAreValidationErrors(){var a=false;for(type in window.currentErrors){a=true;break}if(a==true){return true}else{return false}}function thereAreServerErrors(){var a=false;for(code in window.errorMessages){a=true;break}if(a==true){return true}else{return false}}function validateLedger(a){a.find("input.validateLedger").each(function(){if(isNaN($(this)[0].value)){addError("numericCheck",$(this))}else{removeError("numericCheck",$(this))}});return false}function validateICard(b,a){var a=(a==null)?"page":a;var c="validate&checkBalance";resetErrors(a);requiredValidation(b);iCardValidation(b,c);showErrors(a);if(thereAreValidationErrors()){return false}else{return true}}function getSCIDFromName(b){var a=new Array();if(b!=""){a=b.split("_");if(a.length>0){return a[1]}}}function alphanumericValidationWithComma(b){var a=$("select#CostCenterSelected").val();b.find("select.scmsRequiedValues").each(function(){var c=$(this).attr("id");var d=getSCIDFromName(c);if(d==a){$(this).addClass("validateRequired")}else{if($(this).hasClass("validateRequired")){$(this).removeClass("validateRequired")}}});return false}function clickRadioButton(a){var c=a.length;var d=a.substring(11,c);var b="radioButton"+d;document.getElementById(b).checked=true}function validateShipto(c){var b=getPageOrModalErrorContainer();$(b+" li").remove();resetErrors(null);var a=false;if(c!="undefined"&&c!=""&&c!=null){a=true}else{addError("required",$("#shipNumber"));a=false}return a}function chkChar(a){var b=new RegExp("(?=.*[a-z])(?=.*[A-Z])");return b.test(a)}function chkSpecialChar(a){var b=new RegExp("[^a-zA-Z]");return b.test(a)};
