﻿// JScript File


//--------------------- GENERAL VALIDATION METHODS --------------------------//

var WEB_CONTROL_ERROR_CSS_CLASS = 'WebControlError';
var LABEL_ERROR_CSS_CLASS = 'LabelControlError';


function AddCssClass(element, className) 
{    
    if (!ContainsCssClass(element, className)) 
    {
        if (element.className === '') 
        {
            element.className = className;
        }
        else 
        {
            element.className += ' ' + className;
        }
    }
}

function ContainsCssClass(element, className) 
{
   var classNames = element.className.split(' ');
   for (var index = 0; index < classNames.length; index++)
   {
      if (classNames[index] == className) return true;
   }
   
   return false;
}

function RemoveCssClass(element, className) 
{    
    var currentClassName = ' ' + element.className + ' ';
    var index = currentClassName.indexOf(' ' + className + ' ');
    if (index >= 0) 
    {
        element.className = TrimString(currentClassName.substr(0, index) + ' ' + currentClassName.substring(index + className.length + 1, currentClassName.length));
    }
}

function AddOrRemoveCssClass(condition, element, className, onlyRemoveError)
{
   if (condition)
      AddCssClass(element, className);
   else
      RemoveCssClass(element, className);
}

function IsNumeric(str)
{ 
   str=str.replace(/^\s+|\s+$/g, '') ;
   if((str.length == 1 && str.match(/^\d+$/g)) || ((str.length > 1) && str.match(/^[-]{0,1}\d*[.]{0,1}\d*$/g))) return true;
   return false; 
}

function TrimString(str)
{
   var _ret = str.replace(/^\s+|\s+$/g, ''); 
   return _ret.replace(/^(\&nbsp\;)+|(\&nbsp\;)+$/g, '');
}

function AddError(condition, controlToValidateId, controlLabelId, panelErrorId, errorLabelId, errorMessage, onlyRemoveError)
{
   var controlToValidate = document.getElementById(controlToValidateId);
   var panelError = document.getElementById(panelErrorId);
   var labelError = document.getElementById(errorLabelId);
   var controlLabel = document.getElementById(controlLabelId);
   
   if (controlToValidate != null) 
   {
      if (!condition || (condition && !onlyRemoveError)) AddOrRemoveCssClass(condition, controlToValidate, WEB_CONTROL_ERROR_CSS_CLASS, onlyRemoveError);
   }
   if (controlLabel != null)
   {
      if (!condition || (condition && !onlyRemoveError)) AddOrRemoveCssClass(condition, controlLabel, LABEL_ERROR_CSS_CLASS, onlyRemoveError);
   }
   if (!condition || (condition && !onlyRemoveError)) AddOrRemoveCssClass(condition, labelError, LABEL_ERROR_CSS_CLASS, onlyRemoveError);
   
   var previousDisplayMode = panelError.style.display;
   panelError.style.display = (((condition && !onlyRemoveError) || (previousDisplayMode == "block" && condition)) ? "block" : "none");
   labelError.innerHTML = (((condition && !onlyRemoveError) || (previousDisplayMode == "block" && condition)) ? errorMessage : "");
   
   return condition;
}

function ValidateTextBoxNotEmpty(labelId, textBoxId, labelErrorId, panelErrorId, errorMessage, onlyRemoveError)
{
   var textBox = document.getElementById(textBoxId);
   var condition = (textBox.value == null) || (TrimString(textBox.value) == "");
   return !AddError(condition, textBoxId, labelId, panelErrorId, labelErrorId, errorMessage, onlyRemoveError);
}

function ValidateDropDownNotEmpty(labelId, panelDropDownId, labelErrorId, panelErrorId, errorMessage, dropDownId, onlyRemoveError)
{
   var dropDown = document.getElementById(dropDownId);
   var condition = (dropDown.value == null) || (TrimString(dropDown.value) == "");
   return !AddError(condition, panelDropDownId, labelId, panelErrorId, labelErrorId, errorMessage, onlyRemoveError);
}

