#!/usr/bin/perl
use CGI;
CGI::ReadParse();
$value1 = $in{Proj};
$value2 = $in{NShad};
$value3 = $in{Nsqgl};
$value4 = $in{NENW};
$value5 = $in{NENWsqgl};
$value6 = $in{EW};
$value7 = $in{EWsqgl};
$value8 = $in{SESW};
$value9 = $in{SESWsqgl};
$value10 = $in{South};
$value11 = $in{Ssqgl};
$value12 = $in{Sky};
$value13 = $in{Skysqglass};
$value14 = $in{Doors};
$value15 = $in{Doorsqglass};
$value16 = $in{walltype1};
$value17 = $in{wallsq1};
$value18 = $in{walltype2};
$value19 = $in{wallsq2};
$value20 = $in{walltype3};
$value21 = $in{wallsq3};
$value22 = $in{walltype4};
$value23 = $in{wallsq4};
$value24 = $in{ceilingtype};
$value25 = $in{ceilingsq};
$value26 = $in{floortype1};
$value27 = $in{floorsq1};
$value28 = $in{floortype2};
$value29 = $in{floorsq2};
$value30 = $in{freshsq};
$value31 = $in{people};
$value32 = $in{watts};
$value33 = $in{HP};
$value34 = $in{duct};
$value35 = $in{Light};
$value36 = $in{Lightsq};
$value37 = $in{Coffee};
$value38 = $in{ElectWarm};
$value39 = $in{GasWarm};
$value40 = $in{ElectFry};
$value41 = $in{GasFry};
$value42 = $in{ElectGrid};
$value43 = $in{GasGrid};
$value44 = $in{Helmet};
$value45 = $in{Toast};
$value46 = $in{NET1};
$value47 = $in{occupy1};
$value48 = $in{NET2};
$value49 = $in{occupy2};
$value50 = $in{NET3};
$value51 = $in{occupy3};
$value52 = $in{people1};
$value53 = $in{occupy4};
$value54 = $in{people2};
$value55 = $in{occupy5};
$value56 = $in{people3};
$value57 = $in{occupy6};
$DATE = qx(date);
print "Content-type: text/html\n\n" ;
print "<HTML>\n" ;
print "<TITLE> Project $Project </TITLE>" ;
print "<BODY>\n" ;
print "<CENTER><H1><FONT SIZE=4> Project $Project HVAC Calculations" ;
print "<P> $DATE </H3></CENTER>" ;
print "<FONT SIZE=3>";
if ($value3 eq $NULL)  {
	$Glass1=0;
	printf ("<P>There is no calculation for North & Shaded Glass </P>", );
}else{
	if($value2 eq A) {
	$Glass1=$value3*30;
		printf ("<P>The Btuh Gain for North and Shaded Single Pane Glass = <U> %s </U> </P>", $Glass1);
	}
	if($value2 eq B) {
		$Glass1=$value3*20;
		printf ("<P> The Btuh Gain for North and Shaded Double Pane Glass = <U> %s </U> </P>", $Glass1);
	}
	if($value2 eq C) {
		$Glass1=$value3*16;
		printf ("<P> The Btuh Gain for North and Shaded Triple Pane Glass = <U> %s </U> </P>", $Glass1);
	}
}



if ($value5 eq $NULL)  {
	$Glass2=0;
	printf ("<P>There is no calculation for NorthEast and NorthWest Glass </P>", );
}else{
	if($value4 eq A) {
		$Glass2=$value3*90;
		printf ("<P> The Btuh Gain for NorthEast and NorthWest Single Pane Glass = <U> %s </U></P>", $Glass2);
	}
	if($value4 eq B) {
		$Glass2=$value3*70;
		printf ("<P> The Btuh Gain for NorthEast and NorthWest Double Pane Glass = <U> %s </U> </P>", $Glass2);
	}
	if($value4 eq C) {
		$Glass2=$value3*56;
		printf ("<P> The Btuh Gain for NorthEast and NorthWest Triple Pane Glass = <U> %s </U> </P>", $Glass2);
	}	

}

if ($value7 eq $NULL)  {
	$Glass3=0;
	printf ("<P>There is no calculation for East and West Glass </P>", );
}else{
	if($value6 eq A) {
		$Glass3=$value7*110;
		printf ("<P> The Btuh Gain for East and West Single Pane Glass = <U> %s </U> </P>", $Glass3);
	}
	if($value6 eq B) {
		$Glass3=$value7*95;
		printf ("<P> The Btuh Gain for East and West Double Pane Glass = <U> %s </U> </P>", $Glass3);
	}
	if($value6 eq C) {
		$Glass3=$value7*85;
		printf ("<P> The Btuh Gain for East and West Triple Pane Glass = <U> %s </U> </P>", $Glass3);
	}	

}


