//Javascript Document
 
/**************** script validation ***************/

/* To load date values into dropdown boxes*/
var monthtext = ['MM','01','02','03','04','05','06','07','08','09','10','11','12'];
 
function populatedateOfBirth(birthDay, birthMonth, birthYear){
	
var today=new Date()
var birthDay=document.getElementById(birthDay)
var birthMonth=document.getElementById(birthMonth)
var birthYear=document.getElementById(birthYear)

     
document.personalinfo.birthDay.options[0]=new Option('DD', 'DD', true, true) //select today's day
var k =0 
var dayText = "";
for (var i=0; i<31; i++){
 k++;
 
 if(i < 9){
    dayText = "0" + (i+1);
 }else{
 
    dayText = i+1;
 }
document.personalinfo.birthDay.options[k]=new Option(dayText, dayText)
}
 
for (var m=0; m<13; m++)
	document.personalinfo.birthMonth.options[m]=new Option(monthtext[m], monthtext[m])
	 
	var thisyear= 1930;
	document.personalinfo.birthYear.options[0]=new Option('YYYY', 'YYYY');
		for (var y=1; y<=79; y++){
		document.personalinfo.birthYear.options[y]=new Option(thisyear, thisyear)
		thisyear+=1
		}
	 

}
/* End load date values into dropdown boxes*/


 
function GetRequestType()
{
// added new request types on 210709
 if (document.personalinfo.RequestType.value == "Charges clarifications")
    {
        document.getElementById("Chargesclarifications").style.display = "block";
    }
  else{
        document.getElementById("Chargesclarifications").style.display = "none";
  }
  
  if (document.personalinfo.RequestType.value == "Credit Limit related")
    {
        document.getElementById("Creditlimitrelated").style.display = "block";
    }
  else{
        document.getElementById("Creditlimitrelated").style.display = "none";
  }
  
  if (document.personalinfo.RequestType.value == "Trouble on net banking / Phone banking")
    {
        document.getElementById("Trouble").style.display = "block";
    }
  else{
        document.getElementById("Trouble").style.display = "none";
  }
  
  if (document.personalinfo.RequestType.value == "Offer / Promotion related")
    {
        document.getElementById("Offer").style.display = "block";
    }
  else{
        document.getElementById("Offer").style.display = "none";
  }
  
  
  
  // end for new request types

 /* if (document.personalinfo.RequestType.value == "Credit Card Statement")
    {
        document.getElementById("CreditCardStatement").style.display = "block";
    }
  else{
        document.getElementById("CreditCardStatement").style.display = "none";
  }
      
  if (document.personalinfo.RequestType.value == "Forms")
    {
      document.getElementById("Frms").style.display = "block";
    }
  else
    {
      document.getElementById("Frms").style.display = "none";
    }
      
  if (document.personalinfo.RequestType.value == "LimitEnhancement")
    {
      document.getElementById("LimitEnhancement").style.display = "block";
    }
  else
    {
      document.getElementById("LimitEnhancement").style.display = "none";
    }*/
      
  if (document.personalinfo.RequestType.value == "Payment related")
    {
      document.getElementById("PaymentRelated").style.display = "block";
    }
  else{
      document.getElementById("PaymentRelated").style.display = "none";
  }
      
  if (document.personalinfo.RequestType.value == "Transaction related")
    {
      document.getElementById("Transactionrelated").style.display = "block";
    }
  else
    {
      document.getElementById("Transactionrelated").style.display = "none";
    }
      
 /* if (document.personalinfo.RequestType.value == "Balance Transfer Status")
    {
      document.getElementById("BalanceTransfer").style.display = "block";
    }
  else
    {
      document.getElementById("BalanceTransfer").style.display = "none";
    }*/
     
  if (document.personalinfo.RequestType.value == "Application Status")
    {
	  populatedateOfBirth(document.getElementById("birthDay"), document.getElementById("birthMonth"),document.getElementById("birthYear"));
      document.getElementById("ApplicationStatus").style.display = "block";
    }
  else
    {
      document.getElementById("ApplicationStatus").style.display = "none";
    }
      
  if (document.personalinfo.RequestType.value == "Others")
    {
      document.getElementById("Othr").style.display = "block";
    }
  else{
      document.getElementById("Othr").style.display = "none";
  }

  //START ADDED FOR FFEDBACK AND SUGGETIONS
		
  if (document.personalinfo.RequestType.value == "Feedback And Suggetions")
    {
        document.getElementById("Feedback").style.display = "block";
    }
  else{
        document.getElementById("Feedback").style.display = "none";
  }
  //END ADDED FOR FFEDBACK AND SUGGETIONS
}
function GetCreditCardStatement()
{
  if (document.personalinfo.CCS.value == "PhysicalStatementRequest")
    {
        document.getElementById("PhysicalStatementRequest").style.display = "block";
    }
  else
    {
      document.getElementById("PhysicalStatementRequest").style.display = "none";
    }
      
  if (document.personalinfo.CCS.value == "InterestCalculationWorksheet"){
        document.getElementById("InterestCalculationWorksheet").style.display = "block";
  }
  else{
      document.getElementById("InterestCalculationWorksheet").style.display = "none";
  }
      
  if (document.personalinfo.CCS.value == "Others"){
        document.getElementById("Othrs").style.display = "block";
  }
  else{
      document.getElementById("Othrs").style.display = "none";
  }
}
function displayWatch(val)
{     
    if (val == "8500" || val == "12000")
    {
          document.getElementById("divTwo1").style.display = "block";     
    }
    else{
         
        document.getElementById("divTwo1").style.display = "none";
    }     
}
 