function ValidateRegion(labelId, panelDropDownId, labelErrorId, panelErrorId, errorMessage, countryDropDownId, regionDropDownId, regionTextBoxId, onlyRemoveError)
{
   var countryDropDown = document.getElementById(countryDropDownId);
   var regionDropDown = document.getElementById(regionDropDownId);
   var regionTextBox = document.getElementById(regionTextBoxId);
   var condition ;
   if(TrimString(countryDropDown.value) == "United States")
   {
      condition = ((regionDropDown.value == null) || (TrimString(regionDropDown.value) == ""));
      return !AddError(condition, panelDropDownId, labelId, panelErrorId, labelErrorId, errorMessage, onlyRemoveError);
   }
   else
   {
      condition = (regionTextBox.value == null) || (TrimString(regionTextBox.value) == "");
      return !AddError(condition, regionTextBoxId, labelId, panelErrorId, labelErrorId, errorMessage, onlyRemoveError); 
   }
}

function ChangeStatesVisibility(dropCountryId, dropRegionId, textBoxRegionId)
{
   var dropCountry = document.getElementById(dropCountryId);
   var isUsaSelected = (dropCountry.options(dropCountry.selectedIndex).text == 'United States');
   
   document.getElementById(dropRegionId).style.display = (isUsaSelected ? "block" : "none");
   document.getElementById(textBoxRegionId).style.display = (!isUsaSelected ? "block" : "none");
   
   return false;
}

function ValidateMail(labelId, textBoxId, labelErrorId, panelErrorId, errorMessage, errorMessage2, onlyRemoveError)
{
	var mailTextBox = document.getElementById(textBoxId);
	var filter  = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;	
	var condition = !filter.test(mailTextBox.value)
	var condition2 = (mailTextBox.value == null) || (TrimString(mailTextBox.value) == "");
	if(condition2)
	   return !AddError(condition, textBoxId, labelId, panelErrorId, labelErrorId, errorMessage, onlyRemoveError);
	else if(condition)
	   return !AddError(condition, textBoxId, labelId, panelErrorId, labelErrorId, errorMessage2, onlyRemoveError);
	else
	   return !AddError(false, textBoxId, labelId, panelErrorId, labelErrorId, "", false);
}

function ValidateIsNumeric(labelId, textBoxId, labelErrorId, panelErrorId, errorMessage, errorMessage2, onlyRemoveError)
{
	var numericTextBox = document.getElementById(textBoxId);
	var condition = !IsNumeric(numericTextBox.value);
	var condition2 = (numericTextBox.value == null) || (TrimString(numericTextBox.value) == "");
	if(condition2)
	   return !AddError(condition, textBoxId, labelId, panelErrorId, labelErrorId, errorMessage, onlyRemoveError);
	else if(condition)
	   return !AddError(condition, textBoxId, labelId, panelErrorId, labelErrorId, errorMessage2, onlyRemoveError);
	else
	   return !AddError(false, textBoxId, labelId, panelErrorId, labelErrorId, "", false);
}

function ValidatePassword(labelId, textBoxId, labelErrorId, panelErrorId,labelId2, textBoxId2, labelErrorId2, panelErrorId2, errorMessage, errorMessage2, errorMessage3, onlyRemoveError)
{
	var passTextBox = document.getElementById(textBoxId);
	var passTextBox2 = document.getElementById(textBoxId2);
	var value1 = passTextBox.value;
	var value2 = passTextBox2.value;
	var condition = (passTextBox.value == null) || (TrimString(passTextBox.value) == "");
	var condition2 = ((passTextBox.value != null) && (TrimString(passTextBox.value) != "")) && (value1.length <=7  );
	var condition3 = ((passTextBox.value != null) && (TrimString(passTextBox.value) != "")) && (value1 != value2 );
	if(condition)
	   return !AddError(condition, textBoxId, labelId, panelErrorId, labelErrorId, errorMessage, onlyRemoveError);
	else if(condition2)
	   return !AddError(condition2, textBoxId, labelId, panelErrorId, labelErrorId, errorMessage2, onlyRemoveError);
	else if(condition3)
	   return !AddError(condition3, textBoxId, labelId, panelErrorId, labelErrorId, errorMessage3, onlyRemoveError);
	else
	   return !AddError(false, textBoxId, labelId, panelErrorId, labelErrorId, "", false);
}

//--------------------- END GENERAL METHODS ---------------------------------//