if ($value9 eq $NULL)  {
	$Glass4=0;
	printf ("<P>There is no calculation for SouthEast and SouthWest Glass </P>", );
}else{
	if($value8 eq A) {
		$Glass4=$value9*110;
		printf ("<P> The Btuh Gain for SouthEast and SouthWest Single Pane Glass = <U> %s </U> </P>", $Glass4);
	}
	if($value8 eq B) {
		$Glass4=$value9*100;
		printf ("<P> The Btuh Gain for SouthEast and SouthWest Double Pane Glass = <U> %s </U> </P>", $Glass4);
	}
	if($value8 eq C) {
		$Glass4=$value9*80;
		printf ("<P> The Btuh Gain for SouthEast and SouthWest Triple Pane Glass = <U> %s </U> </P>", $Glass4);
	}	

}

if ($value11 eq $NULL)  {
	$Glass5=0;
	printf ("<P>There is no calculation for South Glass </P>", );
}else{
	if($value10 eq A) {
		$Glass5=$value11*80;
		printf ("<P> The Btuh Gain for South Single Pane Glass = <U> %s </U> </P>", $Glass5);
	}
	if($value10 eq B) {
		$Glass5=$value11*70;
		printf ("<P> The Btuh Gain for South Double Pane Glass = <U> %s </U> </P>", $Glass5);
	}
	if($value10 eq C) {
		$Glass5=$value11*55;
		printf ("<P> The Btuh Gain for South Triple Pane Glass = <U> %s </U> </P>", $Glass5);
	}	

}

if ($value13 eq $NULL)  {
	$Glass6=0;
	printf ("<P>There is no calculation for SkyLights </P>", );
}else{
	if($value12 eq A) {
		$Glass6=$value13*154;
		printf ("<P> The Btuh Gain for SkyLights  = <U> %s </U> </P>", $Glass6);
	}
	if($value12 eq B) {
		$Glass6=$value13*147;
		printf ("<P> The Btuh Gain for SkyLights = <U> %s </U> </P>", $Glass6);
	}
	if($value12 eq C) {
		$Glass6=$value13*140;
		printf ("<P> The Btuh Gain for SkyLights = <U> %s </U> </P>", $Glass6);
	}	

}

if ($value15 eq $NULL)  {
	$Glass7=0;
	printf ("<P>There is no calculation for Windows in Doors </P>", );
}else{
	if($value14 eq A) {
		$Glass7=$value15*13.2;
		printf ("<P> The Btuh Gain for Windows in Doors   = <U> %s </U> </P>", $Glass7);
	}
	if($value14 eq B) {
		$Glass7=$value15*13.2;
		printf ("<P> The Btuh Gain for Windows in Doors  = <U> %s </U> </P>", $Glass7);
	}
	if($value14 eq C) {
		$Glass7=$value15*13.2;
		printf ("<P> The Btuh Gain for Windows in Doors  = <U> %s </U> </P>", $Glass7);
	}	

}
print "<P>&nbsp;</P>";

if ($value17 eq $NULL)  {
	$Wall1=0;
	printf ("<P>There is no calculation for Wall Number 1 </P>", );
}else{
	if($value16 eq A) {
		$Wall1=$value17*10.9;
		printf ("<P> The Btuh Gain for Wall Number 1   = <U> %s </U> </P>", $Wall1);
	}
	if($value16 eq B) {
		$Wall1=$value17*3.1;
		printf ("<P> The Btuh Gain for Wall Number 1  = <U> %s </U> </P>", $Wall1);
	}
	if($value16 eq C) {
		$Wall1=$value17*1.6;
		printf ("<P> The Btuh Gain for Wall Number 1  = <U> %s </U> </P>", $Wall1);
	}	
	if($value16 eq D) {
		$Wall1=$value17*0;
		printf ("<P> The Btuh Gain for Wall Number 1   = <U> %s </U> </P>", $Wall1);
	}
	if($value16 eq E) {
		$Wall1=$value17*7.8;
		printf ("<P> The Btuh Gain for Wall Number 1  = <U> %s </U> </P>", $Wall1);
	}
	if($value16 eq F) {
		$Wall1=$value17*2.6;
		printf ("<P> The Btuh Gain for Wall Number 1  = <U> %s </U> </P>", $Wall1);
	}
	if($value16 eq G) {
		$Wall1=$value17*2.3;
		printf ("<P> The Btuh Gain for Wall Number 1  = <U> %s </U> </P>", $Wall1);
	}
	if($value16 eq H) {
		$Wall1=$value17*1.7;
		printf ("<P> The Btuh Gain for Wall Number 1  = <U> %s </U> </P>", $Wall1);
	}
		
}

