// JavaScript Document
function doRFQSubmit()
{
	var frm = document.forms[0];
	
	//check name
	if ( frm["Name"].value == "" )
	{
		alert( "Please enter your name" );
		frm["Name"].focus();
		return false
	}
	//check email or phone
	if ( !IsEmail( frm["Email"].value ) && !IsPhoneAdv( frm["Phone"].value ) )
	{
		alert( "Please enter your email address and/or your phone number" );
		frm["Email"].focus();
		return false;
	}
	
	frm.submit();
}
function CFMCalc()
{
	var frm = document.frmCFMCalc;
	var l = parseFloat( frm.length.value );
	var w = parseFloat( frm.width.value );
	var h = parseFloat( frm.height.value );
	var acsel = frm.air_changes;
	var ac = parseInt( acsel.options[ acsel.selectedIndex ].value );
	var cfm = Math.round( (l*w*h*ac)/60 );
	
	$('#CFM_REQ').html( l+'x'+w+'x'+h+'x'+ac+' = ' + cfm + ' cfm' );
	$.fn.colorbox.close();
	$.get("popups/cfm_calc.php?save=true", { length: l, width: w , height: h, changes: ac, cfm: cfm } );
}