function IsEntireFormValid(payPalContributionsControls, payPallRegistrationControls, webControlErrorCssClass, labelErrorCssClass)
{
   var isValid = true;
   
   WEB_CONTROL_ERROR_CSS_CLASS = webControlErrorCssClass;
   LABEL_ERROR_CSS_CLASS = labelErrorCssClass;

   isValid = IsPayPallContributionValid(payPalContributionsControls) && isValid;
   isValid = IsPayPallRegistrationValid(payPallRegistrationControls) && isValid;
   
   return isValid;
}

function IsPayPallUserLoginControl(loginControls)
{
   var usernameTextBoxId = loginControls[0];
   var usernameLabelErrorId = loginControls[1];
   var usernamePanelErrorId = loginControls[2];
   var passwordTextBoxId = loginControls[3];
   var passwordLabelErrorId = loginControls[4];
   var passwordPanelErrorId = loginControls[5];
   
   var isValid = true;
   
   isValid = ValidateTextBoxNotEmpty(null, usernameTextBoxId, usernameLabelErrorId, usernamePanelErrorId, 'User name is required.', false) && isValid;
   isValid = ValidateTextBoxNotEmpty(null, passwordTextBoxId, passwordLabelErrorId, passwordPanelErrorId, 'Password is required.', false) && isValid;
   
   return isValid;
   
}

function IsPayPallRegistrationValid(registration)
{
   var emailLabelId = registration[0];
   var emailTextBoxId = registration[1];
   var emailLabelErrorId = registration[2];
   var emailPanelErrorId = registration[3];
   
   var passLabelId = registration[4];
   var passTextBoxId = registration[5];
   var passLabelErrorId = registration[7];
   var passPanelErrorId = registration[6];
   
   var passConfirmLabelId = registration[8];
   var passConfirmTextBoxId = registration[9];
   var passConfirmLabelErrorId = registration[11];
   var passConfirmPanelErrorId = registration[10];

   var isValid = true;
   
   isValid = ValidateMailAdress(emailLabelId, emailTextBoxId, emailLabelErrorId, emailPanelErrorId, false) && isValid;
   isValid = ValidateUserPassword(passLabelId, passTextBoxId, passLabelErrorId, passPanelErrorId,passConfirmLabelId, passConfirmTextBoxId, passConfirmLabelErrorId, passConfirmPanelErrorId, false) && isValid;
   isValid = ValidateUserConfirmationPassword(passConfirmLabelId, passConfirmTextBoxId, passConfirmLabelErrorId, passConfirmPanelErrorId,passLabelId, passTextBoxId, passLabelErrorId, passPanelErrorId, false) && isValid;
   
   return isValid;
}