if ($value19 eq $NULL)  {
	$Wall2=0;
	printf ("<P>There is no calculation for Wall Number 2 </P>", );
}else{
	if($value18 eq A) {
		$Wall2=$value19*10.9;
		printf ("<P> The Btuh Gain for Wall Number 2   = <U> %s </U> </P>", $Wall2);
	}
	if($value18 eq B) {
		$Wall2=$value19*3.1;
		printf ("<P> The Btuh Gain for Wall Number 2  = <U> %s </U> </P>", $Wall2);
	}
	if($value18 eq C) {
		$Wall2=$value19*1.6;
		printf ("<P> The Btuh Gain for Wall Number 2  = <U> %s </U> </P>", $Wall2);
	}	
	if($value18 eq D) {
		$Wall2=$value19*0;
		printf ("<P> The Btuh Gain for Wall Number 2   = <U> %s </U> </P>", $Wall2);
	}
	if($value18 eq E) {
		$Wall2=$value19*7.8;
		printf ("<P> The Btuh Gain for Wall Number 2  = <U> %s </U> </P>", $Wall2);
	}
	if($value18 eq F) {
		$Wall2=$value19*2.6;
		printf ("<P> The Btuh Gain for Wall Number 2  = <U> %s </U> </P>", $Wall2);
	}
	if($value18 eq G) {
		$Wall2=$value19*2.3;
		printf ("<P> The Btuh Gain for Wall Number 2   = <U> %s </U> </P>", $Wall2);
	}
	if($value18 eq H) {
		$Wall2=$value19*1.7;
		printf ("<P> The Btuh Gain for Wall Number 2  = <U> %s </U> </P>", $Wall2);
	}
		
}




if ($value21 eq $NULL)  {
	$Wall3=0;
	printf ("<P>There is no calculation for Wall Number 3 </P>", );
}else{
	if($value20 eq A) {
		$Wall3=$value21*10.9;
		printf ("<P> The Btuh Gain for Wall Number 3   = <U> %s </U> </P>", $Wall3);
	}
	if($value20 eq B) {
		$Wall3=$value21*3.1;
		printf ("<P> The Btuh Gain for Wall Number 3  = <U> %s </U> </P>", $Wall3);
	}
	if($value20 eq C) {
		$Wall3=$value21*1.6;
		printf ("<P> The Btuh Gain for Wall Number 3  = <U> %s </U> </P>", $Wall3);
	}	
	if($value20 eq D) {
		$Wall3=$value21*0;
		printf ("<P> The Btuh Gain for Wall Number 3   = <U> %s </U> </P>", $Wall3);
	}
	if($value20 eq E) {
		$Wall3=$value21*7.8;
		printf ("<P> The Btuh Gain for Wall Number 3  = <U> %s </U> </P>", $Wall3);
	}
	if($value20 eq F) {
		$Wall3=$value21*2.6;
		printf ("<P> The Btuh Gain for Wall Number 3  = <U> %s </U> </P>", $Wall3);
	}
	if($value20 eq G) {
		$Wall3=$value21*2.3;
		printf ("<P> The Btuh Gain for Wall Number 3   = <U> %s </U> </P>", $Wall3);
	}
	if($value20 eq H) {
		$Wall3=$value21*1.7;
		printf ("<P> The Btuh Gain for Wall Number 3  = <U> %s </U> </P>", $Wall3);
	}
		
}