function customer(RequestType){

//if(document.personalinfo.Customer.value == "Yes"){
   
  //  document.getElementById("kotakCustomer").style.display = "block";
 
    document.personalinfo.RequestType.length = 0;
 
    document.personalinfo.RequestType.options[0]=new Option('select','0');
    document.personalinfo.RequestType.options[1]=new Option('Payment related','Payment related');
    document.personalinfo.RequestType.options[2]=new Option('Charges clarifications','Charges clarifications');
    document.personalinfo.RequestType.options[3]=new Option('Credit Limit related','Credit Limit related');
    document.personalinfo.RequestType.options[4]=new Option('Transaction related','Transaction related');
    document.personalinfo.RequestType.options[5]=new Option('Trouble on net banking / Phone banking','Trouble on net banking / Phone banking');
    document.personalinfo.RequestType.options[6]=new Option('Offer / Promotion related','Offer / Promotion related');
	document.personalinfo.RequestType.options[7]=new Option('Others','Others');
	 GetRequestType();
	 
	 
	//document.personalinfo.RequestType.options[3]=new Option('Limit Enhancement','LimitEnhancement');
   // document.personalinfo.RequestType.options[2]=new Option('Payment Status','Payment Status');
	 //document.personalinfo.RequestType.options[3]=new Option('Transaction Dispute Status','Transaction Dispute Status');
	//START ADDED FOR FFEDBACK AND SUGGETIONS
	//document.personalinfo.RequestType.options[5]=new Option('Feedback & Suggestion','Feedback And Suggetions');
	//END ADDED FOR FFEDBACK AND SUGGETIONS

    
     
}
 
/*if(document.personalinfo.Customer.value == "No"){
   
    document.getElementById("kotakCustomer").style.display = "none";
     
  document.personalinfo.RequestType.length = 0;
    document.personalinfo.RequestType.options[0]=new Option('select','0');
  document.personalinfo.RequestType.options[1]=new Option('Application Status','Application Status');
	
	START ADDED FOR FFEDBACK AND SUGGETIONS
	document.personalinfo.RequestType.options[1]=new Option('Feedback & Suggestion','Feedback And Suggetions');
	END ADDED FOR FFEDBACK AND SUGGETIONS

    document.personalinfo.RequestType.options[2]=new Option('Others','Others');
    GetRequestType();
}*/
  /* if(document.personalinfo.Customer.value == ""){

        document.getElementById("kotakCustomer").style.display = "none";
         
        document.personalinfo.RequestType.length = 0;
        document.personalinfo.RequestType.options[0]=new Option('select','0');
        GetRequestType();
}
 
}*/
 
 
function clearTextformail(obj) {
        obj.value = "";
        obj.style.color ="#000000";
    }
 
function showHelpMail(obj){
    clearTextformail(obj);
    showHelp(obj);
}
 
 
/*this function used to bring back the normal border*/
 
function clearBorderMail(obj){
obj.style.border = "2px inset ActiveBorder";
}
/*End function used to bring back the normal border*/
 
 
/* Start Date Validation */