function IsPayPallContributionValid(contributions)
{
   var cardHolderLabelId = contributions[0];
   var cardHolderTextBoxId = contributions[1];
   var cardHolderLabelErrorId = contributions[3];
   var cardHolderPanelErrorId = contributions[2];
   
   var cardHolderLastNameLabelId = contributions[4];
   var cardHolderLastNameTextBoxId = contributions[5];
   var cardHolderLastNameLabelErrorId = contributions[7];
   var cardHolderLastNamePanelErrorId = contributions[6];
   
   var cardTypeLabelId = contributions[8];
   var cardTypePanelId = contributions[9];
   var cardTypeDropId = contributions[10];
   var cardPanelErrorId = contributions[11];
   var cardlabelErrorId = contributions[12];
   
   var cardNumberLabelId = contributions[13];
   var cardNumberTextBoxId = contributions[14];
   var cardNumberLabelErrorId = contributions[16];
   var cardNumberPanelErrorId = contributions[15];
   
   var expirationLabelId = contributions[17];
   var expirationTextBoxId = contributions[18];
   var expirationLabelErrorId = contributions[20];
   var expirationPanelErrorId = contributions[19];
   
   var securityLabelId = contributions[21];
   var securityTextBoxId = contributions[22];
   var securityLabelErrorId = contributions[24];
   var securityPanelErrorId = contributions[23];
   
   var streetLabelId = contributions[25];
   var streetTextBoxId = contributions[26];
   var streetLabelErrorId = contributions[28];
   var streetPanelErrorId = contributions[27];
   
   var cityLabelId = contributions[29];
   var cityTextBoxId = contributions[30];
   var cityLabelErrorId = contributions[32];
   var cityPanelErrorId = contributions[31];
   
   var countryLabelId = contributions[33];
   var countryPanelId = contributions[34];
   var countryDropId = contributions[35];
   var countryPanelErrorId = contributions[36];
   var countryLabelErrorId = contributions[37];
   
   var regionLabelId = contributions[38];
   var regionPanelDropId = contributions[39];
   var regionDropId = contributions[40];
   var regionTextBoxId = contributions[41];
   var regionLabelErrorId = contributions[43];
   var regionPanelErrorId = contributions[42];
   
   var zipLabelId = contributions[44];
   var zipTextBoxId = contributions[45];
   var zipLabelErrorId = contributions[47];
   var zipPanelErrorId = contributions[46];
   
   var yearLabelId = contributions[48];
   var yearTextBoxId = contributions[49];
   var yearLabelErrorId = contributions[51];
   var yearPanelErrorId = contributions[50];
   
   var amountLabelId = contributions[52];
   var amountTextBoxId = contributions[53];
   var amountLabelErrorId = contributions[55];
   var amountPanelErrorId = contributions[54];
     

   var isValid = true;
   
   isValid = ValidatePayPalContributionFirstNameTextBox(cardHolderLabelId, cardHolderTextBoxId, cardHolderLabelErrorId, cardHolderPanelErrorId, false) && isValid;
   isValid = ValidatePayPalContributionFirstNameTextBox(cardHolderLastNameLabelId, cardHolderLastNameTextBoxId, cardHolderLastNameLabelErrorId, cardHolderLastNamePanelErrorId, false) && isValid;
   isValid = ValidatePayPalContributionCardType(cardTypeLabelId, cardTypePanelId, cardlabelErrorId, cardPanelErrorId, cardTypeDropId, false) && isValid;
   isValid = ValidatePayPalContributionCardNumberTextBox(cardNumberLabelId, cardNumberTextBoxId, cardNumberLabelErrorId, cardNumberPanelErrorId, false) && isValid;
   isValid = ValidatePayPalContributionExpirationTextBox(expirationLabelId, expirationTextBoxId,expirationLabelErrorId,expirationPanelErrorId, false) && isValid;
   
   isValid = ValidatePayPalContributionSecurityCodeTextBox(securityLabelId, securityTextBoxId,securityLabelErrorId,securityPanelErrorId, false) && isValid;
   isValid = ValidatePayPalAmount(amountLabelId, amountTextBoxId, amountLabelErrorId, amountPanelErrorId, false) && isValid;
   isValid = ValidatePayPalContributionStreetTextBox(streetLabelId, streetTextBoxId,streetLabelErrorId,streetPanelErrorId, false) && isValid;
   isValid = ValidatePayPalContributionCityTextBox(cityLabelId, cityTextBoxId,cityLabelErrorId,cityPanelErrorId, false) && isValid;
   isValid = ValidatePayPalContributionCountry(countryLabelId, countryPanelId, countryLabelErrorId, countryPanelErrorId, countryDropId, regionDropId, regionTextBoxId, false) && isValid;
   isValid = ValidatePayPalContributionRegion(regionLabelId, regionPanelDropId, regionLabelErrorId, regionPanelErrorId, countryDropId, regionDropId, regionTextBoxId, false) && isValid;
   isValid = ValidatePayPalContributionPostCodeTextBox(zipLabelId, zipTextBoxId,zipLabelErrorId,zipPanelErrorId, false) && isValid;
   isValid = ValidatePayPalContributionYearTextBox(yearLabelId, yearTextBoxId,yearLabelErrorId,yearPanelErrorId, false) && isValid;
   return isValid;

} 

function SetErrorLabel(scholarshipApplicationControls, isValid)
{
   var errorLabelId = scholarshipApplicationControls[0];
   var errorLabel = document.getElementById(errorLabelId); 
   if(!isValid)
   {
      var message = "There is a problem with your application.";
      message += "<br />Please review the application for error messages highlighted in red. Thank you." ;
      errorLabel.innerHTML = message;
      errorLabel.style.display = "block";
   }
   else
   {
      errorLabel.innerHTML = "Updating...";
      errorLabel.style.display = "block";
   }   
   AddOrRemoveCssClass(!isValid, errorLabel, LABEL_ERROR_CSS_CLASS, false);
}