if ($value23 eq $NULL)  {
	$Wall4=0;
	printf ("<P>There is no calculation for Wall Number 4 </P>", );
}else{
	if($value22 eq A) {
		$Wall4=$value23*10.9;
		printf ("<P> The Btuh Gain for Wall Number 4   = <U> %s </U> </P>", $Wall4);
	}
	if($value22 eq B) {
		$Wall4=$value23*3.1;
		printf ("<P> The Btuh Gain for Wall Number 4   = <U> %s </U> </P>", $Wall4);
	}
	if($value22 eq C) {
		$Wall4=$value23*1.6;
		printf ("<P> The Btuh Gain for Wall Number 4   = <U> %s </U> </P>", $Wall4);
	}	
	if($value22 eq D) {
		$Wall4=$value23*0;
		printf ("<P> The Btuh Gain for Wall Number 4   = <U> %s </U> </P>", $Wall4);
	}
	if($value22 eq E) {
		$Wall4=$value23*7.8;
		printf ("<P> The Btuh Gain for Wall Number 4   = <U> %s </U> </P>", $Wall4);
	}
	if($value22 eq F) {
		$Wall4=$value23*2.6;
		printf ("<P> The Btuh Gain for Wall Number 4   = <U> %s </U> </P>", $Wall4);
	}
	if($value22 eq G) {
		$Wall4=$value23*2.3;
		printf ("<P> The Btuh Gain for Wall Number 4   = <U> %s </U> </P>", $Wall4);
	}
	if($value22 eq H) {
		$Wall4=$value23*1.7;
		printf ("<P> The Btuh Gain for Wall Number 4   = <U> %s </U> </P>", $Wall4);
	}
		
}

print "<P>&nbsp;</P>";

if ($value25 eq $NULL)  {
	$Ceiling1=0;
	printf ("<P>There is no calculation for Ceiling Number 1 </P>", );
	}else{
	if($value24 eq A) {
		$Ceiling1=$value25*43;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq B) {
		$Ceiling1=$value25*11;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq C) {
		$Ceiling1=$value25*8.2;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}	
	if($value24 eq D) {
		$Ceiling1=$value25*5.2;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq E) {
		$Ceiling1=$value25*4.8;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq F) {
		$Ceiling1=$value25*3.2;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq G) {
		$Ceiling1=$value25*2.6;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq H) {
		$Ceiling1=$value25*2.2;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq I) {
		$Ceiling1=$value25*28;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq J) {
		$Ceiling1=$value25*7;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq K) {
		$Ceiling1=$value25*4.8;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq L) {
		$Ceiling1=$value25*4.8;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}
	if($value24 eq M) {
		$Ceiling1=$value25*4;
		printf ("<P> The Btuh Gain for Ceiling Number 1  = <U> %s </U> </P>", $Ceiling1);
	}

}

print "<P>&nbsp;</P>";

if ($value27 eq $NULL)  {
	$Floor1=0;
	printf ("<P>There is no calculation for Floor Number 1 </P>", );
	}else{
	if($value26 eq A) {
		$Floor1=$value27*0;
		printf ("<P> The Btuh Gain for Floor Number 1  = <U> %s </U> </P>", $Floor1);
	}
	if($value26 eq B) {
		$Floor1=$value27*7.7;
		printf ("<P> The Btuh Gain for Floor Number 1  = <U> %s </U> </P>", $Floor1);
	}
	if($value26 eq C) {
		$Floor1=$value27*1.7;
		printf ("<P> The Btuh Gain for Floor Number 1  = <U> %s </U> </P>", $Floor1);
	}	
	if($value26 eq D) {
		$Floor1=$value27*1.1;
		printf ("<P> The Btuh Gain for Floor Number 1  = <U> %s </U> </P>", $Floor1);
	}		
}


if ($value29 eq $NULL)  {
	$Floor2=0;
	printf ("<P>There is no calculation for Floor Number 2 </P>", );
	}else{
	if($value28 eq A) {
		$Floor2=$value29*0;
		printf ("<P> The Btuh Gain for Floor Number 2 = <U> %s </U> </P>", $Floor2);
	}
	if($value26 eq B) {
		$Floor2=$value29 *7.7;
		printf ("<P> The Btuh Gain for Floor Number 2 = <U> %s </U> </P>", $Floor2);
	}
	if($value26 eq C) {
		$Floor2=$value29 *1.7;
		printf ("<P> The Btuh Gain for Floor Number 2 = <U> %s </U> </P>", $Floor2);
	}	
	if($value26 eq D) {
		$Floor2=$value29 *1.1;
		printf ("<P> The Btuh Gain for Floor Number 2 = <U> %s </U> </P>", $Floor2);
	}		
}


print "<P>&nbsp;</P>";

if ($value30 eq $NULL)  {
	$Vent=0;
	printf ("<P>There is no calculation for Ventilation </P>", );
	}else{
	$Vent=$value30*6;
	printf ("<P> The Btuh Gain for Ventilation  = <U> %s </U> </P>", $Vent);
}

print "<P>&nbsp;</P>";


if ($value31 eq $NULL)  {
	$People=0;
	printf ("<P>There is no calculation for People </P>", );
	}else{
	$People=$value31*10;
	printf ("<P> The Btuh Gain for People = <U> %s </U> </P>", $People);
}


print "<P>&nbsp;</P>";