var severDate = dateToday.split("/");
var sereverDateFormat = new Date(severDate[2],(severDate[1]-1),severDate[0]);
 
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
 
function isInteger(s){
    var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
 
function stripCharsInBag(s, bag){
    var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}
 
function daysInFebruary (year){
    // February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
    for (var i = 1; i <= n; i++) {
        this[i] = 31
        if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
        if (i==2) {this[i] = 29}
   } 
   return this
}
 
function isDatevalidate(dtStr){
    var daysInMonth = DaysArray(12)
    var pos1=dtStr.indexOf(dtCh)
    var pos2=dtStr.indexOf(dtCh,pos1+1)
    var strDay=dtStr.substring(0,pos1)
    var strMonth=dtStr.substring(pos1+1,pos2)
    var strYear=dtStr.substring(pos2+1)
    strYr=strYear
    if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
    if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
    for (var i = 1; i <= 3; i++) {
        if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
    }
    month=parseInt(strMonth)
    day=parseInt(strDay)
    year=parseInt(strYr)
    if (pos1==-1 || pos2==-1){
        alert("the date format should be : dd mm yyyy")
        return false
    }
    if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
        alert("please enter a valid day")
        return false
    }
 
    if (strMonth.length<1 || month<1 || month>12){
        alert("please enter a valid month")
        return false
    }
     
    if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
        alert("please enter a valid 4 digit year")
        return false
    }
    if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
        alert("please enter a valid date")
        return false
    }

    if(isDatevalidateServer(dtStr) == false){
        return false;
    }
}

 
/* End Date Validation*/

/* Date validation using Server date */
 
 
 
function isDatevalidateServer(dtStr){
    var dateToValidate = dtStr.split("/");
    var previousDate = new Date(dateToValidate[2],(dateToValidate[1]-1),dateToValidate[0]);

    var difference = sereverDateFormat.getTime() - previousDate.getTime();

    var daysDiff = Math.floor(difference/1000/60/60/24);
    difference = daysDiff*1000*60*60*24;

    if(difference < 0){
        alert("please check the date you have entered");
        return false;
    }

}

/* End Of Date validation from the server side */
 