//--------------------- VALIDATION METHODS FOR TEXT BOXES -------------------//

function ValidatePayPalContributionFirstNameTextBox(textBoxFirstNameLabelId, textBoxFirstNameId,textBoxFirstNameLabelErrorId,textBoxFirstNamePanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxFirstNameLabelId, textBoxFirstNameId, textBoxFirstNameLabelErrorId, textBoxFirstNamePanelErrorId, "'First name' field is required", onlyRemoveError);
}

function ValidatePayPalContributionLastNameTextBox(textBoxLastNameLabelId, textBoxLastNameId,textBoxLastNameLabelErrorId,textBoxLastNamePanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxLastNameLabelId, textBoxLastNameId, textBoxLastNameLabelErrorId, textBoxLastNamePanelErrorId, "'Last Name' field is required", onlyRemoveError);
}

function ValidatePayPalContributionCardNumberTextBox(textBoxCardNumberLabelId, textBoxCardNumberId,textBoxCardNumberLabelErrorId,textBoxCardNumberPanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxCardNumberLabelId, textBoxCardNumberId, textBoxCardNumberLabelErrorId, textBoxCardNumberPanelErrorId, "'Card Number' field is required", onlyRemoveError);
}

function ValidatePayPalContributionExpirationTextBox(textBoxExpirationLabelId, textBoxExpirationId,textBoxExpirationLabelErrorId,textBoxExpirationPanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxExpirationLabelId, textBoxExpirationId, textBoxExpirationLabelErrorId, textBoxExpirationPanelErrorId, "'Expiration month' field is required", onlyRemoveError);
}

function ValidatePayPalContributionYearTextBox(textBoxExpirationLabelId, textBoxExpirationId,textBoxExpirationLabelErrorId,textBoxExpirationPanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxExpirationLabelId, textBoxExpirationId, textBoxExpirationLabelErrorId, textBoxExpirationPanelErrorId, "'Expiration year' field is required", onlyRemoveError);
}

function ValidatePayPalContributionStreetTextBox(textBoxStreetLabelId, textBoxStreetId, textBoxStreetLabelErrorId, textBoxStreetPanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxStreetLabelId, textBoxStreetId, textBoxStreetLabelErrorId, textBoxStreetPanelErrorId, "'Street' field is required", onlyRemoveError);
}

function ValidatePayPalContributionCityTextBox(textBoxCityLabelId, textBoxCityId,textBoxCityLabelErrorId,textBoxCityPanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxCityLabelId, textBoxCityId, textBoxCityLabelErrorId, textBoxCityPanelErrorId, "'City' field is required", onlyRemoveError);
}

function ValidatePayPalContributionCountry(countryLabelId, countryPanelId, countryLabelErrorId, countryPanelErrorId, countryDropDownId, regionDropDownId, regionTextBoxId, onlyRemoveError)
{
   ChangeStatesVisibility(countryDropDownId, regionDropDownId, regionTextBoxId);
   return ValidateDropDownNotEmpty(countryLabelId, countryPanelId, countryLabelErrorId, countryPanelErrorId, "'Country' field is required", countryDropDownId, onlyRemoveError);
}

function ValidatePayPalContributionPostCodeTextBox(textBoxPostCodeLabelId, textBoxPostCodeId, textBoxPostCodeLabelErrorId, textBoxPostCodePanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxPostCodeLabelId, textBoxPostCodeId, textBoxPostCodeLabelErrorId, textBoxPostCodePanelErrorId, "'Zip/Postcode' field is required", onlyRemoveError);
}

function ValidatePayPalContributionCardType(cardTypeLabelId, cardTypePanelId, cardTypeLabelErrorId, cardTypePanelErrorId, cardTypeDropDownId, onlyRemoveError)
{
   return ValidateDropDownNotEmpty(cardTypeLabelId, cardTypePanelId, cardTypeLabelErrorId, cardTypePanelErrorId, "'Card Type' field is required", cardTypeDropDownId, onlyRemoveError);
}