if ($value33 eq $NULL)  {
	$Motor=0;
	printf ("<P>There is no calculation for Motor HP   </P>", );
	}else{
	$Motor=$value33*3500;
	printf ("<P> The Btuh Gain for Motor HP   = <U> %s </U> </P>", $Motor);
}


print "<P>&nbsp;</P>";

if ($value34 eq $NULL)  {
	$Duct=0;
	printf ("<P>There is no calculation for Ducts Out of Conditioned Spaces  </P>", );
	}else{
	$Duct=$value34*.1;
	printf ("<P> The Btuh Gain for Ducts Out of Conditioned Spaces  = <U> %s </U> </P>", $Duct);
}


print "<P>&nbsp;</P>";

if ($value36 eq $NULL)  {
	$Light=0;
	printf ("<P>There is no calculation for Lighting </P>", );
}else{
	if($value35 eq A) {
		$Light=$value36*3;
		printf ("<P> The Btuh Gain for Lighting in an Office  = <U> %s </U></P>", $Light);
	}
	if($value35 eq B) {
		$Light=$value36*4;
		printf ("<P> The Btuh Gain for for Lighting in a Retail Store = <U> %s </U> </P>", $Light);
	}
}

print "<P>&nbsp;</P>";

if ($value37 eq $NULL)  {
	$coffee=0;
	printf ("<P>There is no calculation for Coffee Machines  </P>", );
	}else{
	$coffee=$value37*470;
	printf ("<P> The wattage for Coffee Machines = <U> %s </U> </P>", $coffee);
}

if ($value38 eq $NULL)  {
	$elwarm=0;
	printf ("<P>There is no calculation for Electric Food Warmers  </P>", );
	}else{
	$elwarm=$value38*120;
	printf ("<P> The wattage for  Electric Food Warmers  = <U> %s </U> </P>", $elwarm);
}

if ($value39 eq $NULL)  {
	$gwarm=0;
	printf ("<P>There is no calculation for Gas Food Warmers  </P>", );
	}else{
	$gwarm=$value39*120;
	printf ("<P> The wattage for Gas Food Warmers  = <U> %s </U> </P>", $gwarm);
}


if ($value40 eq $NULL)  {
	$elfry=0;
	printf ("<P>There is no calculation for Electric Fry Kettle  </P>", );
	}else{
	$elfry=$value40*1400;
	printf ("<P> The wattage for  Electric Fry Kettle  = <U> %s </U> </P>", $elfry);
}

if ($value41 eq $NULL)  {
	$gfry=0;
	printf ("<P>There is no calculation for Gas Fry Kettle  </P>", );
	}else{
	$gfry=$value41*2000;
	printf ("<P> The wattage for Gas Fry Kettle  = <U> %s </U> </P>", $gfry);
}

if ($value42 eq $NULL)  {
	$elgrid=0;
	printf ("<P>There is no calculation for Electric Griddle  </P>", );
	}else{
	$elgrid=$value42*1400;
	printf ("<P> The wattage for  Electric Griddle  = <U> %s </U> </P>", $elgrid);
}

if ($value43 eq $NULL)  {
	$ggrid=0;
	printf ("<P>There is no calculation for Gas Griddle  </P>", );
	}else{
	$ggrid=$value43*2000;
	printf ("<P> The wattage for Gas Griddle  = <U> %s </U> </P>", $ggrid);
}

if ($value44 eq $NULL)  {
	$helmet=0;
	printf ("<P>There is no calculation for Hair Dryer Helmets  </P>", );
	}else{
	$helmet=$value44*650;
	printf ("<P> The wattage for  Hair Dryer Helmets = <U> %s </U> </P>", $helmet);
}

if ($value45 eq $NULL)  {
	$toast=0;
	printf ("<P>There is no calculation for 4-Slice Toaster  </P>", );
	}else{
	$toast=$value45*1230;
	printf ("<P> The wattage for  4-Slice Toaster  = <U> %s </U> </P>", $toast);
}

