	var ch=0;

	function errordisp(ch, spanid)
	{
		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='';}
	}

	function form_submit(obj,formname){
		if(obj == 'sub2'){
				formname.loan_type.value = document.getElementById("loan_type1").value; 
			try{
				formname.purpose_loan.value = document.getElementById("purpose_expenses").value;
			}
			catch(err){
				txt = err.description;
			}
			if(formname.loan_type.value == 6)
			obj = "sub21";
		else if(formname.loan_type.value == 7)
			obj = "sub22";
		}

		if(formname.name=="loan_type_default" || formname.name=="loan_type_carloan" || formname.name=="loan_type_educ" || formname.name=="loan_type_home"){
			if (!validateStep1(obj,formname)) return false; document.getElementById('error_div').style.display='none';
		}
		else if(formname.name=="personal" || formname.name=="personal1" || formname.name=="personal2"){
			if (!validateStep2(obj,formname)) return false;document.getElementById('error_div1').style.display='none';
		}
		else if(formname.name=="activation_frm"){
			if (!validateStep3(obj,formname)) return false;document.getElementById('error_div2').style.display='none';
		}
		var n = 'f' + Math.floor(Math.random() * 99999);
		var d = document.createElement('DIV');
		d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'"></iframe>';
		document.body.appendChild(d);
		if(obj == 'sub2'){
					document.getElementById('first').className='bc1';
					document.getElementById('second').className='bc';

					document.getElementById("switchsub2").onclick = function(event){ SwitchMenu("sub2"); 	};
					document.getElementById("switchsub2").href="#";			
		}
		if(obj == 'sub3'){	
					document.getElementById('second').className='bc1';
					document.getElementById('third').className='bc';

					document.getElementById("switchsub3").onClick = function(event){ 	SwitchMenu("sub3"); };
					document.getElementById("switchsub3").href="#";
		}
		formname.target=n;
		formname.submit();
		SwitchMenu(obj);
	/*	if(obj == 'sub3')
		{
			load_bank_list();
		}*/

		return false;
	}
	
	/* Step 1 Validation */
	function validateStep1(obj,frm){
		var gloanAmount = null;
		var gloanPeriod = null;
		switch(frm.name){
			case "loan_type_default":
				gloanAmount = frm.loan_amount;
				gloanPeriod = frm.period_laon;

				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 < 2 || gloanAmount.value == 0){error_txt[error_txt.length]="Please enter a valid loan amount."; ch=1;}
							else {ch=0;}
							}
						}
				errordisp(ch,'lamt');
			/*	if(document.getElementById('loan_type1').value == 1)
				{if(document.getElementById('purpose_expenses').value == 0){error_txt[error_txt.length]="Please choose the purpose of loan.";}	}*/

				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 {
							if(gloanPeriod.value == 0) {error_txt[error_txt.length]="Please enter a valid period."; ch=1;}
							else {ch=0;}
							}
						}
				errordisp(ch,'pdloan');

				break;

			case "loan_type_carloan":
				gloanAmount = frm.loan_amount_car;
				gloanPeriod = frm.period_car_laon;
				
				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 < 2 || gloanAmount.value == 0){error_txt[error_txt.length]="Please enter a valid loan amount."; ch=1;}
							else {ch=0;}
							}
						}
				errordisp(ch,'lamtcar');

				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 {
							if(gloanPeriod.value == 0) {error_txt[error_txt.length]="Please enter a valid period."; ch=1;}
							else {ch=0;}
							}
						}
				errordisp(ch,'pdloancar');
				break;

			case "loan_type_educ":

				gloanAmount = frm.loan_amount1;
				gloanPeriod = frm.period_business;

				if(IsEmpty(frm.course_name,'text')){error_txt[error_txt.length]="Please enter the name of the course for which the loan is being requested."; ch=1;}
				else {if(!ValidateNo(frm.course_name.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,. ')){error_txt[error_txt.length]="Please enter a valid course name."; ch=1;}
						else {ch=0;}
						}
				errordisp(ch,'cname');
				if(IsEmpty(frm.duration_of_course,'text')){error_txt[error_txt.length]="Please enter the course duration."; ch=1;}
				else {if(!ValidateNo(frm.duration_of_course.value,'0123456789')){error_txt[error_txt.length]="Please enter a valid course duration."; ch=1;}
						else {ch=0;}
				}
				errordisp(ch,'durcour');
				if(IsEmpty(frm.name_of_instit,'text')){error_txt[error_txt.length]="Please enter the name of the institution for which the loan is being requested."; ch=1;}
				else {if(!ValidateNo(frm.name_of_instit.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ')){error_txt[error_txt.length]="Please enter a valid name of institution."; ch=1;}
						else {ch=0;}
				}
				errordisp(ch,'instname');
				if(IsEmpty(frm.city,'text')){error_txt[error_txt.length]="Please enter the city in which the institution is located."; ch=1;}
				else {if(!ValidateNo(frm.city.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ')){error_txt[error_txt.length]="Please enter a valid city name."; ch=1;}
						else {ch=0;}
				}
				errordisp(ch,'cityname');
				if(IsEmpty(frm.total_course_expense,'text')){error_txt[error_txt.length]="Please enter the total course expenses."; ch=1;}
				else { if(!ValidateNo(frm.total_course_expense.value,'01234567890')){error_txt[error_txt.length]="Please enter a valid amount for the total course expenses."; ch=1;}
						  else {
						  if(frm.total_course_expense.value.length < 4){error_txt[error_txt.length]="Please enter a valid amount for the total course expenses."; ch=1;}
						  else {ch=0;}
						  }
						}
				errordisp(ch,'courexp');
				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,'lamtedu');
				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,'pdloanbus');
				break;

			case "loan_type_home":

				gloanAmount = frm.loan_amount2;
				gloanPeriod = frm.period_loan2;

				if(frm.proidentify[0].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');

				break;
		}
		
			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_div").innerHTML="";
				document.getElementById("error_div").style.display='block';
				document.getElementById("error_div").innerHTML=err_str;
				err_str="";
				error_txt=new Array();
				error_txt.length=0;
				return false;
			}

		return true;
	}
	/* End Step 1 Validation */


	/* Step 2 Validation */
	function validateStep2(obj,frm){
		switch(frm.name){
			case "personal":
				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 enter the day, month and year of your birth."; ch=1;}
				else {ch=0;}
				errordisp(ch,'dt');
				
				if(IsEmpty(frm.address_line1,'text')){error_txt[error_txt.length]="Please enter your street address."; ch=1;}
				else {	if(!ValidateNo(frm.address_line1.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.#()-/& ')){error_txt[error_txt.length]="Please enter a valid street address1."; ch=1;}
							else {ch=0;}
						}
				errordisp(ch,'addline1');
				
				if(!IsEmpty(frm.address_line2,'text'))
				{	if(!ValidateNo(frm.address_line2.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.#()-/& ')){error_txt[error_txt.length]="Please enter a valid street address2."; ch=1;}
					else {ch=0;}
					errordisp(ch,'addline2');
				}
				else {ch=0; errordisp(ch,'addline2');}				

				if(frm.city.options[frm.city.selectedIndex].value=="0")
				{error_txt[error_txt.length]="Please select your city."; ch=1;}
				errordisp(ch,'cityselect');
						
				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');
					}
				}	

				break;
			case "personal1":
				
				if(namecheck(frm.first_name,"Please enter the student's 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,'fname1'); 
				
				if(namecheck(frm.last_name,"Please enter the student's 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,'lname1'); 
 				
				if(frm.day.value == 0 || frm.month.value == 0 || frm.year.value == 0)
				{error_txt[error_txt.length]="Please enter the day, month and year of your birth."; ch=1;}
				else {ch=0;}
				errordisp(ch,'dt1');
				
				if(IsEmpty(frm.address_line1,'text')){error_txt[error_txt.length]="Please enter your street address."; ch=1;}
				else {	if(!ValidateNo(frm.address_line1.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.#()-/& ')){error_txt[error_txt.length]="Please enter a valid street address."; ch=1;}
							else {ch=0;}
						}
				errordisp(ch,'addline11');
				
				if(!IsEmpty(frm.address_line2,'text'))
				{	if(!ValidateNo(frm.address_line2.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.#()-/& ')){error_txt[error_txt.length]="Please enter a valid street address."; ch=1;}
					else {ch=0;}
					errordisp(ch,'addline21');
				}
				else {ch=0; errordisp(ch,'addline2');}

				if(frm.city.options[frm.city.selectedIndex].value=="0")
				{error_txt[error_txt.length]="Please select your city."; ch=1;}
				errordisp(ch,'cityselect1');
						
				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,'cityothers1');
				}
				
				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,'pcode1');
				
				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,'mob1');
				
				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,'mob1');	
				
				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,'emid1');	
				
				if(namecheck(frm.course_name,"Please enter the course name.")){ch=0;}
				else {ch=1;} 
				if(!IsEmpty(frm.course_name,'text'))
				{
					if(namecheck1(frm.course_name,'Please enter a valid course name.')){ch=0;}
					else {ch=1;}
				}
				errordisp(ch,'courname');
				
				if(namecheck(frm.name_instit,"Please enter the name of the institution.")){ch=0;}
				else {ch=1;} 
				if(!IsEmpty(frm.name_instit,'text'))
				{
					if(!ValidateNo(frm.name_instit.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ')){error_txt[error_txt.length]="Please enter a valid name of the institution."; ch=1;}
					else {ch=0;}
				}
				errordisp(ch,'insname');

				if(!IsEmpty(frm.course_name1,'text'))
				{
					if(namecheck1(frm.course_name1,'Please enter a valid course name.')){ch=0;}
					else {ch=1;}
				}
				errordisp(ch,'courname1');

				if((IsEmpty(frm.course_name1,'text')) && (!IsEmpty(frm.name_instit1,'text'))){	error_txt[error_txt.length]="Please enter the course name."; ch=1;}
				else {ch=0;}
				errordisp(ch,'courname1');

				if((!IsEmpty(frm.course_name1,'text')) && (IsEmpty(frm.name_instit1,'text'))){	error_txt[error_txt.length]="Please enter the name of the institution."; ch=1;}
				else {ch=0;}
				errordisp(ch,'insname1');

				if(!IsEmpty(frm.course_name1,'text'))
				{
						if(namecheck(frm.name_instit1,"Please enter the name of the institution.")){ch=0;}
						else {ch=1;} 
						if(!IsEmpty(frm.name_instit1,'text'))
						{
							if(namecheck1(frm.name_instit1,'Please enter a valid name of the institution.')){ch=0;}
							else {ch=1;}
						}
						errordisp(ch,'insname1');
				}

				if(!IsEmpty(frm.course_name2,'text'))
				{
					if(!ValidateNo(frm.course_name2.value,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ')){error_txt[error_txt.length]="Please enter a valid course name."; ch=1;}
					else {ch=0;}
				}
				errordisp(ch,'courname2');

				if((IsEmpty(frm.course_name2,'text')) && (!IsEmpty(frm.name_instit2,'text'))){	error_txt[error_txt.length]="Please enter the course name."; ch=1;}
				else {ch=0;}
				errordisp(ch,'courname2');
				
				if((!IsEmpty(frm.course_name2,'text')) && (IsEmpty(frm.name_instit2,'text'))){	error_txt[error_txt.length]="Please enter the name of the institution."; ch=1;}
				else {ch=0;}
				errordisp(ch,'insname2');
				
				if(!IsEmpty(frm.course_name2,'text'))
				{
					if(namecheck(frm.name_instit2,"Please enter the name of the institution.")){ch=0;}
					else {ch=1;} 
					if(!IsEmpty(frm.name_instit2,'text'))
					{
						if(namecheck1(frm.name_instit2,'Please enter a valid name of the institution.')){ch=0;}
						else {ch=1;}
					}
					errordisp(ch,'insname2');	
				}
				break;

			case "personal2": /* business loan */

				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,'fname2'); 
				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,'lname2');
				if(frm.day.value == 0 || frm.month.value == 0 || frm.year.value == 0)
				{error_txt[error_txt.length]="Please enter the day, month and year of your birth."; ch=1;}
				else {ch=0;}
				errordisp(ch,'dt2');
				
				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,'mob2');
				
				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,'mob2');	
				
				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,'emid2');	

				if(frm.employment.options[frm.employment.selectedIndex].value == 0) {error_txt[error_txt.length]="Please select the industry you belong to."; ch=1;}
				else {ch=0;}
				errordisp(ch,'employ');	

				if(frm.company_type.options[frm.company_type.selectedIndex].value == 0) {error_txt[error_txt.length]="Please select your company type."; ch=1;}
				else {ch=0;}
				errordisp(ch,'comtype');	

				if(frm.year_establish.options[frm.year_establish.selectedIndex].value == 0) {error_txt[error_txt.length]="Please select the year of establishment."; ch=1;}
				else {ch=0;}
				errordisp(ch,'estyear');	

				if(frm.city.options[frm.city.selectedIndex].value=="0")
				{error_txt[error_txt.length]="Please select your city."; ch=1;}
				errordisp(ch,'cityselect2');
						
				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,'cityothers2');
				}

				if(IsEmpty(frm.annual_turnover,'text')) {error_txt[error_txt.length]="Please enter your annual turnover."; ch=1;}
				else
				{	if(!ValidateNo(frm.annual_turnover.value,'0123456789')) {error_txt[error_txt.length]="Please enter a valid value for annual turnover."; ch=1;}
					else {ch=0;}
					if(frm.annual_turnover.value.length<2 || frm.annual_turnover.value == 0) { error_txt[error_txt.length]='Please enter a valid value for annual turnover.'; ch=1;}
				}
				errordisp(ch,'annualturn');

			break;
		}

		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 Step 2 Validation */


	/* Step 3 Validation */
	function validateStep3(obj,frm){
		var check=false;
		if(!frm.check_sms.checked)
		{	if(IsEmpty(frm.activation,"text")) {error_txt[error_txt.length]="Please check the SMS from us and enter your activation code."; ch=1;}
			else {
				if(!ValidateNo(frm.activation.value,'0123456789')) {error_txt[error_txt.length]="Please check the SMS from us and enter the correct activation code."; ch=1;}
				else {ch=0;}
			}
			errordisp(ch,'activ');
		}
	
	if(document.getElementById('providers[]'))
		{
				for(i=0;i<frm.elements.length;i++)
				{
					if(frm.elements[i].name == 'providers[]'){ if(frm.elements[i].checked == true){check=true;}}
				}
			if(check == false){error_txt[error_txt.length]="Please select atleast one bank name.";}
		}




		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_div2").innerHTML="";
				document.getElementById("error_div2").style.display='block';
				document.getElementById("error_div2").innerHTML=err_str;
				err_str="";
				error_txt=new Array();
				error_txt.length=0;
				return false;
			}
		return true;
	}
	/* End Step 3 Validation */
	
	/*function bank_onChange(Obj){
		document.getElementById("other_bank").style.display = (Obj.options[obj.selectedIndex].value =="9") ? "" : "none";
	}*/

	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){
		document.getElementById("estimatedText_yes").style.display="none";
		document.getElementById("estimatedText_no").style.display="none";
		document.getElementById("estimatedObject_yes").style.display="none";
		document.getElementById("estimatedObject_no").style.display="none";
		document.getElementById("estimatedText_"+Obj.value).style.display="";
		if(Obj.value=="no"){
			if(document.getElementById("suggestProperty").checked){
				document.getElementById("estimatedObject_"+Obj.value).style.display="";
			}
		}else{document.getElementById("estimatedObject_"+Obj.value).style.display="";}
	}

	function citychange(e,frm){

		if(!frm) frm=document.personal;
		if(frm.name=="personal"){

			if(frm.city.options[frm.city.selectedIndex].value == '37')
				{frm.other_specify.disabled=false; frm.other_specify.focus();}
			else
				{ frm.other_specify.value=''; frm.other_specify.disabled=true;}

			lblObject = document.getElementById("other_specify_text");
			otherValue = 3;
		}else if(frm.name=="personal2"){
			if(frm.city.options[frm.city.selectedIndex].value == '37')
				{frm.other_specify.disabled=false; frm.other_specify.focus();}
			else
				{ frm.other_specify.value=''; frm.other_specify.disabled=true;}
			lblObject = document.getElementById("other_specify_text_business");
			otherValue = 9;
		}else if(frm.name=="personal1"){
			if(frm.city.options[frm.city.selectedIndex].value == '37')
				{frm.other_specify.disabled=false; frm.other_specify.focus();}
			else
				{ frm.other_specify.value=''; frm.other_specify.disabled=true;}
			lblObject = document.getElementById("other_specify_text_education");
			otherValue = 3;
		}
	}

	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";
		}
	}