function ValidatePayPalContributionRegion(regionLabelId, regionPanelId, regionLabelErrorId, regionPanelErrorId, countryDropDownId, regionDropDownId, regionTextBoxId, onlyRemoveError)
{
   return ValidateRegion(regionLabelId, regionPanelId, regionLabelErrorId, regionPanelErrorId, "'State/Region' field is required", countryDropDownId, regionDropDownId, regionTextBoxId, onlyRemoveError);
}

function ValidatePayPalContributionSecurityCodeTextBox(textBoxSecurityCodeLabelId, textBoxSecurityCodeId, textBoxSecurityCodeLabelErrorId, textBoxSecurityCodePanelErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(textBoxSecurityCodeLabelId, textBoxSecurityCodeId, textBoxSecurityCodeLabelErrorId, textBoxSecurityCodePanelErrorId, "'Security Code' field is required", onlyRemoveError);
}

function ValidatePayPalContributionSum(labelContributionSumId, textBoxContributionSumId, labelContributionSumErrorId, panelContributionSumErrorId, onlyRemoveError)
{
   return ValidateTextBoxNotEmpty(labelContributionSumId, textBoxContributionSumId, labelContributionSumErrorId, panelContributionSumErrorId, "'Contribution Sum' field is required", onlyRemoveError);
}

//-----Contribution Ammount Confirmation

function ValidatePayPalAmount(labelAmountId, textBoxAmountId, labelAmountErrorId, panelAmountErrorId, onlyRemoveError)
{
//   return ValidateTextBoxNotEmpty(labelAmountId, textBoxAmountId, labelAmountErrorId, panelAmountErrorId, "'Amount' field is required", onlyRemoveError);
     return ValidateIsNumeric(labelAmountId, textBoxAmountId, labelAmountErrorId, panelAmountErrorId, "'Amount' field is required", "'Amount' field is numeric" , onlyRemoveError);
}

function ValidatePayPalRecurringOptions(labelOptionsId, dropOptionsId, labelOptionsErrorId, panelOptionsErrorId, panelErrorId, onlyRemoveError)
{

   return ValidateDropDownNotEmpty(labelOptionsId, panelErrorId, labelOptionsErrorId, panelOptionsErrorId, "'Recurring Options' field is required", dropOptionsId, onlyRemoveError);
}

function ValidateMailAdress(labelAmountId, textBoxAmountId, labelAmountErrorId, panelAmountErrorId, onlyRemoveError)
{
   return  ValidateMail(labelAmountId, textBoxAmountId, labelAmountErrorId, panelAmountErrorId, "The Email Address field is required", "Please enter a valid email address ", onlyRemoveError);
}

//function ValidatePassword(labelOPassId, textBoxPassId, labelPassErrorId, panelPassErrorId, onlyRemoveError)
//{
//   //return ValidateTextBoxNotEmpty(labelOPassId, textBoxPassId, labelPassErrorId, panelPassErrorId, "'Password' field is required", onlyRemoveError);
//   
//}
function ValidateUserPassword(labelId, textBoxId, labelErrorId, panelErrorId,labelId2, textBoxId2, labelErrorId2, panelErrorId2, onlyRemoveError)
{
   return ValidatePassword(labelId, textBoxId, labelErrorId, panelErrorId,labelId2, textBoxId2, labelErrorId2, panelErrorId2, "'Password ' field is required", "Password' field must must have minimum 8  characters ","'Password ' field must be identic with Password Confirmation' field is required", onlyRemoveError);
}

//function ValidateConfirmationPassword(labelOPassId, textBoxPassId, labelPassErrorId, panelPassErrorId, onlyRemoveError)
//{
//   return ValidateTextBoxNotEmpty(labelOPassId, textBoxPassId, labelPassErrorId, panelPassErrorId, "'Password Confirmation' field is required", onlyRemoveError);
//}

function ValidateUserConfirmationPassword(labelId, textBoxId, labelErrorId, panelErrorId,labelId2, textBoxId2, labelErrorId2, panelErrorId2, onlyRemoveError)
{
   return ValidatePassword(labelId, textBoxId, labelErrorId, panelErrorId,labelId2, textBoxId2, labelErrorId2, panelErrorId2, "'Password Confirmation' field is required", "Password Confirmation' field must must have minimum 8 characters ","'Password Confirmation' field must be identic with Password' field is required", onlyRemoveError);
}


//--------------------------------- END OF VALIDATION METHODS ------------------------------//