if ($value46 eq $NULL)  {
	$ocfreshbtu1=0;
	printf ("<P>There is no calculation for Fresh Air #1</P>", );
	}else{
	if($value47 eq A) {
		$ocfresh1=$value46/1000*70*20;
		$ocfreshbtu1=$ocfresh1/400;
		printf ("<P> The Dining Room Fresh Air #1   = <U> %s </U> cfm</P>", $ocfresh1);
		printf ("<P> The Btuh Gain for Fresh Air #1  = <U> %s </U> </P>", $ocfreshbtu1);
	}
	if($value47 eq B) {
		$ocfresh1=$value46/1000*100*20;
		$ocfreshbtu1=$ocfresh1/400;
		printf ("<P> The Cafeteria or Fast Food Fresh Air #1   = <U> %s </U>cfm </P>", $ocfresh1);
		printf ("<P> The Btuh Gain for Fresh Air #1  = <U> %s </U> </P>", $ocfreshbtu1);
	}
	if($value47 eq C) {
		$ocfresh1=$value46/1000*20*15;
		$ocfreshbtu1=$ocfresh1/400;
		printf ("<P> The Kitchen Fresh Air #1   = <U> %s </U> cfm</P>", $ocfresh1);
		printf ("<P> The Btuh Gain for Fresh Air #1  = <U> %s </U> </P>", $ocfreshbtu1);
	}
	if($value47 eq D) {
		$ocfresh1=$value46/1000*7*20;
		$ocfreshbtu1=$ocfresh1/400;
		printf ("<P> The Office Space Fresh Air #1   = <U> %s </U>cfm </P>", $ocfresh1);
		printf ("<P> The Btuh Gain for Fresh Air #1  = <U> %s </U> </P>", $ocfreshbtu1);
	}
	if($value47 eq E) {
		$ocfresh1=$value46/1000*60*15;
		$ocfreshbtu1=$ocfresh1/400;
		printf ("<P> The Reception Area Fresh Air #1   = <U> %s </U> cfm</P>", $ocfresh1);
		printf ("<P> The Btuh Gain for Fresh Air #1  = <U> %s </U> </P>", $ocfreshbtu1);
	}

}

if ($value48 eq $NULL)  {
	$ocfreshbtu2=0;
	printf ("<P>There is no calculation for Fresh Air #2</P>", );
	}else{
	if($value49 eq A) {
		$ocfresh2=$value48/1000*70*20;
		$ocfreshbtu2=$ocfresh2/400;
		printf ("<P> The Dining Room Fresh Air #2   = <U> %s </U> cfm</P>", $ocfresh2);
		printf ("<P> The Btuh Gain for Fresh Air #2  = <U> %s </U> </P>", $ocfreshbtu2);
	}
	if($value49 eq B) {
		$ocfresh2=$value48/1000*100*20;
		$ocfreshbtu2=$ocfresh2/400;
		printf ("<P> The Cafeteria or Fast Food Fresh Air #2   = <U> %s </U>cfm </P>", $ocfresh2);
		printf ("<P> The Btuh Gain for Fresh Air #2  = <U> %s </U> </P>", $ocfreshbtu2);
	}
	if($value49 eq C) {
		$ocfresh2=$value48/1000*20*15;
		$ocfreshbtu2=$ocfresh2/400;
		printf ("<P> The Kitchen Fresh Air #2   = <U> %s </U> cfm</P>", $ocfresh2);
		printf ("<P> The Btuh Gain for Fresh Air #2  = <U> %s </U> </P>", $ocfreshbtu2);
	}
	if($value49 eq D) {
		$ocfresh2=$value48/1000*7*20;
		$ocfreshbtu2=$ocfresh2/400;
		printf ("<P> The Office Space Fresh Air #2   = <U> %s </U>cfm </P>", $ocfresh2);
		printf ("<P> The Btuh Gain for Fresh Air #2  = <U> %s </U> </P>", $ocfreshbtu2);
	}
	if($value49 eq E) {
		$ocfresh2=$value48/1000*60*15;
		$ocfreshbtu2=$ocfresh2/400;
		printf ("<P> The Reception Area Fresh Air #2  = <U> %s </U> cfm</P>", $ocfresh2);
		printf ("<P> The Btuh Gain for Fresh Air #2  = <U> %s </U> </P>", $ocfreshbtu2);
	}

}

