var inputBPM = 120;
var wholeN, HalfN, qtrN, eighthN, sixteenN, thirtyTwoN, sixtyFourN;
var sixN, twelveNote, twentyFourN;

function calcDelay(){
	with (document.bpmCalculator){
		inputBPM=bpm.value;
		//Math.round((promoPrice+15)*100)/100;
		//calc quarter note in milliseconds
			qtrN=Math.round(((60/inputBPM)*1000)*100000)/100000;
			wholeN=(qtrN*4);
			halfN=(qtrN*2);
			eighthN=(qtrN/2);
			sixteenN=(qtrN/4);
			thrityTwoN=(qtrN/8);
			sixtyFourN=(qtrN/16);
			sixN=(wholeN/6);
			twelveN=(wholeN/12);
			twentyFourN=(wholeN/24);
			//round the values to 5 decimal places
				qtrN=Math.round(qtrN*100000)/100000; 
					document.getElementById("quarterNote").innerHTML=qtrN;
				wholeN=Math.round(wholeN*100000)/100000; 
					document.getElementById("wholeNote").innerHTML=wholeN;
				halfN=Math.round(halfN*100000)/100000; 
					document.getElementById("halfNote").innerHTML=halfN;
				eighthN=Math.round(eighthN*100000)/100000; 
					document.getElementById("eightNote").innerHTML=eighthN;
				sixteenN=Math.round(sixteenN*100000)/100000; 
					document.getElementById("sixteenNote").innerHTML=sixteenN;
				thrityTwoN=Math.round(thrityTwoN*100000)/100000; 
					document.getElementById("32Note").innerHTML=thrityTwoN;
				sixtyFourN=Math.round(sixtyFourN*100000)/100000; 
					document.getElementById("64Note").innerHTML=sixtyFourN;
				sixN=Math.round(sixN*100000)/100000; 
					document.getElementById("6Note").innerHTML=sixN;
				twelveN=Math.round(twelveN*100000)/100000; 
					document.getElementById("12Note").innerHTML=twelveN;
				twentyFourN=Math.round(twentyFourN*100000)/100000; 
					document.getElementById("24Note").innerHTML=twentyFourN;
	}
}
