function validate()
{
	if(document.info.userocc.options[document.info.userocc.selectedIndex].value=="0")
		{
			alert("Please select occupation.");
			document.info.userocc.focus();
			return false;
		}

	if(isNaN(document.info.cprice.value))
		{
			alert('Please enter only numbers')
			document.info.cprice.focus
			return false
		}
	if(document.info.cprice.value=="")
		{
			alert('Please enter the loan amount')
			document.info.cprice.focus
			return false
		}
	if (document.info.cprice.value<50000 || document.info.cprice.value>1500000)	{
		alert('Loan amount cannot be less than 50000 or greater than 1500000');
		document.info.cprice.focus()
		return false;
	}
	calculate()
	return false;
}

function validate1()
{
	
	if(isNaN(document.info.cprice.value))
		{
			alert('Please enter only numbers')
			document.info.cprice.focus
			return false
		}
	if(document.info.cprice.value=="")
		{
			alert('Please enter the loan amount')
			document.info.cprice.focus
			return false
		}
	if (document.info.cprice.value<50000 || document.info.cprice.value>1500000)	{
		alert('Loan amount cannot be less than 50000 or greater than 1500000');
		document.info.cprice.focus()
		return false;
	}
	if((parseFloat(document.info.elgamt.value))>=(parseFloat(document.info.cprice.value)))
		{
			calculate1()
			return false;
		}
	//return false;
}
function calculate()
	{
		cprice=document.info.cprice.value
		//loanprd=document.info.tenor.options[document.info.tenor.selectedIndex].value
		loanprd="36"
		//intper=document.info.intper.options[document.info.intper.selectedIndex].value
		userocc=document.info.userocc.options[document.info.userocc.selectedIndex].value

		if(userocc=="Self-Employed Businessman - Manufacturer" || userocc=="Self-Employed Businessman - Services" || userocc=="Self-Employed Businessman - Trader")
			{
				intper="3767"
			}
		else
			{
				intper="3515"
			}
		cprice=Math.round(cprice)
		emi=Math.round(cprice*intper/100000)
		document.info.lo1.value=cprice
		document.info.emi.value=emi
		//document.info.mo1.value=loanprd
		document.getElementById(1).style.display=""
		document.getElementById(2).style.display=""
	}
function calculate1()
	{
		cprice=document.info.cprice.value
		//loanprd=document.info.tenor.options[document.info.tenor.selectedIndex].value
		loanprd="36"
		//intper=document.info.intper.options[document.info.intper.selectedIndex].value
		userocc=document.info.userocc.value

		if(userocc=="Self-Employed Businessman - Manufacturer" || userocc=="Self-Employed Businessman - Services" || userocc=="Self-Employed Businessman - Trader")
			{
				intper="3767"
			}
		else
			{
				intper="3515"
			}
		cprice=Math.round(cprice)
		emi=Math.round(cprice*intper/100000)
		document.info.lo1.value=cprice
		document.info.emi.value=emi
		//document.info.mo1.value=loanprd
		document.getElementById(1).style.display=""
		document.getElementById(2).style.display=""
		
		
	}
function resetForm()
	{
		document.info.reset()
		document.getElementById(1).style.display="none"
		document.getElementById(2).style.display="none"
	}