if ($value50 eq $NULL)  {
	$ocfreshbtu3=0;
	printf ("<P>There is no calculation for Fresh Air #3</P>", );
	}else{
	if($value51 eq A) {
		$ocfresh3=$value50/1000*70*20;
		$ocfreshbtu3=$ocfresh3/400;
		printf ("<P> The Dining Room Fresh Air #3   = <U> %s </U> cfm</P>", $ocfresh3);
		printf ("<P> The Btuh Gain for Fresh Air #3  = <U> %s </U> </P>", $ocfreshbtu3);
	}
	if($value51 eq B) {
		$ocfresh3=$value50/1000*100*20;
		$ocfreshbtu3=$ocfresh3/400;
		printf ("<P> The Cafeteria or Fast Food Fresh Air #3   = <U> %s </U>cfm </P>", $ocfresh3);
		printf ("<P> The Btuh Gain for Fresh Air #3  = <U> %s </U> </P>", $ocfreshbtu3);
	}
	if($value51 eq C) {
		$ocfresh3=$value50/1000*20*15;
		$ocfreshbtu3=$ocfresh3/400;
		printf ("<P> The Kitchen Fresh Air #3   = <U> %s </U> cfm</P>", $ocfresh3);
		printf ("<P> The Btuh Gain for Fresh Air #3  = <U> %s </U> </P>", $ocfreshbtu3);
	}
	if($value51 eq D) {
		$ocfresh3=$value50/1000*7*20;
		$ocfreshbtu3=$ocfresh3/400;
		printf ("<P> The Office Space Fresh Air #3   = <U> %s </U>cfm </P>", $ocfresh3);
		printf ("<P> The Btuh Gain for Fresh Air #3  = <U> %s </U> </P>", $ocfreshbtu3);
	}
	if($value51 eq E) {
		$ocfresh3=$value50/1000*60*15;
		$ocfreshbtu3=$ocfresh3/400;
		printf ("<P> The Reception Area Fresh Air #3  = <U> %s </U> cfm</P>", $ocfresh3);
		printf ("<P> The Btuh Gain for Fresh Air #3  = <U> %s </U> </P>", $ocfreshbtu3);
	}

}


if ($value52 eq $NULL)  {
	$ocfreshbtu4=0;
	printf ("<P>There is no calculation for Fresh Air #4</P>", );
	}else{
	if($value53 eq A) {
		$ocfresh4=$value52*20;
		$ocfreshbtu4=$ocfresh4/400;
		printf ("<P> The Dining Room Fresh Air #4   = <U> %s </U> cfm</P>", $ocfresh4);
		printf ("<P> The Btuh Gain for Fresh Air #4  = <U> %s </U> </P>", $ocfreshbtu4);
	}
	if($value53 eq B) {
		$ocfresh4=$value52*20;
		$ocfreshbtu4=$ocfresh4/400;
		printf ("<P> The Cafeteria or Fast Food Fresh Air #4   = <U> %s </U>cfm </P>", $ocfresh4);
		printf ("<P> The Btuh Gain for Fresh Air #4  = <U> %s </U> </P>", $ocfreshbtu4);
	}
	if($value53 eq C) {
		$ocfresh4=$value52*15;
		$ocfreshbtu4=$ocfresh4/400;
		printf ("<P> The Kitchen Fresh Air #4   = <U> %s </U> cfm</P>", $ocfresh4);
		printf ("<P> The Btuh Gain for Fresh Air #4  = <U> %s </U> </P>", $ocfreshbtu4);
	}
	if($value53 eq D) {
		$ocfresh4=$value52*20;
		$ocfreshbtu4=$ocfresh4/400;
		printf ("<P> The Office Space Fresh Air #4   = <U> %s </U>cfm </P>", $ocfresh4);
		printf ("<P> The Btuh Gain for Fresh Air #4  = <U> %s </U> </P>", $ocfreshbtu4);
	}
	if($value53 eq E) {
		$ocfresh4=$value52*15;
		$ocfreshbtu4=$ocfresh4/400;
		printf ("<P> The Reception Area Fresh Air #4  = <U> %s </U> cfm</P>", $ocfresh4);
		printf ("<P> The Btuh Gain for Fresh Air #4  = <U> %s </U> </P>", $ocfreshbtu4);
	}

}


if ($value54 eq $NULL)  {
	$ocfreshbtu5=0;
	printf ("<P>There is no calculation for Fresh Air #5</P>", );
	}else{
	if($value55 eq A) {
		$ocfresh5=$value54*20;
		$ocfreshbtu5=$ocfresh5/400;
		printf ("<P> The Dining Room Fresh Air #5   = <U> %s </U> cfm</P>", $ocfresh5);
		printf ("<P> The Btuh Gain for Fresh Air #5  = <U> %s </U> </P>", $ocfreshbtu5);
	}
	if($value55 eq B) {
		$ocfresh5=$value54*20;
		$ocfreshbtu5=$ocfresh5/400;
		printf ("<P> The Cafeteria or Fast Food Fresh Air #5   = <U> %s </U>cfm </P>", $ocfresh5);
		printf ("<P> The Btuh Gain for Fresh Air #5  = <U> %s </U> </P>", $ocfreshbtu5);
	}
	if($value55 eq C) {
		$ocfresh5=$value54*15;
		$ocfreshbtu5=$ocfresh5/400;
		printf ("<P> The Kitchen Fresh Air #5   = <U> %s </U> cfm</P>", $ocfresh5);
		printf ("<P> The Btuh Gain for Fresh Air #5  = <U> %s </U> </P>", $ocfreshbtu5);
	}
	if($value55 eq D) {
		$ocfresh5=$value54*20;
		$ocfreshbtu5=$ocfresh5/400;
		printf ("<P> The Office Space Fresh Air #5   = <U> %s </U>cfm </P>", $ocfresh5);
		printf ("<P> The Btuh Gain for Fresh Air #5  = <U> %s </U> </P>", $ocfreshbtu5);
	}
	if($value55 eq E) {
		$ocfresh5=$value54*15;
		$ocfreshbtu5=$ocfresh5/400;
		printf ("<P> The Reception Area Fresh Air #5  = <U> %s </U> cfm</P>", $ocfresh5);
		printf ("<P> The Btuh Gain for Fresh Air #5  = <U> %s </U> </P>", $ocfreshbtu5);
	}

}