function emailInfo(){


if(!flagDisbale)
return false;
   

/* Starts validation for Name  */
var nameRegEx = /^([a-zA-Z ])*$/;
var candidateFName = document.personalinfo.firstName.value;
var candidateMName = document.personalinfo.secondName.value;
var candidateLName = document.personalinfo.lastName.value;



if((nameRegEx.test(candidateFName)==false)||(candidateFName == "First")||(candidateFName.length < 3)){
    alert("please enter your first name");
    document.personalinfo.firstName.style.border = "2px solid red";
    return false;
}
    if(candidateFName.length > 100){
   
    alert("please enter your first name without exceeding 100 characters");
        document.personalinfo.firstName.style.border = "2px solid red";
        return false;
}

if(candidateMName.length > 100){
    alert("please enter your middle name without exceeding 100 characters");
    document.personalinfo.secondName.style.border = "2px solid red";
    return false;
}

if((nameRegEx.test(candidateLName)==false)||(candidateLName == "Last")||(candidateLName.length < 1)){
    alert("please enter your last name");
    document.personalinfo.lastName.style.border = "2px solid red";
    return false;
}

    if(candidateLName.length > 100){
        alert("please enter your last name without exceeding 100 characters");
            document.personalinfo.lastName.style.border = "2px solid red";
            return false;
    }
/* Ends validation for Name  */


 
/* Start validation for Contact Nos*/
 
var mobileRegExp = /^([0-9])*$/
var contactRegExp = /^\d+(\-\d+)?$/
var ContactNumb = document.personalinfo.ContactNumb.value;
var ContactStdCode = document.personalinfo.ContactStdCode.value;
 

if((ContactStdCode == null) ||(ContactStdCode.length < 1)){
    alert("please enter a valid std number");
    document.personalinfo.ContactStdCode.style.border = "2px solid red";
    return false;
}

if(mobileRegExp.test(ContactStdCode) == false){
    alert("please enter a valid std number, with digits only");
    document.personalinfo.ContactStdCode.style.border = "2px solid red";
    return false;
}


if((ContactNumb == null) ||(ContactNumb.length < 1)){
    alert("please enter a valid contact number");
    document.personalinfo.ContactNumb.style.border = "2px solid red";
    return false;
}


 
if(mobileRegExp.test(ContactNumb)==false){
    alert("please enter a valid contact number");
    document.personalinfo.ContactNumb.style.border = "2px solid red";
    return false;
}
 
 
    if(mobileRegExp.test(ContactNumb) == false){
        alert("please enter your contact number");
        document.personalinfo.ContactNumb.style.border = "2px solid red";
        return false;
    }


    if(ContactNumb.length > 10){
        alert("please enter your contact number without exceeding 10 digit");
        document.personalinfo.ContactNumb.style.border = "2px solid red";
        return false;
    }
 
/* End validation for Contact Nos*/
 

/*Start validation for Email*/
    var emailid = document.personalinfo.emailid.value;

    if((emailid.indexOf("--") != -1)||(emailid.indexOf("..") !== -1)||(emailid.indexOf("__") !== -1)||(emailid.indexOf("++") !== -1)){
        alert("please enter a valid email-id");
        document.personalinfo.emailid.style.border = "2px solid red";
        return false;
        }

    var emailIDRegEx = /^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/
  
    if(emailIDRegEx.test(emailid)==false){
        alert("please enter a valid email-id");
        document.personalinfo.emailid.style.border = "2px solid red";
        return false;
    }
/*End validation for Email*/

/*Start Validation for card number/CNR no if Exsist*/
   

        var cnrRegExp = /^([0-9]){1,16}$/
        var cardnumber = document.personalinfo.Cardnumb.value;

        if((cnrRegExp.test(cardnumber)==false)||(cardnumber.length < 1)){
            alert("please enter a valid card/CRN number");
            document.personalinfo.Cardnumb.style.border = "2px solid red";
            return false;
        }
  
  
    //End of validation if Customer is yes
/*End Validation for CNR no if Exsist*/


 
/* Request type*/
 
var requestType = document.personalinfo.RequestType.value;

 
/*Start validation for CreditCardStatement*/
if(requestType == "Credit Card Statement"){
var subcreditcardStatement = document.personalinfo.CCS.value;

if (subcreditcardStatement == 0)
{
        alert("Please select type of credit card Statement");
        //document.personalinfo.CCS.style.border = "2px solid red";
        return false;
}

 
 if(subcreditcardStatement == "PhysicalStatementRequest"){
     
    var phyStatReqDD = document.personalinfo.phyStatReqDD.value;
    var phyStatReqMM = document.personalinfo.phyStatReqMM.value;
    var phyStatReqYYYY =  document.personalinfo.phyStatReqYYYY.value;
 
    var phyStatReqdt= phyStatReqDD+"/"+phyStatReqMM+"/"+phyStatReqYYYY;
 
    /*if(((phyStatReqDD == "DD")&&(phyStatReqMM == "MM")&&(phyStatReqYYYY == "YYYY"))||((phyStatReqDD == "")&&(phyStatReqMM == "")&&(phyStatReqYYYY == ""))){
     
    }else{     
        if (isDatevalidate(phyStatReqdt)==false){
            return false;
        }
    }*/

    if (isDatevalidate(phyStatReqdt)==false){
            return false;
    }
 }
 
if(subcreditcardStatement == "InterestCalculationWorksheet"){
 
    var intCalcWorksheetDD = document.personalinfo.intCalcWorksheetDD.value;
    var intCalcWorksheetMM = document.personalinfo.intCalcWorksheetMM.value;
    var intCalcWorksheetYYYY = document.personalinfo.intCalcWorksheetYYYY.value;
 
    var intCalcWorksheetdt = intCalcWorksheetDD+"/"+intCalcWorksheetMM+"/"+intCalcWorksheetYYYY;
 
    /*if(((intCalcWorksheetDD == "DD")&&(intCalcWorksheetMM == "MM")&&(intCalcWorksheetYYYY == "YYYY"))||((intCalcWorksheetDD == "")&&(intCalcWorksheetMM == "")&&(intCalcWorksheetYYYY == ""))){
     
    }else{
        if (isDatevalidate(intCalcWorksheetdt)==false){
            return false;
        }
    }*/

        if (isDatevalidate(intCalcWorksheetdt)==false){
            return false;
        }
}
 
    if(subcreditcardStatement == "Others"){
        var othersubcreditcardStatement = document.personalinfo.creditCardStatemenOthers.value;

        if(othersubcreditcardStatement.length < 1){
            alert("please enter your message without exceeding 255 characters");
            document.personalinfo.creditCardStatemenOthers.style.border = "2px solid red";
            return false;
            }
 
        if(othersubcreditcardStatement.length > 255){
            alert("please enter your message without exceeding 255 characters");
            document.personalinfo.creditCardStatemenOthers.style.border = "2px solid red";
            return false;
            }
    }
    
    
    
    
    
}
/* End of validation for Credit Card Statement */
 
/*Start validation for Forms */
if (document.personalinfo.RequestType.value == "Forms"){
     
           if(document.personalinfo.emailForms.value == 0){
                 alert("Please select type of Forms");
                 return false;
             }
 
    var emailFormsOthers = document.personalinfo.emailFormsOthers.value;
         
        if(emailFormsOthers.length > 255){
            alert("please enter your message without exceeding 255 characters");
            document.personalinfo.emailFormsOthers.style.border = "2px solid red";
            return false;
            }
     
    }
/*End validation for Forms */
 
/*Start validation for LimitEnhancement*/
if (document.personalinfo.RequestType.value == "LimitEnhancement"){
 
    var emailLimitEnhancementOthers = document.personalinfo.LimitedEnchancementOthers.value;
       
        if(emailLimitEnhancementOthers.length < 1){
            alert("please enter message without exceeding 255 characters");
            document.personalinfo.LimitedEnchancementOthers.style.border = "2px solid red";
            return false;
            }       
                   
 
        if(emailLimitEnhancementOthers.length > 255){
            alert("please enter message without exceeding 255 characters");
            document.personalinfo.LimitedEnchancementOthers.style.border = "2px solid red";
            return false;
            }
     
}
/*End validation for LimitEnhancement*/
 
/*Start Validation for Payment related*/
if (document.personalinfo.RequestType.value == "Payment related"){
    var modePaymentRelated = document.personalinfo.modePayment.value;

    if(modePaymentRelated.length < 1){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modePayment.style.border = "2px solid red";
        return false;
        }
     
    if(modePaymentRelated.length > 255){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modePayment.style.border = "2px solid red";
        return false;
        }
 
}
/*End  Validation for PaymentRelated*/

// added for new request types on 210709
/*Start Validation for Charges Clarifications*/

if (document.personalinfo.RequestType.value == "Charges clarifications"){
    var modeChargesClarifications = document.personalinfo.modeCharges.value;

    if(modeChargesClarifications.length < 1){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modeCharges.style.border = "2px solid red";
        return false;
        }
     
    if(modeChargesClarifications.length > 255){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modeCharges.style.border = "2px solid red";
        return false;
        }
 
}
/*End  Validation for Charges Clarifications*/

/*Start Validation for Credit Limit related*/

if (document.personalinfo.RequestType.value == "Credit Limit related"){
    var modeCreditlimit = document.personalinfo.modeCredit.value;

    if(modeCreditlimit.length < 1){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modeCredit.style.border = "2px solid red";
        return false;
        }
     
    if(modeCreditlimit.length > 255){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modeCredit.style.border = "2px solid red";
        return false;
        }
 
}
/*End  Validation for Credit Limit related*/

/*Start Validation for Trouble on net banking / Phone banking*/

if (document.personalinfo.RequestType.value == "Trouble on net banking / Phone banking"){
    var modeTroubleBanking = document.personalinfo.modeTrouble.value;

    if(modeTroubleBanking.length < 1){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modeTrouble.style.border = "2px solid red";
        return false;
        }
     
    if(modeTroubleBanking.length > 255){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modeTrouble.style.border = "2px solid red";
        return false;
        }
 
}
/*End  Validation for Trouble on net banking / Phone banking*/ 


/*Start Validation for Offer / Promotion related*/

if (document.personalinfo.RequestType.value == "Offer / Promotion related"){
    var modeOfferPromotion = document.personalinfo.modeOffer.value;

    if(modeOfferPromotion.length < 1){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modeOffer.style.border = "2px solid red";
        return false;
        }
     
    if(modeOfferPromotion.length > 255){
        alert("please enter your message without exceeding 255 characters");
        document.personalinfo.modeOffer.style.border = "2px solid red";
        return false;
        }
 
}
/*End  Validation for Offer / Promotion relatedg*/ 
  
 
 
/*Validation for Transaction related*/
if (document.personalinfo.RequestType.value == "Transaction related"){
 
    var transactionDD = document.personalinfo.transactionDD.value;
    var transactionMM = document.personalinfo.transactionMM.value;
    var transactionYYYY = document.personalinfo.transactionYYYY.value;
 
    var transactiondate  = transactionDD+"/"+transactionMM+"/"+transactionYYYY;
 
    /*if(((transactionDD == "DD")&&(transactionMM == "MM")&&(transactionYYYY == "YYYY"))||((transactionDD == "")&&(transactionMM == "")&&(transactionYYYY == ""))){
    // skip validation
     
    }else{     
        if (isDatevalidate(transactiondate)==false){
            return false;
            }
    }*/

        if (isDatevalidate(transactiondate)==false){
            return false;
            }


    var TansactionAmt = document.personalinfo.TansactionAmt.value;
       var MerchantName =  document.personalinfo.MerchantName.value;


    var tansactionAmtRegExp = /^([0-9])*$/

    if((TansactionAmt == "Transaction Amount")||(TansactionAmt == "")) {
               alert("Please enter the transaction amount");
               document.personalinfo.TansactionAmt.style.border = "2px solid red";
               return false;
    }

           

    if(tansactionAmtRegExp.test(TansactionAmt) == false){
        alert("please enter the transaction amount, with digits only");
        document.personalinfo.TansactionAmt.style.border = "2px solid red";
        return false;
        }   

    if(TansactionAmt.length > 10){

        alert("please enter the transaction amount, without exceeding 10 digits");
        document.personalinfo.TansactionAmt.style.border = "2px solid red";
        return false;
        }
   
   

    var merchantnameRegExp = /^([a-zA-Z .])*$/
           var merchantName = document.personalinfo.MerchantName.value;
   
    if((merchantName == "Merchant Name")||(merchantName == "")) {
               alert("please enter a valid merchants name");
                   document.personalinfo.MerchantName.style.border = "2px solid red";
                       return false;
    }
          
   
               if((merchantnameRegExp.test(merchantName)==false)||(merchantName.length < 1)||(merchantName.length  > 19)){
                       alert("please enter a valid merchants name");
                   document.personalinfo.MerchantName.style.border = "2px solid red";
                       return false;
               }
     
 
 
    var disputeDD = document.personalinfo.disputeDD.value;
    var disputeMM = document.personalinfo.disputeMM.value;
    var disputeYYYY = document.personalinfo.disputeYYYY.value;
 
    var disputedate = disputeDD+"/"+disputeMM+"/"+disputeYYYY;
/*
    if(((disputeDD == "DD")&&(disputeMM == "MM")&&(disputeYYYY == "YYYY")) ||((disputeDD == "")&&(disputeMM == "")   
    &&(disputeYYYY == ""))){
 
// skip validation
     
    }
else{
    if (isDatevalidate(disputedate)==false){
            return false;
        }
 
}*/
    if (isDatevalidate(disputedate)==false){
            return false;
        }
 
 
    var disputOthers = document.personalinfo.disputOthers.value;
         
    if(disputOthers.length > 255){
        alert("please enter message without exceeding 255 characters");
        document.personalinfo.disputOthers.style.border = "2px solid red";
        return false;
        }
 
}
/*End Validation for TransactionDisputes*/
 
/*start validation for BalanceTransfer*/
if (document.personalinfo.RequestType.value == "Balance Transfer Status"){
 
    var balancetransferDD = document.personalinfo.balancetransferDD.value;
    var balancetransferMM = document.personalinfo.balancetransferMM.value;
    var balancetransferYYYY = document.personalinfo.balancetransferYYYY.value;
 
    var baltrfdate = balancetransferDD+"/"+balancetransferMM+"/"+balancetransferYYYY;
 
    /*if(((balancetransferDD == "DD")&&(balancetransferMM == "MM")&&(balancetransferYYYY == "YYYY"))||((balancetransferDD == "")&&(balancetransferMM == "")&&(balancetransferYYYY == ""))){
// skip validation
     
    }
else{
         if (isDatevalidate(baltrfdate)==false){
            return false;
        }
    }*/
   

        if (isDatevalidate(baltrfdate)==false){
            return false;
        }


    var balancetransferamt = document.personalinfo.BalanceAmt.value;
    var balanceAmtRegExp = /^([0-9])*$/

    if((balancetransferamt == "Transaction Amount")||(balancetransferamt == "")) {
        alert("please enter the transaction amount with digits only");
        document.personalinfo.BalanceAmt.style.border = "2px solid red";
        return false;       
    }

    if(balanceAmtRegExp.test(balancetransferamt) == false){
        alert("please enter the transaction amount with digits only");
        document.personalinfo.BalanceAmt.style.border = "2px solid red";
        return false;
        }

    if(balancetransferamt.length > 10){
        alert("please enter the transaction amount without exceeding 10 digits");
        document.personalinfo.BalanceAmt.style.border = "2px solid red";
        return false;

    }

   

    var serviceRequNo = document.personalinfo.PreviousSRNo.value;
   
    var serviceRequNoRegEx = /^([a-zA-Z0-9])*$/
   
       
    if((serviceRequNo == "Previous SR No")||(serviceRequNo == "")) {
               alert("please enter the SR number ");
               document.personalinfo.PreviousSRNo.style.border = "2px solid red";
               return false;
    }
 
    if(serviceRequNoRegEx.test()==false){
        alert("please enter the SR number with alphabets or digits only");
               document.personalinfo.PreviousSRNo.style.border = "2px solid red";
               return false;
   
        }
   
    if(serviceRequNo.length > 45){
        alert("please enter the SR Number without exceeding 45 characters");
        document.personalinfo.PreviousSRNo.style.border = "2px solid red";
               return false;
    }
 
var bankOthers = document.personalinfo.bankOthers.value;
  
  if(bankOthers.length > 255){
        alert("please enter message without exceeding 255 characters");
        document.personalinfo.bankOthers.style.border = "2px solid red";
        return false;
        }
}
/*End validation for BalanceTransfer*/
 
/*Start validation for ApplicationStatus*/
if(document.personalinfo.RequestType.value == "Application Status"){


    var applicationFName = document.personalinfo.applicationFirstName.value;
       var applicationMName = document.personalinfo.applicationSecondName.value;
       var applicationLName = document.personalinfo.applicationLastName.value;

    if(applicationFName.length > 100){
   
        alert("please enter your first name,without exceeding characters");
               document.personalinfo.applicationFirstName.style.border = "2px solid red";
        return false;
    }
   
    if(applicationMName.length > 100){
        alert("please enter your first name,without exceeding characters");
               document.personalinfo.applicationSecondName.style.border = "2px solid red";
        return false;
    }

    if(applicationLName.length > 100){
        alert("please enter your first name,without exceeding characters");
               document.personalinfo.applicationLastName.style.border = "2px solid red";
        return false;
    }

 
		

    var applResidenceNoRegExp = /^([0-9])*$/
   var mobileNo = document.personalinfo.mobileNo.value;
 
 
    if((mobileNo != "")||(mobileNo.length > 0)){
     
      
 
       if((applResidenceNoRegExp.test(mobileNo) == false)||(mobileNo.length < 10)){
           alert("please enter your mobile number with digits only");
           document.personalinfo.mobileNo.style.border = "2px solid red";
           return false;
       }
   
   
    if(mobileNo.charAt(0) != "9"){
        alert("please check your mobile number, it should start with 9");
           document.personalinfo.mobileNo.style.border = "2px solid red";
           return false;
   
        }
 
    }
 //End of if condition if mobile no is enetered


    var birthDD = document.personalinfo.birthDay.value;
    var birthMM = document.personalinfo.birthMonth.value;
    var birthYYYY = document.personalinfo.birthYear.value;
 
 var dateOfBirth = birthDD+"/"+birthMM+"/"+birthYYYY

	 if((birthDD != "DD")||(birthMM != "MM")||(birthYYYY != "YYYY")){
		
		if (isDatevalidate(dateOfBirth)==false){
            return false;
        }

	 }
   

    appnameRegEx = /^([a-zA-Z .])*$/
    if(document.personalinfo.Customer.value == "Yes"){

       if((appnameRegEx.test(applicationFName)==false)||(applicationFName == "First")||(applicationFName.length < 3)||(applicationFName.length > 19)){
                alert("please enter your first name");
                document.personalinfo.applicationFirstName.style.border = "2px solid red";
                return false;
            }

        if((appnameRegEx.test(applicationMName)==false)||(applicationMName.length > 19)){
        alert("please enter your middle name");
        document.personalinfo.applicationSecondName.style.border = "2px solid red";
        return false;
        }

        if((appnameRegEx.test(applicationLName)==false)||(applicationLName == "Last")||(applicationLName.length < 1)||(applicationLName.length > 19)){
        alert("please enter your last name");
        document.personalinfo.applicationLastName.style.border = "2px solid red";
        return false;
        }

		  if((applResidenceNoRegExp.test(mobileNo) == false)||(mobileNo.length < 10)){
			   alert("please enter your mobile number with digits only");
			   document.personalinfo.mobileNo.style.border = "2px solid red";
			   return false;
				}
           
				 if(mobileNo.charAt(0) != "9"){
					 alert("please check your mobile number, it should start with 9");
					 document.personalinfo.mobileNo.style.border = "2px solid red";
					 return false;
   
        }
       
	   if (isDatevalidate(dateOfBirth)==false){
            return false;
        }


    }
//End of yes
    var applicationOthers = document.personalinfo.applicationOthers.value;
         
        if(applicationOthers.length > 255){
            alert("please enter your message without exceeding 255 characters");
            document.personalinfo.applicationOthers.style.border = "2px solid red";
            return false;
            }
 
}
/*End validation for ApplicationStatus*/
 
/*Start validation for Others*/
if(document.personalinfo.RequestType.value == "Others"){
     
    var requestOthres = document.personalinfo.requestOthres.value;


    //if(document.personalinfo.Customer.value == "Yes"){
   
        if(requestOthres.length < 1){
            alert("please enter your message without exceeding 255 characters");
            document.personalinfo.requestOthres.style.border = "2px solid red";
            return false;
            }
//}
//End of yes
         
        if(requestOthres.length > 255){
            alert("please enter your message without exceeding 255 characters");
            document.personalinfo.requestOthres.style.border = "2px solid red";
            return false;
            }
}
 
/*End validation for Others*/

/*Start of validation for feedback and suggetions*/

if(document.personalinfo.RequestType.value == "Feedback And Suggetions"){
     
    var requestFeedback = document.personalinfo.requestFeedbackSuggetions.value;
	
	   
	if(requestFeedback.length > 255){
		alert("Please enter your message without exceeding 255 characters");
		document.personalinfo.requestOthres.style.border = "2px solid red";
		return false;
		}
}


/*End of validation for feedback and suggetions*/

/* validation for Captach */

if(document.personalinfo.captach.value == ""){

	alert("Please re-enter the code");
	document.personalinfo.captach.style.border = "2px solid red";
	document.personalinfo.captach.focus();
	return false;

}



disbaleButton();

return true;
 
}
/* End validation*/
 
 
var flagDisbale=true;

