//Copyright c 2004-2008 Quadrix Corporation Ltd and its subsidiary Quadrix Energy ltd

// An original script by Peter O'Donnell if you wish to use this script or any part of it 
// you must first contact the author. Permission may be granted at the sole discretion of 
// the copyright owners and the author
// 
function calcSize() {
	if ((document.gel.lpm.value == "") || (document.gel.trise.value == "")) {
		alert ("All input fields must have a value")	
	}
	else {
		var mylpm = document.gel.lpm.value; 
		var mytrise = document.gel.trise.value;
		var mypwr = ((mylpm * mytrise)/14.381);
		if (document.getElementById) {
			var message = document.getElementById('msg');
			message.innerHTML = "Your system should be at least <font color=red>" + mypwr.toFixed(2)  + "</font> Kw";
		}
	}
}

function calcRate() {
	if ((document.gem.Kw.value == "") || (document.gem.trise.value == "")) {
		alert ("All input fields must have a value")	
	}
	else {
		var mypwr = document.gem.Kw.value; 
		var mytrise = document.gem.trise.value;
		var mylpm = ((mypwr * 14.381)/mytrise);
		if (document.getElementById) {
			var message = document.getElementById('gsm');
			message.innerHTML = "The maximum flow rate of your system is <font color=red>" + mylpm.toFixed(2)  + "</font> LPM";
		}
	}
}
function calcRise() {
	if ((document.temps.tbase.value == "") || (document.temps.tuser.value == "")) {
		alert ("All input fields must have a value")	
	}
	else {
		var mytbase = document.temps.tbase.value; 
		var mytuser = document.temps.tuser.value;
		var mytrise = (mytuser - mytbase);
		if (document.getElementById) {
			var message = document.getElementById('smg');
			message.innerHTML = "Your rise in temperature is <font color=red>" + mytrise.toFixed(2)  + "</font> &deg;C";
		}
	}
}