if ($value56 eq $NULL)  {
	$ocfreshbtu6=0;
	printf ("<P>There is no calculation for Fresh Air #6</P>", );
	}else{
	if($value57 eq A) {
		$ocfresh6=$value56*20;
		$ocfreshbtu6=$ocfresh6/400;
		printf ("<P> The Dining Room Fresh Air #6   = <U> %s </U> cfm</P>", $ocfresh6);
		printf ("<P> The Btuh Gain for Fresh Air #6  = <U> %s </U> </P>", $ocfreshbtu6);
	}
	if($value57 eq B) {
		$ocfresh6=$value56*20;
		$ocfreshbtu6=$ocfresh6/400;
		printf ("<P> The Cafeteria or Fast Food Fresh Air #6   = <U> %s </U>cfm </P>", $ocfresh6);
		printf ("<P> The Btuh Gain for Fresh Air #6  = <U> %s </U> </P>", $ocfreshbtu6);
	}
	if($value57 eq C) {
		$ocfresh6=$value56*15;
		$ocfreshbtu6=$ocfresh6/400;
		printf ("<P> The Kitchen Fresh Air #6   = <U> %s </U> cfm</P>", $ocfresh6);
		printf ("<P> The Btuh Gain for Fresh Air #6  = <U> %s </U> </P>", $ocfreshbtu6);
	}
	if($value57 eq D) {
		$ocfresh6=$value56*20;
		$ocfreshbtu6=$ocfresh6/400;
		printf ("<P> The Office Space Fresh Air #6   = <U> %s </U>cfm </P>", $ocfresh6);
		printf ("<P> The Btuh Gain for Fresh Air #6  = <U> %s </U> </P>", $ocfreshbtu6);
	}
	if($value57 eq E) {
		$ocfresh6=$value56*15;
		$ocfreshbtu6=$ocfresh6/400;
		printf ("<P> The Reception Area Fresh Air #6  = <U> %s </U> cfm</P>", $ocfresh6);
		printf ("<P> The Btuh Gain for Fresh Air #6  = <U> %s </U> </P>", $ocfreshbtu6);
	}

}

print "<P>&nbsp;</P>";
	$app=$coffee+$elwarm+$gwarm+$elfry+$gfry+$elgrid+$ggrid+$helmet+$toast;
	$APP=$app*3.4;
	printf ("<P> The Total wattages for Appliances = <U> %s </U> </P>", $app);
	printf ("<P> The BTUh Gain for Appliances = <U> %s </U> </P>", $APP);
print "<P>&nbsp;</P>";

$Total=$Glass1+$Glass2+$Glass3+$Glass4+$Glass5+$Glass6+$Glass7+$Wall1+$Wall2+$Wall3+$Wall4+$Ceiling1+$Floor1+$Floor2+$Vent+$People+$APP+$Motor+$Duct+$Light;
printf ("<P> The Total BTUh Gain  = <U> %s </U> </P>", $Total);
$TON=$Total/12000;
printf ("<P> The Total Tons of HVAC needed = <U> %s </U> </P>", $TON);
print "<P>&nbsp;</P>";
print "</BODY></HTML>\n";
#print $DATE;

$NULL=
#$queryString = $ENV{QUERY_STRING};
#qx(/usr/contrib/lib/httpd/cgi-bin/syslog.today);
#if ($queryString eq $NULL) {
#print "You did not send data\n";
##use Shell qw(syslog.today);
#@TEST=qx(syslog.today);
#print @TEST
#} else {
#use Shell qw(syslog.today);
#}
exit(0);
