function validateCustInfo()
{
	
	var formCustomerDetail=new Object();
	
	var isNRIValue=document.getElementById('APP_IS_NRI_YN').value;
	 
	formCustomerDetail["APP_CUST_NAME"] = {blank:true,valid:true, validateFunction:[fullNameValidation],label:"Customer Name"};	
	formCustomerDetail["APP_EMAIL"] = {blank:true,valid:true, validateFunction:[emailValidation],label:"e-mail address"};
	//formCustomerDetail["residenceCode"] = {blank:true,valid:true, validateFunction:[digitValidation],label:"Residence country Code Number"};
	//formCustomerDetail["DOB"] = {blank:true,label:"Date Of Birth"};	
	//formCustomerDetail["residenceAreaNo"] = {blank:true,valid:true, validateFunction:[digitValidation],label:"Residence Area Code Number"};
	//formCustomerDetail["residenceNo"] = {blank:true,valid:true, validateFunction:[digitValidation],label:"Residence Number"};	
	formCustomerDetail["APP_CITY_ID"] = {blank:true,valid:true, validateFunction:[selectValidation],label:"Residence City"};	
	formCustomerDetail["PIN_CODE"] = {valid:true, validateFunction:[zipValidation],param:{isNRI:isNRIValue},label:"Residence Zipcode/Postcode"};
	//formCustomerDetail["OTHER_EMPLOYER_NAME"] = {blank:true,valid:true, validateFunction:[fullNameValidation],label:"Employer Name"};
	//formCustomerDetail["offAreaCode"] = {blank:true,valid:true, validateFunction:[digitValidation],label:"Office Area Code Number"};
	//formCustomerDetail["offNo"] = {blank:true,valid:true, validateFunction:[digitValidation],label:"Office Number"};
	//formCustomerDetail["offExt"] = {valid:true, validateFunction:[digitValidation],label:"Office Ext Number"};
	formCustomerDetail["OFF_CITY_ID"] = {blank:true,valid:true, validateFunction:[selectValidation],label:"Office City"};
	formCustomerDetail["OFF_PIN_CODE"] = {valid:true, validateFunction:[zipValidation],param:{isNRI:isNRIValue},label:"Office Zipcode/Postcode"};
	  
	 fieldMap["formCustomerDetail"]=formCustomerDetail;
	 
	 
	var dayValue = document.getElementById('APP_DOB_DAY').value;
	var monthValue = document.getElementById('APP_DOB_MONTH').value;
	var yearValue = document.getElementById('APP_DOB_YEAR').value;
	isNRIValue = document.getElementById('APP_IS_NRI_YN').value;
	formCustomerDetail["APP_TEL_MOBILE"] = {blank:true,valid:true, validateFunction:[mobilenumberValidation],param:{isNRI:isNRIValue},label:"a 10 digit Mobile number"};
	formCustomerDetail['APP_DOB_MONTH'] = {blank:true, valid:true, validateFunction:[DateValidation],label:'Date of birth',param:{day:dayValue,month:monthValue,year:yearValue}};
	
	if(document.getElementById('newPin').style.display!='none' && document.getElementById('verifyNewPin').style.display!='none')
	{
		formCustomerDetail['newPinTxt'] = {blank:true, valid:true, validateFunction:[digitValidation,stringLengthValidation],label:'Mobile Pin',param:{stringLen:4}};
		formCustomerDetail['verifyNewPinTxt'] = {blank:true, valid:true, validateFunction:[digitValidation,stringLengthValidation],label:'Verify Mobile Pin',param:{stringLen:4}};
		if(document.getElementById('verifyNewPinTxt').value!=document.getElementById('newPinTxt').value)
		{
			alert('Please provide same value for mobile pin and Verify mobile pin.');
			return false;
		}
	}	
	
	var errorStatus = validation(document.formCustomerDetail);
	if(errorStatus)
	{
		alert('Your profile has been saved successfully');
		document.formCustomerDetail.submit();
	}
}
function changePin(){
	document.getElementById('newPin').style.display='';
	document.getElementById('verifyNewPin').style.display='';

}

