function calculate() 
{
	var y=document.Calculator.years.value;
	var cycles=document.Calculator.payperyear.selectedIndex;
	var temp;
	var temp2=document.Calculator.payperyear.options[cycles].value;
	var temp3=temp2*document.Calculator.years.value;
	temp=document.Calculator.interest.value/temp2;
	temp=document.Calculator.principle.value*temp/(1-Math.pow(1+temp,-temp3));
	temp=temp.toString();
	ind=temp.indexOf(".");
	temp=temp.substring(0,ind+3);
	if(isNaN(temp))
		{
		alert("Looks like you entered somthing incorrectly. Please check it over and resubmit");
		}
	document.Calculator.payment.value=+temp; 
}

		