/////if (!validateStep1(obj,formname)) return false; document.getElementById('error_div').style.display='none';
	
	/* Step 2 Validation */
	function validate_form(frm){
				if(namecheck(frm.first_name,"Please enter your first name.")){ch=0;}
				else {ch=1;} 
				if(!IsEmpty(frm.first_name,'text'))
				{
					if(!ValidateNo(frm.first_name.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ')){error_txt[error_txt.length]="Please enter a valid first name."; ch=1;}
					else {ch=0;}
				}
				errordisp(ch,'fname'); 
				if(namecheck(frm.last_name,"Please enter your last name.")){ch=0;}
				else {ch=1;} 
				if(!IsEmpty(frm.last_name,'text'))
				{
					if(!ValidateNo(frm.last_name.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ')){error_txt[error_txt.length]="Please enter a valid last name."; ch=1;}
					else {ch=0;}
				}
				errordisp(ch,'lname');
				if(frm.day.value == 0 || frm.month.value == 0 || frm.year.value == 0)
				{error_txt[error_txt.length]="Please choose the day, month and year of your birth."; ch=1;}
				else {ch=0;}
				errordisp(ch,'dt');

				gloanAmount = frm.loan_amt;
				gloanPeriod = frm.period_loan;

				if(frm.prop_identified.checked){
				if(IsEmpty(frm.estimate_market,"text")){error_txt[error_txt.length]="Please enter the estimated market value of your identified property."; ch=1;}
				else {	 if(!ValidateNo(frm.estimate_market.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid market value for your identified property."; ch=1;}
							else {ch=0;}
						}
				}
				
				errordisp(ch,'estmarval');
							
				if(IsEmpty(gloanAmount,'text')){error_txt[error_txt.length]="Please enter the loan amount."; ch=1;}
				else {	if(!ValidateNo(gloanAmount.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid loan amount."; ch=1;}
							else {
							if(gloanAmount.value.length < 4){error_txt[error_txt.length]="Please enter a valid loan amount."; ch=1;}
							else {ch=0;}
							}
						}
				errordisp(ch,'lamthome');
				
				if(IsEmpty(gloanPeriod,'text')){error_txt[error_txt.length]="Please enter the period."; ch=1;}
				else {	if(!ValidateNo(gloanPeriod.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid period."; ch=1;}
							else {ch=0;}
					}
				errordisp(ch,'pdloanhome');

				if(IsEmpty(frm.address,'text')){error_txt[error_txt.length]="Please enter your street address."; ch=1;}
				else {	if(!ValidateNo(frm.address.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.#()-/& ')){error_txt[error_txt.length]="Please enter a valid street address1."; ch=1;}
							else {ch=0;}
						}
				errordisp(ch,'addline1');							

				if(frm.city.options[frm.city.selectedIndex].value=="0")
				{error_txt[error_txt.length]="Please select your city."; ch=1;}
				errordisp(ch,'cityselect');
					
				//alert(frm.city.options[frm.city.selectedIndex].value);
				/* if(frm.city.options[frm.city.selectedIndex].value == '37') {	
					if(namecheck(frm.other_specify,"Please enter the name of your city.")){ch=0;}
					else {ch=1;} 
					if(!IsEmpty(frm.other_specify,'text')){
						if(!ValidateNo(frm.other_specify.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ')){error_txt[error_txt.length]="Please enter a valid city name. Special characters not allowed."; ch=1;}
						else {ch=0;}
					}
					errordisp(ch,'cityothers');
				} */
				
				if(IsEmpty(frm.pincode,'text')){error_txt[error_txt.length]="Please enter your PIN code."; ch=1;}
				else {	if(!ValidateNo(frm.pincode.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid PIN code."; ch=1;}
							else {ch=0;}
							if(frm.pincode.value.length<6){error_txt[error_txt.length]="Please enter a 6-digit PIN code."; ch=1;}
							if(frm.pincode.value == 0){error_txt[error_txt.length]="Please enter a valid PIN code."; ch=1;}
						}
				errordisp(ch,'pcode');				
				if((!IsEmpty(frm.landline,'text')) && (frm.stdcode.value == '')){error_txt[error_txt.length]="Please enter the STD code for the landline number provided.";}
				if(!IsEmpty(frm.stdcode,'text'))
					 {	if(!ValidateNo(frm.stdcode.value,'0123456789')){error_txt[error_txt.length]="This STD Code does not exist.";}
							if(frm.stdcode.value.length < 2 || frm.stdcode.value < 10){error_txt[error_txt.length]="This STD Code does not exist.";}
						//	if((frm.stdcode.value.length + frm.landline.value.length) != 10){error_txt[error_txt.length]="The number you typed is inappropriate for the STD Code entered.";}
						}
				
				if((frm.stdcode.value != '') && (IsEmpty(frm.landline,'text'))) {error_txt[error_txt.length]="Please enter the landline number.";}
				if(!IsEmpty(frm.landline,'text'))
						{	if(!ValidateNo(frm.landline.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid landline number.";}
							if(frm.landline.value == 0){error_txt[error_txt.length]="The number you typed is inappropriate for the STD Code entered.";}
							if((frm.stdcode.value.length + frm.landline.value.length) != 10){error_txt[error_txt.length]="The number you typed is inappropriate for the STD Code entered.";}
						}
				if(IsEmpty(frm.mobile,'text')){error_txt[error_txt.length]="Please enter your mobile number."; ch=1;}
				else {ch=0;}
				errordisp(ch,'mob');
				
				if(!IsEmpty(frm.mobile,'text'))
					 {	if(!ValidateNo(frm.mobile.value,'0123456789')){error_txt[error_txt.length]="The mobile number typed is incorrect."; ch=1;}
						else {ch=0;}
						if((frm.mobile.value.length < 10) || (frm.mobile.value < 9000000000)){error_txt[error_txt.length]="The mobile number typed is incorrect."; ch=1;}
						}
				errordisp(ch,'mob');	
				if(mailidcheck(frm.emailid,'Please enter your email ID.')) {ch=0;}
				else {ch=1;}
				if(!IsEmpty(frm.emailid,'text'))
				{
					if(mailidcheck1(frm.emailid,'Please enter a valid email ID.')) {ch=0;}
					else {ch=1;}
				}
				errordisp(ch,'emid');	
				if(frm.employment.options[frm.employment.selectedIndex].value == 0) {error_txt[error_txt.length]="Please enter your employment status."; ch=1;}
				else {ch=0;}
				errordisp(ch,'empstat');	

				if(namecheck(frm.company_name,"Please enter your company name.")) {ch=0;}
				else {ch=1;}
				if(!IsEmpty(frm.company_name,'text'))
				{	if(namecheck2(frm.company_name,"Please enter a valid company name.")) {ch=0;}
					else {ch=1;}
				}
				errordisp(ch,'compname');	
				
				if(IsEmpty(frm.monthly_income,'text')){error_txt[error_txt.length]="Please enter your monthly income."; ch=1;}
				else {	if(!ValidateNo(frm.monthly_income.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid monthly income."; ch=1;}
							else {ch=0;}
							if(frm.monthly_income.value.length < 4 || frm.monthly_income.value == 0){error_txt[error_txt.length]="Please enter a valid monthly income."; ch=1;}
						}
				errordisp(ch,'moninc');	
				if(frm.year_exp.options[frm.year_exp.selectedIndex].value == 0) {error_txt[error_txt.length]="Please enter your experience in the current company."; ch=1;}
				else {ch=0;}
				errordisp(ch,'cexpyear');	

				if(frm.year_exp1.options[frm.year_exp1.selectedIndex].value == 0) {error_txt[error_txt.length]="Please enter your total experience."; ch=1;}
				else {ch=0;}
				errordisp(ch,'texpyear');	

				curYear = totYear = dbYear = 0;
				curYear = parseInt(frm.year_exp.options[frm.year_exp.selectedIndex].value);
				totYear = parseInt(frm.year_exp1.options[frm.year_exp1.selectedIndex].value);
				dbYear = parseInt(frm.year.options[frm.year.selectedIndex].value);
				if(curYear !=0 && totYear !=0)
				{
					if(curYear>totYear) {error_txt[error_txt.length]="Your total experience must be greater than your current experience.";ch=1;}
					else {ch=0;}
					if(curYear==totYear)
					{
						if( parseInt(frm.month_exp.options[frm.month_exp.selectedIndex].value) > parseInt(frm.month_exp1.options[frm.month_exp1.selectedIndex].value))
						{error_txt[error_txt.length]="Your total experience must be greater than your current experience."; ch=1;}
						else {ch=0;}
					}
					errordisp(ch,'cexpyear');	
					errordisp(ch,'texpyear');	
				}
	
				if(frm.primary_bank.options[frm.primary_bank.selectedIndex].value == 0) {error_txt[error_txt.length]="Please select the bank where you hold your primary account."; ch=1;}
				else {ch=0;}
				errordisp(ch,'bankacc');	

				if(frm.primary_bank.options[frm.primary_bank.selectedIndex].value=="9")
					{
						if(namecheck(frm.other_bank,"Please enter the bank where you hold your primary account.")) {ch=0;}
						else {ch=1;}
						if(!IsEmpty(frm.other_bank,'text'))
						{	if(namecheck1(frm.other_bank, "Please enter a valid bank name. Special characters not allowed.")) {ch=0;}
							else {ch=1;}
						}
							errordisp(ch,'bankother');	
					}

				for (var i=0; i < frm.card.length; i++)
				   {
				   if (frm.card[i].checked)
					  {
					 	 var card_val = frm.card[i].value;
					  }
				   }
				 if(card_val == 'Y'){
					creditCardSelected=false;
					for(var i=1; i<=11; i++){ 
						if(document.getElementById("creditcard"+i).checked){
							i=11;
							creditCardSelected=true;
						}
					}
					if(!creditCardSelected) {error_txt[error_txt.length]="Please select atleast one of the credit card options."; ch=1;}
					else {ch=0;}
					errordisp(ch,'actcc');
				 }
				
				if(frm.loan_yes.checked)
				{
					if(frm.type_loan1.options[frm.type_loan1.selectedIndex].value == 0)	{error_txt[error_txt.length]="Please select the type of loan."; ch=1;}
					else {ch=0;}
					errordisp(ch,'lt1');
					
					if(IsEmpty(frm.emi_amount1,'text')){error_txt[error_txt.length]="Please enter the EMI amount."; ch=1;}
					else {	if(!ValidateNo(frm.emi_amount1.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid EMI amount."; ch=1;}
								else {ch=0;}
								if(frm.emi_amount1.value.length < 3 || frm.emi_amount1.value == 0){error_txt[error_txt.length]="Please enter a valid EMI amount.";}
							}
					errordisp(ch,'emi1');
					if(IsEmpty(frm.pending_emi1,'text')){error_txt[error_txt.length]="Please enter the no. of pending EMIs."; ch=1;}
					else {	if(!ValidateNo(frm.pending_emi1.value,'0123456789')){error_txt[error_txt.length]="Please enter valid no. of pending EMIs."; ch=1;}
								else {ch=0;}
								if(frm.pending_emi1.value == 0){error_txt[error_txt.length]="Please enter valid no. of pending EMIs."; ch=1;}
							}
					errordisp(ch,'pend1');
					if(frm.type_loan2.options[frm.type_loan2.selectedIndex].value != 0)
					{
							if(IsEmpty(frm.emi_amount2,'text')){error_txt[error_txt.length]="Please enter the EMI amount."; ch=1;}
							else {	if(!ValidateNo(frm.emi_amount2.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid EMI amount."; ch=1;}
										else {ch=0;}
										if(frm.emi_amount2.value.length < 3 || frm.emi_amount2.value == 0){error_txt[error_txt.length]="Please enter a valid EMI amount."; ch=1;}
									}
							errordisp(ch,'emi2');
							if(IsEmpty(frm.pending_emi2,'text')){error_txt[error_txt.length]="Please enter the no. of pending EMIs."; ch=1;}
							else {	if(!ValidateNo(frm.pending_emi2.value,'0123456789')){error_txt[error_txt.length]="Please enter valid no. of pending EMIs."; ch=1;}
										else {ch=0;}
										if(frm.pending_emi2.value == 0){error_txt[error_txt.length]="Please enter valid no. of pending EMIs."; ch=1;}
							}
							errordisp(ch,'pend2');
					}
					if(frm.type_loan3.options[frm.type_loan3.selectedIndex].value != 0)
					{
							if(IsEmpty(frm.emi_amount3,'text')){error_txt[error_txt.length]="Please enter the EMI amount."; ch=1;}
							else {	if(!ValidateNo(frm.emi_amount3.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid EMI amount."; ch=1;}
										else {ch=0;}
										if(frm.emi_amount3.value.length < 3 || frm.emi_amount3.value == 0){error_txt[error_txt.length]="Please enter a valid EMI amount."; ch=1;}
									}
							errordisp(ch,'emi3');
							if(IsEmpty(frm.pending_emi3,'text')){error_txt[error_txt.length]="Please enter the no. of pending EMIs."; ch=1;}
							else {	if(!ValidateNo(frm.pending_emi3.value,'0123456789')){error_txt[error_txt.length]="Please enter valid no. of pending EMIs."; ch=1;}
										else {ch=0;}
										if(frm.pending_emi3.value == 0){error_txt[error_txt.length]="Please enter valid no. of pending EMIs."; ch=1;}
							}
							errordisp(ch,'pend3');
					}
				}	


			
	//}

		var err_str="";
			if(error_txt.length>0)
			{
				for(i=0;i<error_txt.length;i++)
				{
					err_str+="<li>"+error_txt[i]+"</li>";
				}
				err_str=error_html_start+err_str+error_html_end;
				document.getElementById("error_div1").innerHTML="";
				document.getElementById("error_div1").style.display='block';
				document.getElementById("error_div1").innerHTML=err_str;
				err_str="";
				error_txt=new Array();
				error_txt.length=0;
				document.getElementById("err_div1_focus").focus();
				return false;
			}

		return true;
	}
	/* End Validation */

	function bank_change(s)
	{
		document.getElementById("other_bank").disabled = (s.options[s.selectedIndex].value=="9") ? false : true;
		if(s.options[s.selectedIndex].value=="9") document.getElementById("other_bank").focus();
	}

	function proidentify_onChange(Obj){		
		if(Obj.value=="N"){				
				document.getElementById("estimatedText_no").style.display="";
				document.getElementById("estimatedObject_no").style.display="";
				document.getElementById("estimatedObject_no1").style.display="";
				document.getElementById("suggestProperty").checked=true;
				document.getElementById("pref_city").disabled="";
				document.getElementById("estimatedText_yes").style.display="none";
				document.getElementById("estimatedObject_yes").style.display="none";							
		}else if(Obj.value=="Y"){
				document.getElementById("estimatedText_no").style.display="none";
				document.getElementById("estimatedObject_no").style.display="none";
				document.getElementById("estimatedObject_no1").style.display="none";
				document.getElementById("suggestProperty").checked=false;
				document.getElementById("pref_city").disabled="disabled";
				document.getElementById("estimatedText_yes").style.display="";
				document.getElementById("estimatedObject_yes").style.display="";
		}
		
	}
	function suggest_change(Obj)
	{
		if(Obj.checked==true)
		{
			document.getElementById("pref_city").disabled="";
		}
		else
		{
			document.getElementById("pref_city").disabled="disabled";
		}
	}

	/* function citychange(obj){			
			if(obj.options[obj.selectedIndex].value == '37')
				{document.getElementById("other_specify").disabled=false; document.getElementById("other_specify").focus();}
			else
				{ document.getElementById("other_specify").value=''; document.getElementById("other_specify").disabled=true;}
	} */

	function creditcard_OnChange(e){
		if(e.value=="Y" || e.value=="y"){document.getElementById("creditCard_TD").style.display="";}
		else {
			document.getElementById("creditCard_TD").style.display="none";
		}
	}
	function anyExistingLoan_OnChange(e){
		if(e.value=="Y" || e.value=="y"){
			document.getElementById("anyExistingLoan_TR").style.display="";
		}
		else {
			document.getElementById("anyExistingLoan_TR").style.display="none";
		}
	}
	function errordisp(ch, spanid){
		try{		
			if(ch==1){
				document.getElementById(spanid).style.display='block'; 
				document.getElementById(spanid).innerHTML='<img src="images/err_arrow.gif" />';
			}else{
				document.getElementById(spanid).style.display='none'; 
				document.getElementById(spanid).innerHTML='';
			}
		}catch(e){alert(e);}
	}