function showEdit()
{
	
		xmlhttpPost("GET",baseURL+"/custInfo.php","postShowEdit");
}
function postShowEdit(responseData)
{
	var ext;
	cust=responseData.split("::");
	cust_name=String.replace(cust[0]," ","\ ");
	document.getElementById("cust_name").innerHTML="<input name='CUST_NAME' type='text' class='inptClass' size='30' value='"+cust_name+" />";
	
	if(cust[1].length!=0 && cust[1].indexOf('-')!=0 )
	{
		cust_mob=cust[1].split("-");
	}
	document.getElementById("tel_mobile").innerHTML="+<input name='COUNTRY_CODE' id='COUNTRY_CODE' type='text' value='"+cust_mob[0]+"' maxlength='3' size='2'/>&nbsp;<input name='TEL_MOBILE' id='TEL_MOBILE' type='text' value='"+cust_mob[1]+"'maxlength='11' size='12'/>";
	if(cust[2].length!=0 && cust[2].indexOf('-')!=0 )
	{
		cust_tel_res=cust[2].split("-");
	}
	document.getElementById("resident_number").innerHTML="+<input name='residenceCode' id='residenceCode' value='"+cust_tel_res[0]+"' size='2' maxlength='3'>&nbsp;<input name='residenceAreaNo' id='residenceAreaNo' value='"+cust_tel_res[1]+"' size='4' maxlength='5'>&nbsp;<input name='residenceNo' id='residenceNo' value='"+cust_tel_res[2]+"' size='8' maxlength='10'><table valign='bottom'><tr><td>Area<br>Code</td><td valign='top'>&nbsp;&nbsp;(Eg Mumbai No: +91 22 22222222 )</td></tr></table>";

	document.getElementById("address").innerHTML="<textarea name='ADDRESS' id='ADDRESS' type='text'>"+cust[3]+"</textarea>";

//	cityInfo=getCityInfo();
	//document.getElementById("other").innerHTML=cityInfo;

	document.getElementById("pin_code").innerHTML="<input name='PIN_CODE' id='PIN_CODE' value='"+cust[4]+"' size='6' maxlength='6'>";

	//countryInfo=getCountryInfo();
	//document.getElementById("country").innerHTML=countryInfo;

	document.getElementById("same").innerHTML="<td width='50%'>Check if same as Residence</td><td width='50%'><input name='sameAdd' id='sameAdd' onclick='copyAddress()\;' type='checkbox'></td>";
	document.getElementById("employer_name").innerHTML="<input name='OTHER_EMPLOYER_NAME' id='OTHER_EMPLOYER_NAME' value='"+cust[5]+"'>";
	if(cust[6].length!=0 && cust[6].indexOf('-')!=0 )
	{
		tel_off=cust[6].split("-");
		if(tel_off.length>3)
		{
			ext=tel_off[3];
		}
		else
		{
			ext='';
		}
	}	

	document.getElementById("tel_office").innerHTML="+<input name='offCode' id='offCode' value='"+tel_off[0]+"' size='2' maxlength='3'>&nbsp;<input name='offAreaCode' id='offAreaCode' value='"+tel_off[1]+"' size='4' maxlength='5'>&nbsp;<input name='offNo' id='offNo' value='"+tel_off[2]+"' size='8' maxlength='8'>&nbsp;<input name='offExt' id='offExt' value='"+ext+"' size='3' maxlength='4'><table valign='bottom'><tr><td>Area<br>Code</td><td >(Eg Mumbai No: +91 22 22222222 )</td><td>Ext No.</td></tr></table>";

	document.getElementById("office_address").innerHTML="<textarea name='OFF_ADDRESS' id='OFF_ADDRESS' type='text'>"+cust[7]+"</textarea>";
	
	//	cityInfo=getCityInfo();
	//document.getElementById("other").innerHTML=cityInfo;
	
	document.getElementById("office_pin_code").innerHTML="<input type= 'text' name='OFF_PIN_CODE' id='OFF_PIN_CODE' value='"+cust[8]+"' size='6' maxlength='6'>";
	
	//countryInfo=getCountryInfo();
	//document.getElementById("country").innerHTML=countryInfo;
	document.getElementById("btn").innerHTML="<input type='Submit' value='Save'>";
}

/*
function getCityInfo()
{
	city=new array();

	cityInfo="<table><tr><td><select id ='CITY_ID' name='CITY_ID'// onchange='getother\(document\.getElementById\('CITY_ID'\),document.getElementById\('OTHER_CITY_NAME'\)\);'>
						<option value='0'>Select a City</option>";
	for(countCity=0;countCity>city.length;countCity++)
							{
								cityInfo+='<option value=\''+cityVal[countCityValue]+'\'>'+city[city								Count]+'</option>';
							}
						
			cityInfo+="<option value='other'>Other</option>
			</select></td><td><input  type='text' id = 'OTHER_CITY_NAME' name='OTHER_CITY_NAME' size='10' maxlength='50' style='display\:none\;'>
				</td></tr></table>";
return cityInfo;
}
function getCountryInfo()
{
	country=new array();
	countryInfo="<table><tr><td>
				<select id ='COUNTRY_ID' name='COUNTRY_ID' onchange='getother(document.getElementById('COUNTRY_ID'),document.getElementById('OTHER_COUNTRY_NAME'));'>
						<option value='0'>Select a Country</option>";
for(countCountry=0;countCountry>country.length;countCountry++)
							{
								countryInfo+='<option value=\''+countryVal[countryCount]+'\'>'+country[countryCount]+'</option>';
							}
						
	$countryInfo+="<option value='other'>Other</option>
				</select></td><td><input  type='text' id = 'OTHER_COUNTRY_NAME' name='OTHER_COUNTRY_NAME' size='10' maxlength='50' style='display:none;'>
				</td></tr></table>";
	return $countryInfo;
}



<table><tr><td>
				<select id ='OFF_COUNTRY_ID' name='OFF_COUNTRY_ID' onchange='getother(document.getElementById('OFF_COUNTRY_ID'),document.getElementById('OFF_OTHER_COUNTRY_NAME'));'>
						<option value='0'>Select a Country</option>";
						
						 for($i=0;$i<count($countryData);$i++)
							{
								$content.='<option value=\''.$countryData[$i]['COUNTRY_ID'].'\'>'.$countryData[$i]['COUNTRY_NAME'].'</option>';
							}
						
$content.="<option value='other'>Other</option>
				</select></td><td><input  type='text' id = 'OFF_OTHER_COUNTRY_NAME' name='OFF_OTHER_COUNTRY_NAME' size='10' maxlength='50' style='display:none;'>
				</td></tr></table>
*/