function disbaleButton()
{
    if(flagDisbale)
    {
   
    flagDisbale=false;
    return true;
    }
    else{
    return false;
    }
   
}
 
 
 //logic to prepoulate the fields entered
 function emailPrepopulate(){
    selectedObjDropDown(document.personalinfo.Title,titleSelected);
 	selectedObjDropDown(document.personalinfo.RequestType,requestSelected);
 	GetRequestType();
 	if(requestSelected == "Payment related"){
 	
 		document.personalinfo.modePayment.value = matterEntered;
 		
 	}else if(requestSelected == "Charges clarifications"){
 	
 	    document.personalinfo.modeCharges.value = matterEntered;
 	    
 	}else if(requestSelected == "Credit Limit related"){
 	
 	    document.personalinfo.modeCredit.value = matterEntered;
 	
 	}else if(requestSelected == "Trouble on net banking / Phone banking"){
 	
 	    document.personalinfo.modeTrouble.value = matterEntered;
 	
 	}else if(requestSelected == "Offer / Promotion related"){
 	
 	    document.personalinfo.modeOffer.value = matterEntered; 
 	
 	}else if(requestSelected == "Transaction related"){
 	
 	    document.personalinfo.transactionDD.value = dateSelected;
 	    document.personalinfo.transactionMM.value = monthSelected;
 	    document.personalinfo.transactionYYYY.value = yearSelected;
		document.personalinfo.disputeDD.value = disdateSelected;
		document.personalinfo.disputeMM.value = dismonthSelected;
		document.personalinfo.disputeYYYY.value = disyearSelected;
 	    document.personalinfo.disputOthers.value = matterEntered;
 	    
 	}else if(requestSelected == "Others"){
 	  
 	    document.personalinfo.requestOthres.value = matterEntered;
 	    
 	}  	
 	
 	
 }
 
