
function textValue(){	
	var stationInteger, stationString	
	stationInteger=document.DEPOSIT.bremail.selectedIndex	
	stationString=document.DEPOSIT.bremail.options[stationInteger].text	
	document.DEPOSIT.BRANCH.value = stationString +" Branch" }

function CheckForm() { 
var errorMsg = "";
if (document.DEPOSIT.NAME1.value == ""){
errorMsg += "\n\tFirst Name                      \t- Enter your First Applicant Name";	
	}



	
if (document.DEPOSIT.bremail.value == "0"){
errorMsg += "\n\tSelect the Branch            \t- Select the Branch";
	}

if (document.DEPOSIT.EMAIL1.value == ""){
errorMsg += "\n\tI st Applicant E-Mail         \t- Enter your E-Mail ID";
	}

if (document.DEPOSIT.PHONE1.value == ""){
errorMsg += "\n\tPHONE NO                       \t- Enter your Phone No";
	}
if (document.DEPOSIT.ADDRESS1.value == ""){
errorMsg += "\n\t ADDRESS                        \t- Enter your Address";
	}

if (document.DEPOSIT.PIN1.value == ""){
errorMsg += "\n\t Pin Code                         \t- Enter your Pin Code";
	}

if (document.DEPOSIT.DOB1.value == ""){
errorMsg += "\n\tDate of Birth                     \t- Enter your Birth Date";
	}

if (document.DEPOSIT.SDWOF01.value  == "-"){
errorMsg += "\n\tSelect S/W/D/C  Ist Holder  \t- Select the S/W/D/C of Value";
	}

if (document.DEPOSIT.SDWOF1.value  == ""){
errorMsg += "\n\t S/O, W/O, D/O, C/O Value  \t- Fill  your  Father/Husband Name";
	}

if (document.DEPOSIT.MOTHER1.value  == ""){
errorMsg += "\n\tFill Mother Name                \t- Fill your Mother Name";
	}



if (document.DEPOSIT.OPERATEDBY.value  == ""){
errorMsg += "\n\tAccount Operated By Value  \t- Select Account Operated By ";
	}
if (document.DEPOSIT.INTRO_ACNO.value == "") { 
errorMsg += "\n\t Introducer Account No         \t- Enter Introducer Account NO";
	}

if (document.DEPOSIT.INTRO_NAME.value == "") { 
errorMsg += "\n\t Introducer Name                 \t- Enter Introducer Name";
	}


if ((document.DEPOSIT.EMAIL1.value == "") || (document.DEPOSIT.EMAIL1.value.length > 0 && (document.DEPOSIT.EMAIL1.value.indexOf("@",0) == - 1 || document.DEPOSIT.EMAIL1.value.indexOf(".",0) == - 1))) { 
errorMsg += "\n\tE-mail Address                     \t- Enter your valid e-mail address";
	}

if (document.DEPOSIT.NAME2.value != "" && document.DEPOSIT.DOB2.value == ""){
errorMsg += "\n\t--------------------------------------2nd Holder---------------------------------------------- ";	
errorMsg += "\n\tEnter Date of Birth IInd Holder \t- Enter Date of Birth IInd Name ";
	}

if (document.DEPOSIT.NAME2.value != "" && document.DEPOSIT.SDWOF02.value == "-"){
errorMsg += "\n\tSelect S/W/D/C  IInd Holder      \t- Select the S/W/D/C of Value of IInd holder";
	}
if (document.DEPOSIT.NAME2.value != "" && document.DEPOSIT.SDWOF2.value == ""){
errorMsg += "\n\t IInd Holder Father/Husband     \t- Fill  IInd holder  Father/Husband Name";
	}
if (document.DEPOSIT.NAME2.value != "" && document.DEPOSIT.ADDRESS2.value == ""){
errorMsg += "\n\t Address of  IInd Holder            \t- Fill  IInd holder Address";
	}

if (document.DEPOSIT.NAME2.value != "" && document.DEPOSIT.MOTHER2.value == ""){
errorMsg += "\n\t Mother Name of  IInd Holder    \t- Fill  IInd holder Mother Name";
	}

if (document.DEPOSIT.NAME3.value != "" && document.DEPOSIT.DOB3.value == ""){
errorMsg += "\n\t--------------------------------------3rd Holder---------------------------------------------- ";	
errorMsg += "\n\tEnter Date of Birth IIIrd holder \t- Enter Date of Birth IIIrd Holder ";
	}

if (document.DEPOSIT.NAME3.value != "" && document.DEPOSIT.SDWOF03.value == "-"){
errorMsg += "\n\tSelect S/W/D/C  IIIrd Holder      \t- Select the S/W/D/C of Value of IIIrd holder";
	}
if (document.DEPOSIT.NAME3.value != "" && document.DEPOSIT.SDWOF3.value == ""){
errorMsg += "\n\t IIIrd Holder Father/Husband     \t- Fill  IIIrd holder  Father/Husband Name";
	}
if (document.DEPOSIT.NAME3.value != "" && document.DEPOSIT.ADDRESS3.value == ""){
errorMsg += "\n\t Address of  IIIrd Holder            \t- Fill  IIIrd holder Address";
	}

if (document.DEPOSIT.NAME3.value != "" && document.DEPOSIT.MOTHER3.value == ""){
errorMsg += "\n\t Mother Name of  IIIrd Holder    \t- Fill  IIIrd holder Mother Name";
	}



  if (!DEPOSIT.agreecheck.checked)
  {
    alert("You have to  Agree the Terms& Condition.\n\t online@CityUnionBank");
    DEPOSIT.agreecheck.focus();
    return (false);
  }


    args = CheckForm.arguments;
    formObj = args[0];
    var isOK = true;
    for (i=1;i<args.length;i++) {
	elemSelected=false;
	elems = formObj.elements[args[i]];
	for (j=0;j<elems.length;j++) if (elems[j].checked) elemSelected=true;
	if (!elemSelected) {
	    isOK = false;
	    alert("You have to select a "+args[i]);
	}
    }


		
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "                                    Online@CityunionBank.com                                            \n\n";
            msg += "______________________________________________________________\n\n";
		msg += "Your Application has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
    return isOK;
}
