

var dailyrain=(0);
var wdry	=  (0);
var wsxt	=  (0);
var wwx	=  (0);
var tch   	=  (0);
var fnum =  (0);
var winx 	=  (0);
var tt    	=  (0);
var wdc 	=  (0);
var dt 	=  (0);
var misx	=  (0);
var mis	=  (0);
var wmis	=  (0);
var dph	=  (0);
var bdi 	=  (0);
var dew	=  (0);
var hic 	=  (0);
var sx 	=  (0);
var lwet 	=  (0);
var rh	=  (0);
var prr	=  (0);
var ppx	=  (0);

//  { document.write ( "<B>" +  "SKY "    +  ww   + "<BR>" + "</B>" ); }
//   OCTOBER 13, 2005   10:24 AM

var ch1t = "46.0";
var ch1h = "16";
var ch2t = "48.0";
var ch2h = "0";
var ch3t = "49.0";
var ch3h = "0";





//<!--FIRST DATE Info-->
var dateStr =" 2/5/12 ";
dateStr = dateStr.split("/");
var month = dateStr[0];
var day = dateStr[1];

//<!--TIME  Info-->
var now = new Date();
var hh  =now.getHours();
var mo  =now.getMonth();
var year =now.getFullYear();
var min =now.getMinutes();
var mm  =(mo  + 1) ;
var a    = (hh) ;

//<!--TIME  In Day in Sec-->
tid=(hh*3600)+(min*60)

//{ document.write ( "<B>" +  "sec in today"    +  tid   + "<BR>" + "</B>" ); }

//<!--SUN & MOON INFO-->
var srise = "7:14";
var sset = "17:41";
var mooph = "13";

//<!--CURRENT SOLAR RADITATION-->
var sr = "146";

//<!--CHANGE LAST HOUR SOLAR RADITATION-->
var srch = "-51";

//<!--TODAY'S AVERAGE SOLAR RADITATION-->
var srave = "136";

//<!--  MAX. SOLAR RADIATION-->
var srhi = "394";
var srmhi = "860";
var sryhi = "860";

//<!--MOISTURE SENSORS-->
var pretime = "2:01";
if (pretime== "0:00") {var pretime  = " midnight ";}
else {var pretime = "2:01" ;}


var dewx = "0";
var lwet = "0";

var stime = "2:01";
var xwet = "15";
var yesmaxwet = "15";
var yesmaxwettime = "15:33";

var dateStr = "15:33" ;
dateStr = dateStr.split(":");
var yeshr  = dateStr[0];

var tothr = (24 - yeshr + a);
//{ document.write ("<B>" + " yeshr= " + yeshr + " -Yesterday's Max. Precip. Sensor - " + " 15 " + " -Time of Yesterday's Max.- " + " 15:33 " + tothr + " <BR> " + "</B>"); }

//<!--RAINRATE-->
var pcr = "0.000";
var phr = "0.00";
var pmonth = "0.59";

//<!--AVERAGE MONTH'S RAIN-->
var pr = "0.000";
var dailyrain = "0.04";
var startphr = "0.000";
var pdif = "0.06";
var mpr = "0.017";
var mprt = "8:11";


//<!--LAST TRIP OF GUAGE-->
var lasttrip = "8:11";
var dateStr = "8:11" ;
dateStr  = dateStr.split(":");
var hhh     = dateStr[0];
var mmm = dateStr[1];

tst=(hhh*3600)+(mmm*60)

var tdiff = ((tid-tst)/3600);
tdiff.toFixed(1)

if (tdiff<0) {var tdiff = ((tid-tst)+86400/3600);}
tdiff.toFixed(1)


//<!--TEMPERATURE INFo-->
var tempa = "43.6";
var tch = "1.45";
var temphi = "43.8";

var mmhi = "72.1";
var mmlo = "30.7";

var yrhi = "72.1";
var yrlo = "14.8";

var templo = "36.8";
var temloti = "7:51";
//<!--TEMPERATURE current Ground-->
var cgrtemp = "48.0";

//<!--TEMPERATURE Current Surface on Board-->
var csurftemp = "49.0";

//<!--TEMPERATURE difference from yesterday at this time-->
var dtemp = "-6.5";

var maxratetemp = "2.11";
var tmaxratetemp = "13:31";

var tempran      = (temphi-templo);
tempran = Math.round(tempran);

var thrch = "1.45";
var thrch     = Math.round(thrch);



var mtempave ="48.9";

if (mm == 1)  {var tavem =  34.9 ;}
if (mm == 2)  {var tavem =  40.6 ;}
if (mm == 3)  {var tavem =  48.6 ;}
if (mm == 4)  {var tavem =  58.2 ;}
if (mm == 5)  {var tavem =  66.4 ;}
if (mm == 6)  {var tavem =  75.3 ;}
if (mm == 7)  {var tavem =  79.3 ;}
if (mm == 8)  {var tavem =  77.5 ;}
if (mm == 9)  {var tavem =  70.6 ;}
if (mm == 10) {var tavem =  58.9 ;}
if (mm == 11) {var tavem =  50.4 ;}
if (mm == 12) {var tavem =  39.9 ;}

tempdepart= ((mtempave)-(tavem));















//<!--BAROMETER INFO-->
var barx = "30.13";


var barhi = "30.15";
var barlo = "30.05";

var barmhi = "30.52";
var barmlo = "29.95";

var baryhi = "30.61";
var barylo = "29.40";
var brate = "-0.009";
var bary = "30.15";
var bc = "-0.03";


//<!--WIND INFO-->
var windx = "6";
var windrate = "-2.4";
var wdyes = "347";
var wmax = "16";
var winmhi = "21";
var winyhi = "41";
var wdave = "329";

var wdyes = "347";

var wdirect = "NNW";

if (windx == 0 )             		{var ws  = "  with calm air wind less than 1 mph";}
if (windx >0 && windx <=4)    	{var ws  = "  with light air from the ";}
if (windx >4 && windx <=8)    	{var ws  = "  with a light breeze from the ";}
if (windx >8 && windx <=13)   	{var ws  = "  with a gentle breeze from the ";}
if (windx >13 && windx <=19)  	{var ws  = "  with a moderate breeze from the ";}
if (windx >19 && windx <=25)  	{var ws  = "  with a fresh breeze from the ";}
if (windx >25 && windx <=32)  	{var ws  = "  with a strong breeze from the ";}
if (windx >32 && windx <=39)  	{var ws  = "  with Near GALE force winds from the ";}
if (windx >39 && windx <=47)  	{var ws  = "  with GALE FORCE WINDS from the ";}
if (windx >47 && windx <=55)  	{var ws  = "  with STRONG GALE FORCE WINDS from the ";}
if (windx >55 && windx <=63)  	{var ws  = "  with STORM FORCE WINDS from the ";}
if (windx >63 && windx <=73)  	{var ws  = "  with VIOLENT STORM WINDS from the ";}
if (windx >73 )              		{var ws  = "  with HURRICANE FORCE WINDS from the ";}

//*************************************************************************************************
// Wind Direction
//************************************************************************************************
//<!--WIND  INFO FROM Hanover County Municipal AIRPORT-->

var nwd = "NE"; // Hanover CountyAirport

if  (nwd == "---")                              	{var nwd = wdc  ;}
if (nwd == "N")                       	{var dn = 1,dtod=1,nwd= " north"    ;}   // " north"
if (nwd == "NNE")   		{var dn = 2,dtod=2,nwd= " north-northeast"   ;}   // " north-northeast"
if (nwd == "NE")  			{var dn = 3,dtod=3,nwd= " northeast"    ;}   // " northeast"
if (nwd == "ENE") 			{var dn = 4,dtod=4,nwd= " east-northeast"    ;}   // " east-northeast"
if (nwd == "E") 			{var dn = 5,dtod=5,nwd= " east"    ;}   // " east"
if (nwd == "ESE")  		{var dn = 6,dtod=6,nwd= " east-southeast"    ;}   // " east-southeast"
if (nwd == "SE") 			{var dn = 7,dtod=7,nwd= " southeast"    ;}   // " southeast"
if (nwd == "SSE")  		{var dn = 8,dtod=8,nwd= " south-southeast"    ;}   // " south-southeast"
if (nwd == "S")  			{var dn = 9,dtod=9,nwd= " south" ;}   // " south"
if (nwd == "SSW")  		{var dn = 10,dtod=10,nwd= " south-southwest"   ;}   // " south-southwest"
if (nwd == "SW") 			{var dn = 11,dtod=11,nwd= " southwest"   ;}   // " southwest"
if (nwd == "WSW") 		{var dn = 12,dtod=12,nwd= " west-southwest"  ;}   // " west-southwest"
if (nwd == "W")  			{var dn = 13,dtod=13,nwd= " west"   ;}   // " west"
if (nwd == "WNW")  		{var dn = 14,dtod=14,nwd= " west-northwest"   ;}   // " west-northwest"
if (nwd == "NW")  			{var dn = 15,dtod=15,nwd= " northwest"  ;}   // " northwest"
if (nwd == "NNW")  		{var dn = 16,dtod=16,nwd= " north-northwest"   ;}   // " north-northwest"




if (wdave   >349 || wdave<= 11)                	{var dayave = 1  ;}   // " north"
if (wdave   >11 &&  wdave <= 34)  		{var dayave = 2    ;}   // " north-northeast"
if (wdave   >34 &&  wdave <= 56) 		{var dayave = 3   ;}   // " northeast"
if (wdave   >56 &&  wdave <= 79)		{var dayave = 4   ;}   // " east-northeast"
if (wdave   >79 &&  wdave <= 101)		{var dayave = 5   ;}   // " east"
if (wdave  >101 &&  wdave <= 124) 		{var dayave = 6   ;}   // " east-southeast"
if (wdave  >124 &&  wdave <= 146) 		{var dayave = 7   ;}   // " southeast"
if (wdave  >146 &&  wdave <= 169) 		{var dayave = 8   ;}   // " south-southeast"
if (wdave  >169 &&  wdave <= 191) 		{var dayave = 9   ;}   // " south"
if (wdave  >191 &&  wdave <= 214) 		{var dayave = 10  ;}   // " south-southwest"
if (wdave  >214 &&  wdave <= 236) 		{var dayave = 11  ;}   // " southwest"
if (wdave  >236 &&  wdave <= 259) 		{var dayave = 12  ;}   // " west-southwest"
if (wdave  >259 &&  wdave <= 281) 		{var dayave = 13  ;}   // " west"
if (wdave  >281 &&  wdave <= 304) 		{var dayave = 14  ;}   // " west-northwest"
if (wdave  >304 &&  wdave <= 326) 		{var dayave = 15  ;}   // " northwest"
if (wdave  >326 &&  wdave <= 349) 		{var dayave = 16  ;}   // " north-northwest"

if (wdyes   >349 || wdyes<= 11)                	{var dyes =  1  ;}   // " north"
if (wdyes   >11 &&  wdyes <= 34)  		{var dyes  = 2   ;}   // " north-northeast"
if (wdyes   >34 &&  wdyes <= 56) 		{var dyes  = 3   ;}   // " northeast"
if (wdyes   >56 &&  wdyes <= 79)		{var dyes  = 4   ;}   // " east-northeast"
if (wdyes   >79 &&  wdyes <= 101)		{var dyes  = 5   ;}   // " east"
if (wdyes  >101 &&  wdyes <= 124) 		{var dyes  = 6   ;}   // " east-southeast"
if (wdyes  >124 &&  wdyes <= 146) 		{var dyes  = 7   ;}   // " southeast"
if (wdyes  >146 &&  wdyes <= 169) 		{var dyes  = 8   ;}   // " south-southeast"
if (wdyes  >169 &&  wdyes <= 191) 		{var dyes  = 9   ;}   // " south"
if (wdyes  >191 &&  wdyes <= 214) 		{var dyes  = 8  ;}   // " south-southwest"
if (wdyes  >214 &&  wdyes <= 236) 		{var dyes  = 7  ;}   // " southwest"
if (wdyes  >236 &&  wdyes <= 259) 		{var dyes  = 6  ;}   // " west-southwest"
if (wdyes  >259 &&  wdyes <= 281) 		{var dyes  = 5  ;}   // " west"
if (wdyes  >281 &&  wdyes <= 304) 		{var dyes  = 4  ;}   // " west-northwest"
if (wdyes  >304 &&  wdyes <= 326) 		{var dyes  = 3  ;}   // " northwest"
if (wdyes  >326 &&  wdyes <= 349) 		{var dyes  = 2  ;}   // " north-northwest"

//<!-- WIND VEERING OR BACKING FROM YESTERDAY) -->
var wsvb= (dtod - dyes);

//if (a>1)   { document.write(    "wdc=" + wdc +  " &nbsp dtod=" + dtod + " &nbsp wdyes=" + wdyes + " &nbsp dyes="  + dyes +  " &nbsp (dtod  - dyes)=" + wsvb   + "<BR>" ); }

if (wsvb>0 && wsvb<16)                      					{var wyes = "veering "    ;}
if (wsvb ==0 )   								{var wyes = "same "       ;}
if (wsvb<0)                           							{var wyes = "backing "  ;}
if (wyes == "same ")  							{var vb = 0   ;}   //  SAME AS YESTERDAY
if (wyes == "veering ")                  						{var vb = 2   ;}   // VEERING
if (wyes == "backing ")  							{var vb = 3   ;}   // BACKING

if ((dyes>5 && dyes<12) && (dtod>12 || dtod<3))				{var vb = 2   ;}   // VEERING as a cold front has passed since yesterday


if ( vb==0  )								{var wfu  = " direction that should change slowly " ;}
if ( vb==2  )								{var wfu  = "  that should veer " ;}
if ( vb==3  )								{var wfu  = "  that should back " ;}


//<!--RELATIVE HUMIDITY INFO-->
var rh = "69";
var rhrate = "-4.1";
var rello = "67";
var relmlo = "32";
var relylo = "19";

//<!--RH difference from yesterday at this time-->
var drh = "11";

//<!--CHANGE IN DEW POINT-->
var dewpthi = "37.1";
var dewptlo = "33.2";

var dpmhi = "53.1";
var dpyhi = "61.0";

var dpmlo = "26.2";
var dpylo = "0.5";

var dewptra = "0.03";
var dewptnow = "34.2";
var dpdep   = (tempa - dewptnow);
var dpdep   = Math.round(dpdep);

//<!--CHANGE IN HEAT INDEX -->
var heatind = "46.5";
var hhi = "46.7";
var hmhi = "71.8";
var hyhi = "71.9";

var hlo = "42.5";
var hmlo = "35.7";
var hylo = "17.9";

//<!--WIND CHILL -->
var wcf = "40.7";
var winchh = "43.8";
var winchl = "29.1";

var winchmhi = "72.1";
var winchmlo = "25.3";
var winchylo = "8.8";

//<!--OTHER -->
var evapotrans = "0.01";
var clobase = "2355";
var airden = "-1249";
var virtualtemp = "44.8";
var vaporpress = "0.20";


//<!--SKY INFO FROM  AIRPORT-->

var clo= "" ;
var ww = "Overcast"; // Richmond Airport
if (ww == "Clear"           )  	    {var clo= 1 ;}
if (ww == "Few Clouds"      )     {var clo= 2 ;}
if (ww == "Scattered Clouds")  {var clo= 3 ;}
if (ww == "Broken Clouds"   )   {var clo= 4 ;}
if (ww == "Overcast"        )       {var clo= 5 ;}
if (ww == "" && lwet>10 )   	{var clo= 5 ;}


if (clo == 1 )   				{var wsk= " The sky is currently clear " ;}
if (clo == 2 )   				{var wsk= " The sky is currently mostly clear " ;}
if (clo == 3 )   				{var wsk= " The sky currently has scattered clouds " ;}
if (clo == 4 )   				{var wsk= " The sky is currently mostly cloudy " ;}
if (clo == 5 )   				{var wsk= " The sky is currently overcast " ;}
if (clo == 5 && sr<70 && (a>=9 && a<15))   	{var wsk= " The sky is currently overcast and gloomy " ;}

if (clo == "") 				{var wsk= " The current sky condition is not available " ;}



var wwx = "";
var wwx = wwx.toLowerCase();
if (wwx   == "") 	         {var wsxt= "" ;}

else {var wwxt = wwx ;}



//if (a>1)   { document.write( " &nbsp wwt=" + wwxt  + " &nbsp wwx=" + wwx  + " &nbsp ww="  + ww + " &nbsp Clo=" + clo  + "<BR>"+ "<BR>" );}




if ((a>  5 && a<12 || a>18 && a<= 24)  && brt>3 && brt<7)  {var brt = brt  +1  ;}
if ((a>11 && a<19 || a<  6)                      && brt>3 && brt<7)  {var brt = brt  -1   ;}

//<!--PRECIP> YESTERDAY tot.today    minus    tot. yesterday   != (not equal to)-->
var ss = "2.50" ;
var wx = "2.48" ;


function dp(ss, wx) {a *= Math.pow(10, wx);ss = Math.round(a);ss /= Math.pow(10, wx);return ss;}
yp  = ((ss) - (wx)  ) ;

var priordays= 0 ;

function calcJday(current_month, current_day) {
if (current_month == 1) {priordays = new Number(0);}
if (current_month == 2) {priordays = new Number(31);}
if (current_month == 3) {priordays = new Number(60);}
if (current_month == 4) {priordays = new Number(91);}
if (current_month == 5) {priordays = new Number(120);}
if (current_month == 6) {priordays = new Number(151);}
if (current_month == 7) {priordays = new Number(181);}
if (current_month == 8) {priordays = new Number(212);}
if (current_month == 9) {priordays = new Number(243);}
if (current_month == 10){priordays = new Number(273);}
if (current_month == 11){priordays = new Number(303);}
if (current_month == 12){priordays = new Number(334);}

Jday = parseInt(priordays) + parseInt(current_day);
return Jday;}

var dateStr =" 2/5/12";
dateStr = dateStr.split("/");
var month = dateStr[0];
var day = dateStr[1];
var year = dateStr[2];
var julian_day = calcJday(month,day);
var RdateStr =" 2/5/12 ";
RdateStr = RdateStr.split("/");
var Rmonth = RdateStr[0];
var Rday = RdateStr[1];
var Ryear = RdateStr[2];
var Rjulian_day = calcJday(Rmonth, Rday);

if (year > Ryear) {var dsp = ((julian_day + parseInt(365)) - Rjulian_day);}
else {var dsp = (julian_day - Rjulian_day);}


if (wdave   >349 || wdave <= 11)           	{var codwin =1,  wdd= " north" 	   ;}
if (wdave   >11 &&  wdave <= 34)  		{var codwin =2,  wdd= " north-northeast" ;}
if (wdave   >34 &&  wdave <= 56) 		{var codwin =3,  wdd= " northeast" ;}
if (wdave   >56 &&  wdave <= 79)		{var codwin =4,  wdd= " east-northeast" ;}
if (wdave   >79 && wdave <= 101)		{var codwin =5,  wdd= " east";}
if (wdave  >101 && wdave <= 124) 		{var codwin =6,  wdd= " east-southeast" ;}
if (wdave  >124 && wdave <= 146) 		{var codwin =7,  wdd= " southeast" ;}
if (wdave  >146 && wdave <= 169) 		{var codwin =8,  wdd= " south-southeast";}
if (wdave  >169 && wdave <= 191) 		{var codwin =9,  wdd= " south" ;}
if (wdave  >191 && wdave <= 214) 		{var codwin =10,  wdd= " south-southwest" ;}
if (wdave  >214 && wdave <= 236) 		{var codwin =11,  wdd= " southwest" ;}
if (wdave  >236 && wdave <= 259) 		{var codwin =12,  wdd= " west-southwest" ;}
if (wdave  >259 && wdave <= 281) 		{var codwin =13,  wdd= " west" ;}
if (wdave  >281 && wdave <= 304) 		{var codwin =14,  wdd= " west-northwest" ;}
if (wdave  >304 && wdave <= 326) 		{var codwin =15,  wdd= " northwest" ;}
if (wdave  >326 && wdave <= 349) 		{var codwin =16,  wdd= " north-northwest" ;}


//<!____________________________________________________________________________________________________________________________________________-->
//TEMPERATURES            1
//*************************************************************************************************



if (tempa <6 )                                                    {var tpf  = "Frigid Arctic Cold ";}
if (tempa >5 && tempa <=11 )                                      {var tpf  = "Extremely Cold. ";}

if ((mm< 4 || mm>10) && tempa >11 && tempa<=20 && rh   <=75)  {var tpf  = "Very cold ";}
if ((mm< 4 || mm>10) && tempa >11 && tempa<=20 && rh   > 75)  {var tpf  = "Damp & very cold ";}
if ((mm> 3 && mm<11) && tempa >11 && tempa<=20 && rh   <=75)  {var tpf  = "Extremely cold ";}
if ((mm> 3 && mm<11) && tempa >11 && tempa<=20 && rh   > 75)  {var tpf  = "Damp & extremely cold ";}

if ((mm< 4 || mm>10) && tempa >20 && tempa<=30 && rh   <=80)  {var tpf  = "Cold ";}
if ((mm< 4 || mm>10) && tempa >20 && tempa<=30 && rh   > 80)  {var tpf  = "Damp & cold ";}
if ((mm> 3 && mm<11) && tempa >20 && tempa<=30 && rh   <=80)  {var tpf  = "Very cold ";}
if ((mm> 3 && mm<11) && tempa >20 && tempa<=30 && rh   > 80)  {var tpf  = "Damp & very cold ";}

if ((mm< 4 || mm>10) && tempa >30 && tempa<=35 && rh   <=85)  {var tpf  = "Very chilly ";}
if ((mm< 4 || mm>10) && tempa >30 && tempa<=35 && rh   > 85)  {var tpf  = "Damp & very chilly ";}
if ((mm> 3 && mm<11) && tempa >30 && tempa<=40 && rh   <=85)  {var tpf  = "Cold ";}
if ((mm> 3 && mm<11) && tempa >30 && tempa<=40 && rh   > 85)  {var tpf  = "Damp & cold ";}

if ((mm< 4 || mm>10) && tempa >35 && tempa<=45 && rh   <=85)  {var tpf  = "Chilly ";}
if ((mm< 4 || mm>10) && tempa >35 && tempa<=45 && rh   > 85)  {var tpf  = "Damp & chilly ";}
if ((mm> 3 && mm<11) && tempa >40 && tempa<=50 && rh   <=85)  {var tpf  = "Very chilly ";}
if ((mm> 3 && mm<11) && tempa >40 && tempa<=50 && rh   > 85)  {var tpf  = "Damp & very chilly ";}

if ((mm< 4 || mm>10) && tempa >45 && tempa<=55 && rh   <=87)  {var tpf  = "Cool ";}
if ((mm< 4 || mm>10) && tempa >45 && tempa<=55 && rh   > 87)  {var tpf  = "Damp & cool ";}
if ((mm> 3 && mm<11) && tempa >50 && tempa<=60 && rh   <=87)  {var tpf  = "Chilly ";}
if ((mm> 3 && mm<11) && tempa >50 && tempa<=60 && rh   > 87)  {var tpf  = "Damp & chilly ";}

if ((mm< 4 || mm>10) && tempa >55 && tempa<=66 && rh   <=90)  {var tpf  = "Pleasant ";}
if ((mm< 4 || mm>10) && tempa >55 && tempa<=66 && rh   > 90)  {var tpf  = "Damp & pleasant ";}
if ((mm> 3 && mm<11) && tempa >60 && tempa<=66 && rh   <=90)  {var tpf  = "Cool ";}
if ((mm> 3 && mm<11) && tempa >60 && tempa<=66 && rh   > 90)  {var tpf  = "Damp & cool ";}

if ((mm< 4 || mm>10) && tempa >66 && tempa<=79 && rh   <=92)  {var tpf  = "Warm ";}
if ((mm< 4 || mm>10) && tempa >66 && tempa<=79 && rh   > 92)  {var tpf  = "Damp & warm ";}
if ((mm> 3 && mm<11) && tempa >66 && tempa<=79 && dewptnow <=68)  {var tpf  = "Pleasant "  ;}
if ((mm> 3 && mm<11) && tempa >66 && tempa<=79 && dewptnow > 68)  {var tpf  = "Pleasant but a little humid ";}

if ((mm< 4 || mm>10) && tempa >79 && tempa<=89 && dewptnow <=68)  {var tpf  = "Very warm ";}
if ((mm< 4 || mm>10) && tempa >79 && tempa<=89 && dewptnow > 68)  {var tpf  = "Hot & humid ";}
if ((mm> 3 && mm<11) && tempa >79 && tempa<=89 && dewptnow <=68)  {var tpf  = "Warm ";}
if ((mm> 3 && mm<11) && tempa >79 && tempa<=89 && dewptnow > 68)  {var tpf  = "Warm & humid ";}

if ((mm< 4 || mm>10) && tempa >89 && tempa<=93 && dewptnow <=68)  {var tpf  = "Hot ";}
if ((mm< 4 || mm>10) && tempa >89 && tempa<=93 && dewptnow > 68)  {var tpf  = "Very hot & humid ";}
if ((mm> 3 && mm<11) && tempa >89 && tempa<=93 && dewptnow <=70)  {var tpf  = "Hot ";}
if ((mm> 3 && mm<11) && tempa >89 && tempa<=93 && dewptnow > 70)  {var tpf  = "Hot & humid ";}


if (tempa >93 && tempa<=96 && dewptnow <=72)  {var tpf  = "Very hot ";}
if (tempa >93 && tempa<=96 && dewptnow > 72)  {var tpf  = "Very hot & very humid ";}

if (tempa >96 && tempa<=100 && dewptnow <=74)  {var tpf  = "EXTREMELY Hot ";}
if (tempa >96 && tempa<=100 && dewptnow > 74)  {var tpf  = "EXTREMELY Hot & very humid ";}

if (tempa >100 && tempa<=105 && dewptnow <=76)  {var tpf  = "TORRID TROPICAL HEAT ";}
if (tempa >100 && tempa<=105 && dewptnow > 76)  {var tpf  = "TORRID TROPICAL HEAT & very humid ";}

if (tempa >105 )              {var tpf  = "RECORD BREAKING TORRID TROPICAL HEAT ";}

if (mm == 1)  {var pma = 3.36 , ddm=31 , mn= " January" ;}
if (mm == 2)  {var pma = 3.00 , ddm=28 , mn= " February" ;}
if (mm == 3)  {var pma = 3.75 , ddm=31 , mn= " March" ;}
if (mm == 4)  {var pma = 3.07 , ddm=30 , mn= "April" ;}
if (mm == 5)  {var pma = 3.85 , ddm=31 , mn= " May" ;}
if (mm == 6)  {var pma = 3.48 , ddm=30 , mn= " June" ;}
if (mm == 7)  {var pma = 4.35 , ddm=31 , mn= " July" ;}
if (mm == 8)  {var pma = 4.08 , ddm=31 , mn= "August" ;}
if (mm == 9)  {var pma = 3.87 , ddm=30 , mn= " September" ;}
if (mm == 10) {var pma = 3.43 , ddm=31 , mn= " October" ;}
if (mm == 11) {var pma = 3.18 , ddm=30 , mn= " November" ;}
if (mm == 12) {var pma = 3.30 , ddm=31 , mn= " December" ;}

paday=((pma)/(ddm));
pave=((paday)*(day));
pcurdepart= ((pmonth)-(pave));
if (pcurdepart >= 0.000)              {var pos = " + ";}
if (pcurdepart  < 0.000)              {var pos = " negative ";}


if (tch < 0 )    			{var tcht = " decreased " + tch + " °F in the past hour ";}
if (tch ==0 )    			{var tcht = " have stayed the same during the past hour ";}
if (tch > 0 )    			{var tcht = " increased " + tch + " °F in the past hour ";}


//if (a>1)   { document.write(    " Wx and  temperature 	" + dan +    "<BR>"+ "<BR>" ); }


if ( a>=0  && a<=8 )    	{var tt = 1,td= " early morning "  ;}	 	   // Early morning
if ( a>8  && a<=11 )  	{var tt = 2,td= " morning " ;} 		  // Morning
if ( a>11 && a<=16 )  	{var tt = 3,td= " afternoon " ;}		 // Afternoon
if ( a>16 && a<=19 ) 	{var tt = 4,td= " evening " ;}		 // Evening
if ( a>19 && a<25  )  	{var tt = 5,td= " night "  ;} 			// Night

//*************************************************************************************************
//Moon Phase   2
//*************************************************************************************************
if (mooph >=29)  		{var mphase  = " new moon ";}
if (mooph <01)  		{var mphase  = " new moon ";}
if (mooph >=01   && mooph <07)  {var mphase  = " crescent waxing ";}
if (mooph >=07   && mooph <08)  {var mphase  = " 1st Quarter ";}
if (mooph >=08   && mooph <15)  {var mphase  = " gibbous waxing ";}
if (mooph >14    && mooph <16)  {var mphase  = " full Moon ";}
if (mooph >15    && mooph <22)  {var mphase  = " gibbous waning ";}
if (mooph >21    && mooph <23)  {var mphase  = " 3rd Quarter ";}
if (mooph >22    && mooph <29)  {var mphase  = " crescent waning ";}


//*************************************************************************************************
// Sky Brightness  3
//************************************************************************************************


if ( Math.abs("-51")>=140 ) {var vky = " and variable skies ";}
if ( Math.abs("-51")< 140 ) {var vky = " " ;}





//{ document.write  ("<B>" + "&nbsp; &nbsp; &nbsp; 1&nbsp;  mm =" + mm +  "  <BR> " + "</B>"); }
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@



//*******************************************************************************************************************
//   SUNRISE and SUNSET                          8
//*******************************************************************************************************************
{var ext  = " " ;}
if (mm>3 && mm<10 && a>0 && a<=6 )  {var ext  = " Sunrise today is at " + srise + " AM. "    + "<BR>";}
if (mm<4 && mm>9  && a>0 && a<=7 )  {var ext  = " Sunrise today is at " + srise + " AM. "    + "<BR>";}
if ( a>=16 && a<21)                 {var ext  = " Sunset  today is at " + sset  + " hours. " + "<BR>";}
if ( a>20 && a<25)                  {var ext  = " The moon phase is "   + mphase + " & its age is " + mooph + " day/s ";}



//*******************************************************************************************************************
// DRY	CONDITIONS		                9
//*******************************************************************************************************************
if ( drh > 29)                {var yrh =  " a great increase of "  + drh + " % " ;}
if ( drh > 19 && drh <  30)   {var yrh =  " a increase of "        + drh + " % " ;}
if ( drh > 10 && drh <  20)   {var yrh =  " a rise of "            + drh + " % " ;}
if ( drh > 0 && drh  <  11)   {var yrh =  " " ;}
if ( drh == 0)                {var yrh =  " " ;}
if ( drh < 0 && drh  > -11)   {var yrh =  " " ;}
if ( drh <-10 && drh > -20)   {var yrh =  " a drop of "           + drh + " % " ;}
if ( drh <-19 && drh > -30)   {var yrh =  " a decrease of "       + drh + " % " ;}
if ( drh <-29)                {var yrh =  " a great decrease of " + drh + " % " ;}








//********************
// DEW RATINGS FOR MORNING	DEWS 	   11          if ( a>=0  && a<=8 )    	{var tt = 1,td= " early morning "  ;}	 	   // Early morning
//********************

if (dewx == 0  )  	                               											{var de = 0,dewt = " " ;}
if (lwet>0 && dewx>0)  	                               										{var de = 0,dewt = " " ;}
if (xwet>0 && dewx>0 && lwet==0)  											{var de = 0,dewt = " " ;} //wdry covers this below

if (lwet  == 0        && pdif > 0.00   && dewx >5 && a<=9 && tempa>30  && tempa <36 && xwet ==15)  				{var de = 1,dewt = "  and frozen precip. on sensor " ;}
if (lwet  == 0        && pdif==0.00  && dewx >5 && templo<33   && a<=9 && tempa>32  && tempa <36 && xwet ==0)  		{var de = 1,dewt = "  and condensation or melting frost " ;}
if (ww != " overcast "  && pdif==0.00  && dewx >0  && dewx < 6   && a<=9                       && tempa >34 && xwet == 0)  		{var de = 1,dewt = "   and a light morning dew "      ;}
if (ww != " overcast "  && pdif==0.00  && dewx >0  && dewx <16  && a> 9 && yeshr<19  && tempa >35 && xwet == 0)  		{var de = 1,dewt = "  and the lawn still damp from condensation " ;}
if (ww != " overcast "  && pdif==0.00  && dewx >0  && dewx < 5   && a<=9                         && tempa >35 && xwet == 0)  		{var de = 1,dewt = "   and a  very light morning dew " ;}
if (ww != " overcast "  && pdif==0.00  && dewx >0  && dewx < 5   && a<=9 && yeshr<19  && tempa >35 && xwet == 0)  		{var de = 1,dewt = "   and a  light morning dew "      ;}
if (ww != " overcast "  && pdif==0.00  && dewx >4  && dewx <15  && a<=9  	            && tempa >35 && xwet == 0)  		{var de = 1,dewt = "   and  moderate morning dew "   ;}
if (ww != " overcast "  && pdif==0.00  && dewx >4  && dewx <15  && a<=9 && yeshr<19  && tempa >35 && xwet == 0)  		{var de = 1,dewt = "  and a  moderate morning dew "   ;}
if (ww != " overcast "  && pdif==0.00  && dewx == 15                     && a<=9 && yeshr<19   && tempa >35 && xwet == 0)  		{var de = 1,dewt = "  and a heavy morning dew "      ;}
if (ww != " overcast "  && pdif==0.00  && dewx == 15                    && a<=9 && yeshr>20   && tempa >35 && xwet == 0)  		{var de = 1,dewt = "   and a  very heavy morning dew " ;}


// EVENING	DEWS
if (lwet == 0 && dewx >0  && dewx <15  && a>17 && tempa >32 && xwet == 0)                					{var de = 1,dewt = " and grass and lawn dampness from evening dew forming" ;}
if (lwet == 0 && dewx >0  && dewx <15  && a>19 && tempa >32 && dailyrain> 0.00  && tdiff>9)                			{var de = 1,dewt = " and grass and lawn dampness from evening dew forming" ;}

//********************
//  MORNING FROST	                  12     Discovered (dewpoint- tempa) VERY important    Not sure but a east or SE wind direction might play into evening frost
//********************
if (clo<3 && rh>78 && xwet == 0 && dewx >0 && dewx<4 && a > 20  && windx<4 && tempa <30 && dpdep < 7 )     		{var de = 1,dewt = "  and frost is already started to form tonight"   ;}
if (clo<3 && rh>78 && xwet == 0 && dewx >0 && dewx<4 && a > 20  && windx<4 && tempa <30 && dpdep < 3 )     		{var de = 1,dewt = "  and heavy frost is forming tonight"             ;}
if (clo<5 && xwet == 0 &&  dewx >0 && dewx <14       && windx < 4  && yp == 0 && a>6 && a<=9        && tempa <33)   		{var de = 1,dewt = "  and frost this morning"                 ;}
if (clo<5 && xwet == 0 &&                               dewx  > 0  && yp == 0 && a <=6         && tempa <33)	      			{var de = 1,dewt = "  and frost formation is increasing"              ;}
if (clo<5 && xwet == 0 && templo<35 &&     dewx == 15 && yp == 0 && a < 11  && tempa >35  )        				{var de = 1,dewt = "  and the frost is now melting"                       ;}
if (clo<5 && templo>30 && templo<33 && xwet == 0 && dewx>0 && yp == 0 && a > 7 && a<10 && tempa >31 && tempa <38)   	{var de = 1,dewt = "  the lawn damp from dew or from melting frost"   ;}




//********************
// NO PRECIP NOW BUT DAMP FROM PAST precipitation 10
//********************

if (lwet == 0 && dewx > 0  && dewx <16  && tempa <38 && xwet == 15  && de==0)  						{var wdry = " and precip. has ended  "  		;}
if (lwet == 0 && pdif>0.00  && dewx > 0  && dewx <16  && a>19    && pr == 0.000 && tempa >37 && tdiff<=9 && de==0)  		{var wdry = " and the grass is damp from precip. earlier today or late yesterday "  		;}
if (lwet == 0 && dewx >0   && dewx <16  && tempa >38 && xwet == 15 && pdif==0.00 && de==0)   					{var wdry = " and the lawn damp from a trace of precip. earlier today too small to measure but no precip. now " ;}
if (lwet == 0 && dewx == 0              && tempa >27 && xwet == 15 && de==0)             						{var wdry = " with precip. earlier today but no precip. now "                      				  ;}
if (lwet == 0 && pdif>0.00  && dewx >0  && dewx <16  && tempa >38 && xwet == 15 && tdiff<=10 && de==0)             			{var wdry = " with no precip. now but still damp from precip. earlier today or late yesterday " 				  ;}
if (lwet == 0 && dailyrain> 0.00 && dewx == 0 && temphi<28 && xwet == 15 && de==0) {var wdry = " with snowfall has currently ended at " + "8:11" + " hours" ;}
if (lwet == 0 && dailyrain> 0.00 && dewx == 0 && xwet == 15 && de==0) {var wdry = " and precip. has stopped with the last 0.01 inches of precip. at " + "8:11" + " hours" ;}
if (lwet == 0 &&  dewx >12  && a>18 && tempa >32 && dailyrain>0.00 && de==0)                						{var wdry = " and grass and lawn dampness from precipitation earlier today " ;}

//********************
// PRECIP <0.02 inches		          13
//********************

//{ document.write ( "<B>" +  "stime in 13 "    +  stime   + "<BR>" + "</B>" ); }

if (lwet == 0 && xwet ==0   && dailyrain == 0.00 && de==0)                       	                                    					{var wdry = " and dry conditions"      					 ;}
if (dailyrain == 0.00 && pr == 0.000 && rh<=30     && xwet ==0 && dsp>5 && de==0)      						{var wdry = " and very dry air & dry weather"    			 ;}
if (dailyrain == 0.00 && pr == 0.000 && (rh<=90) && xwet ==0 && de==0)   							{var wdry = " and dry conditions"      					 ;}
if (dailyrain == 0.00 && pr == 0.000 && (rh<=90) && xwet ==0 && wmax <6 && de==0)   						{var wdry = " with calm and dry conditions"   			 	;}
if (dailyrain == 0.00 && pr == 0.000 && (rh<=90) && xwet ==0 && windx >13 && de==0)   						{var wdry = " with windy and dry conditions"   			 	;}
if (dailyrain == 0.00 && pr == 0.000 && (rh<=90) && xwet ==0 && windx >30 && de==0)   						{var wdry = " with very windy and dry conditions"   			 ;}
if (dailyrain == 0.00 && pr == 0.000 && (rh<=90) && xwet ==0 && windx >35 && de==0)   						{var wdry = " with VERY WINDY and dry conditions"   			 ;}

if (lwet == 0                         && xwet >0 && a<=12    && dailyrain == 0.00 && de==0)                       					{var wdry = " and a trace of precip. this morning at "  + pretime + " and was too little to measure has ended"       ;}
if (lwet == 0 && dewx < 5  && xwet >1 && a> 12    && dailyrain == 0.00 && de==0)            						{var wdry = " and trace of precip. occurred today at " + pretime + " and was too little to measure"   ;}
if (lwet == 0 && dewx < 5  && xwet >0 && xwet<5 && dailyrain == 0.00 && de==0)           						{var wdry = " and scarcely a discernible trace of precip. today at " + pretime + " and was too little to measure has ended";}
if (lwet == 0 && dewx >5  && xwet ==15   && dailyrain > 0.00 && tdiff<3 && de==0)           						{var wdry = " and the precip. has recently ended";}

if (lwet == 0 && dewx >5  && xwet >0                       && dailyrain == 0.00 && de==0)            						{var wdry = " and trace of precip. today at "        + pretime + " but was too little to measure has ended"       ;}
if (lwet >1 && dewx > 0     && dewx <16   && pr >= 0.000 && dailyrain == 0.00 && de==0)      						{var wdry = " and precip. is occurring but not measurable yet" 	          ;}
if (lwet >0 && lwet<6  && dewx > 0     && dewx <16     && dailyrain>0.00 && de==0)      						{var wdry = " and light precip. or drizzle is occurring " 	          ;}




if (lwet >0 && dewx >0     && dewx <16   && pr== 0.000 && dailyrain>0.00 && rh<100 && tempa >=32 && de==0)  			{var wdry = " and light precip. is occurring"                                         ;}

if (lwet >0 && dewx > 4     && dewx <16   && pr>= 0.000 && dailyrain>0.00 && rh>99 && de==0) 					{var wdry = " with fog and precip. occurring"			   	  ;}
if (lwet >0 && lwet <9  && dewx <16   && dailyrain > 0.00 && tempa >30 && tempa <=34 && de==0) 					{var wdry = " and flurries or drizzle is occurring" 				  ;}
if (lwet >0 && lwet <5  && dewx <16   && tempa >35 && tempa <=75 && de==0) 							{var wdry = " an occasional light sprinkles or light drizzle with damp conditions"   ;}

//********************
// PRECIP NEAR OR BELOW FREEZING          14
//********************
//   DECEMBER 05, 2005   08:58 PM Snow falling and dewx was 3 and lwet was 15

if (a>9 && a<17 && lwet >1   && dewx >9 && dailyrain> 0.00 && tempa >27 && tempa <31 && de==0)     				{var wdry = " and a frozen form of precip. is now occurring"  ;}
if ((a<9 || a>16) && lwet >1  && dewx >12    && dailyrain >0.00                    && tempa <32 && de==0) 					{var wdry = " and freezing rain or  frozen form of precip. is occurring now"       ;}
if (lwet >1  && dewx >0 && dewx <4    && dailyrain > 0.00 && tempa >24 && tempa <=32 && de==0)    				{var wdry = " and snow is occurring now" 		;}
if (lwet >1  && dewx >=6 && dewx <9   && dailyrain > 0.00 && tempa >24 && tempa <=32 && de==0)     				{var wdry = " and sleet is occurring now" 		 ;}



if (lwet >0 && lwet <9  && dewx  < 16   && dailyrain > 0.00 && tempa >24 && tempa <29 && de==0)          				{var wdry = " and snow flurries or frozen precip. is occurring"         ;}
if (lwet == 3               && dewx  >  0   && dailyrain > 0.00 && tempa >24 && tempa <32 && de==0)	        				{var wdry = " and very light freezing precip. is occurring" 	 ;}
if (lwet >8 && lwet <13 && dewx  >  0   && dailyrain > 0.00 && tempa <32 && de==0)          						{var wdry = " and freezing precip. is occurring" 		   ;}
if (lwet >1 &&  lwet <4  && xwet >1  && a<=12 && dailyrain == 0.00 && tempa <25 && de==0)             	 				{var wdry = " and very light snow this morning but less than 0.01 inches when melted" ;}
if (lwet >3 &&  lwet <6  && xwet >1  && a<=12 && dailyrain == 0.00 && tempa <25 && de==0)              				{var wdry = " and snow this morning but currently less than 0.01 inches when melted"  ;}
if (lwet >3 &&  lwet <6  && xwet ==15 && dewx == 0 && a<=12 && dailyrain > 0.00 && tempa <25 && de==0) 				{var wdry = " and current a light snow is occurring this morning"	  ;}
if (lwet >3 &&  lwet <6  && xwet ==15 && dewx == 0 && a>12  && dailyrain > 0.00 && tempa <25 && de==0) 				{var wdry = " and currently light snow is occurring"                                  ;}

//********************
// PRECIP WELL BELOW FREEZING          14B
//********************
if (lwet >0    && dewx==0  && tempa <30 && de==0) 										{ var wdry = " and frozen or freezing precip. currently occurring "   ;}



//********************
//Residual Moisture ON SENSOR NOT FREEZING  15
//********************
if (lwet == 0 && pdif>0.00 && dewx >0 && dewx<16 && xwet ==0 && pr == 0.000 && dailyrain== 0.00 && a<=9  && yesmaxwet == 15 && de==0) 			{var wdry = " and the lawn this morning still has residual moisture from yesterday's precip" ;}
if (lwet == 0 && xwet ==15 && pr == 0.000 && dailyrain > 0.00 && a<=12 && tempa >32 && de==0 ) {var wdry = " and the precip. that occurred earlier today ended at " + "8:11" + " with no precip. falling currently" ;}
if (lwet == 0 && dewx >0 && dewx<16 && xwet ==15 && pr == 0.000 && dailyrain > 0.00 && tempa>32 && tempa<80  && tdiff<8 && de==0)    			{var wdry = " and residual moisture is still on the lawn from precip. today" ;}

//********************
//Residual Moisture ON SENSOR FREEZING   16
//********************
if (lwet == 0 && pdif>0.00 && dewx >0 && dewx<16 && xwet ==0  && pr == 0.000 && dailyrain== 0.00 && yp > 0  && tempa <=32 && pdif>0.00 && de==0)  		{var wdry = " and no precip. now but frozen precip. from yesterday is still on the moisture sensor "      ;}
if (lwet == 0 && dewx >0 && dewx<16 && xwet ==15 && pr == 0.000 && dailyrain > 0.00 && templo <29 && tempa <38 && de==0)                          			{var wdry = " and no precip. now but frozen precip. from earlier today is still on the moisture sensor "  ;}
if (lwet == 0 && pdif>0.00 && dewx >0 && dewx<16 && xwet ==0  && pr == 0.000 && yesmaxwet > 0 && yeshr>20  && tempa >32 && pdif>0.00 && de==0)    		{var wdry = " and no precip. now but residual moisture still on the moisture "  + "<BR>"  + "sensor from  precip. yesterday " ;}


if (de>1  )  	                               												                                                {var wdry = 0 ;}


//<!--SKY INFO FROM NATIONAL AIRPORT    17



if ( pr > 0.010 )       {var ww  = " Sky is obscured ";}


//************************************************************
//  RAINFALL RATE
//***********************************************************

if (pr <= 0.001) 			                		{var prr  = " ";}


if (pr >0.001 && tempa < 30 && dewx ==15 ) 			{var prr= " a very light freezing precip. or snow at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >0.001 && tempa < 30 && dewx < 15 ) 			{var prr= " an extremely light snow rate at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >0.001 && tempa > 29 && tempa < 40)   		        	{var prr= " a precip. rate of " + pr + " inches per hour is occurring now ";}
if (pr >0.001 && tempa > 40) 					{var prr= " a precip. rate is " + pr + " inches per hour is occurring now ";}

if (pr >= 0.010 && tempa < 30)    				{var prr= " a very light snow at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 0.010 && tempa > 29 && tempa < 40)   			{var prr= " a very light precip. at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 0.010 && tempa > 39) 					{var prr= " a very light rain at a rate of " + pr + " inches per hour is occurring now ";}

if (pr >= 0.100 && tempa < 29) 					{var prr= " a light snow at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 0.100 && tempa > 28  && tempa < 40) 			{var prr= " a light precip. at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 0.100 && tempa > 39)  				{var prr= " a light rain at a rate of " + pr + " inches per hour is occurring now ";}

if (pr >= 0.200 && tempa < 28)  				{var prr= " a light to moderate snow at a rate of " + pr + " inches per hour is occurring now ";}
if ((pr >= 0.200) && (tempa > 27 && tempa < 40))   			{var prr= " a light to moderate precip. at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 0.200 && tempa > 39)  				{var prr= " a light to moderate rain at a rate of " + pr + " inches per hour is occurring now ";}

if (pr >= 0.300  && tempa < 28) 				{var prr= " a moderate snow at a rate of " + pr + " inches per hour is occurring now ";}
if ((pr >= 0.300)  && (tempa > 27  && tempa < 40))  			{var prr= " a moderate precip. at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 0.300  && tempa > 39) 				{var prr= " a moderate rain at a rate of " + pr + " inches per hour is occurring now ";}

if (pr >= 0.400  && tempa < 28) 				{var prr= " a heavy snow at a rate of " + pr + " inches per hour is occurring now ";}
if ((pr >= 0.400)  && (tempa > 27  && tempa < 40))    		{var prr= " a heavy precip. at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 0.400  && tempa > 39)  				{var prr= " a heavy rain at a rate of " + pr + " inches per hour is occurring now ";}

if (pr >= 1.500)         					 	{var prr= " a very heavy rain at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 3.000)          					 {var prr= " an extremely HEAVY RAINFALL at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 6.000)          					 {var prr= " a SEVERE FLOODING IF RATE CONTINUES at a rate of " + pr + " inches per hour is occurring now ";}
if (pr >= 9.300)          					 {var prr= " a RECORD RAINFALL RATE  at a rate of " + pr + " inches per hour is occurring now ";}




//***************************************************************************************

// Frozen PRECIPITATION STARTING NOT MESURABLE   18 -->
//  MUST pr == 0.000 && dailyrain == 0.00

//  Freezing precipitation started
if (pr == 0.000 && dailyrain == 0.00 &&  lwet >0 && lwet <6 && dewx >0  && tempa >25 && tempa <33 && windx <13 ) 		{ document.write ( "<B>" +  " Very Light Frozen or Freezing precip. currently but Not Measurable."  + "<BR>" + "</B>" ); }

//  Windy with Snow Flurries
if (pr == 0.000 && dailyrain == 0.00 &&  lwet >0 && lwet <6 && dewx >0   && tempa <38 && windx >12 ) 			{ document.write ( "<B>" +  " Windy with Snow Flurries but No Measurable precip. occurring currently " 	+ "<BR>" + "</B>" ); }


//*********************************************************************************************************************************
// Conditions
//*********************************************************************************************************************************
if (pr == 0.000 &&  lwet >3 &&  lwet <7  &&  dewx >8 && tempa >32 && tempa <57  && dailyrain <=0.10 && rh == 100 && windx<4 ) 	{var wdry = " and fog and very light drizzle occurring " ;}
if (pr == 0.000 &&  lwet >6 &&  lwet <14 &&  dewx >8 && tempa >32 && tempa <60  && dailyrain > 0.10 && rh == 100 && windx<4 ) 	{var wdry = " and fog and light precip. is occurring " ;}
if (xwet   == 15    &&  dewx == 15  && (tempa >32 && tempa <=63) && rh == 100 )                                                           		{var wdry = " and light fog or reduced visibility with moisture haze " ;}
if (pr == 0.000 &&  lwet <2 &&                   dewx >8 && tempa >32 && tempa <=63 && dailyrain== 0.00 && rh == 100   )          	{var wdry = " and some fog " ;}

if (wdry == "" && xwet>0 && lwet>0 && rh>97 && sr<100 && de==0)							{var wdry= " and fog, damp and wet " ;}

if (wdry == "" && xwet==0 && lwet==0 && dewx==0 && rh<40 && de==0)						{var wdry= " and it is dry and low relative humidity " ;}
if (wdry == "" && xwet==0 && lwet==0 && dewx==0 && dsp<5 && de==0)						{var wdry= " and it is dry   " ;}
if (wdry == "" && xwet==0 && lwet==0 && dewx>0 && dsp<5 && tempa>39 && de==0)					{var wdry= " and it is dry conditions now but the lawn is still damp from dew " ;}
if (wdry == "" && xwet==0 && lwet==0 && dewx==0 && dsp>=5 && de==0)						{var wdry= " and it is very dry ";}
if (wdry == "" && xwet==0 && lwet==0 && dewx==0 && dsp>10 && de==0)						{var wdry= " and it is an EXTREMELY dry ";}
if (wdry == "" && xwet==0 && lwet==0 && dewx==0 && sr>700  && de==0 )						{var wdry= " and it is dry and a very bright sunny day " ;}
if (wdry == "" && xwet==0 && lwet==0 && dewx==0 && sr>650  && de==0 )						{var wdry= " and it is dry and a bright sunny day " ;}
if (wdry == "" && xwet==0 && lwet==0 && dewx==0 && sr>600  && de==0 )						{var wdry= " and it is dry and a sunny day " ;}
if (wdry == "" && xwet==0 && lwet==0 && dewx==0 && sr<170 && a>9 && a<16 && de==0)					{var wdry= " and it is dry and a dull sky " ;}
if (wdry == "" && xwet==0 && lwet==0 && sr<60 && a>9 && a<15 && de==0)						{var wdry= " and it is dry and gloomy    " ;}
if (wdry == "" && xwet==0 && lwet==0 && dsp>6 && rh<45 && de==0)							{var wdry= " and it is very dry and low relative humidity " ;}
if (wdry == "" && xwet==0 && lwet==0 && dsp>12 && rh<45 && de==0)							{var wdry= " and it is extremely dry and low relative humidity " ;}

//if (MakeDocumentWriteWork>1)   { document.write( " &nbsp cw=" + cw  +                  " &nbsp lwet="  + lwet +                " &nbsp xwet=" + xwet   + "<BR>"+ "<BR>" );}

if (wdry == "" && xwet>0 && lwet==0 && dew==0 && dewx>3 && de==0)						{var wdry= " and precip. has stopped but there was precip. earlier today " ;}
if (xwet>0 && lwet==0 && dewx==0 && tdiff<=6 && de==0)								{var wdry= " and drying conditions now but there was precip. earlier today " ;}
if (xwet>0 && lwet==0 && dewx==0 && tdiff>6 && de==0)								{var wdry= " and precip. occurred earlier but surfaces are now dry " ;}


if (wdry == "" && xwet>0 && lwet>0 && lwet<3  && de==0)								{var wdry= " and precip. is so light it is hardly discernible " ;}
if (xwet>0 && lwet>0 && lwet<3 && de==0 )									{var wdry= " and precip. is so light it is hardly discernible " ;}

if (wdry == "" && xwet>0  && lwet>0 && lwet<=6  && de==0)								{var wdry= " and sprinkles and very light precip.  occurring currently " ;}
if (wdry == "" && xwet>0 && lwet>0 && lwet<=6  && de==0)								{var wdry= " and sprinkles and very light precip. occurring currently  " ;}

if (wdry == "" && xwet>0 && lwet>6 && lwet<11 && de==0)								{var wdry= " and light precip. occurring currently " ;}

var ppx =  prr ;
var ppx = ppx.toLowerCase();


if (lwet >0 && dewx >0     && dewx <16   && pr>= 0.000 && dailyrain>0.00 && rh<100 && tempa >=32 && de==0)  		{var wdry = " and " + ppx + ""                                         ;}
if (lwet >0 && dewx >0     && dewx <16   && pr== 0.000 && dailyrain>0.00 && rh<100 && tempa >=32 && de==0)  		{var wdry = " and light precip. is occurring"                                         ;}


if (wdry == "" && dewx==15 && lwet==15 && de==0 )								{var wdry= " and it is wet  " ;}
if (wdry == "" && dewx==15 && lwet==0 && xwet>0 && de==0)							{var wdry= " and precip. has stopped but surfaces are wet  " ;}
if (wdry == "" && dewx>0 && dewx<12 && lwet==0 && xwet>0 && de==0)						{var wdry= " and precip. has stopped and surfaces are drying  " ;}
if (wdry == "" && xwet>0 && dewx==0 && lwet==0  && de==0)							{var wdry= " and precip. that occurred earlier has stopped and surfaces are dry  " ;}
if (wdry == "" && xwet>0 && lwet>0 && lwet<9  && rh>90 && pr==0.000 && tempa>38 && de==0)				{var wdry= " and drizzle or light rain " ;}
if (wdry == "" && xwet>0 && lwet>0 && rh>97 && sr<100 && de==0)							{var wdry= " and fog, damp and wet " ;}
if (wdry == "" && xwet>0 && lwet>0 && rh>97 && sr<100 && de==0)							{var wdry= " and fog, damp and wet " ;}


//*********************************************************************************************************************************
// START POINT OF OBSERVATIONS        19
//*********************************************************************************************************************************
if ( a>=0  && a<=8 )    	{var tt = 1,td= " early morning "  ;}	 	   // Early morning
if ( a>8  && a<=11 )  	{var tt = 2,td= " morning " ;} 		  // Morning
if ( a>11 && a<=16 )  	{var tt = 3,td= " afternoon " ;}		 // Afternoon
if ( a>16 && a<=19 ) 	{var tt = 4,td= " evening " ;}		 // Evening
if ( a>19 && a<25  )  	{var tt = 5,td= " night "  ;} 			// Night


if ( dtemp > 16) {var yt = " & a great temperature increase of " + dtemp + " deg/s since yesterday @ " + "13:55" ;}
if ( dtemp > 9 && dtemp < 17) {var yt = " & much warmer by " + dtemp + " deg/s than yesterday @ " + "13:55" ;}
if ( dtemp > 4 && dtemp < 10) {var yt = " & warmer by " + dtemp + " deg/s than yesterday @ " + "13:55" ;}
if ( dtemp > 0 && dtemp <   5)	 		{var yt = "";}
if ( dtemp == 0)	         		{var yt = "";}
if ( dtemp < 0 && dtemp >  -5)	 		{var yt = "";}
if ( dtemp <-4 && dtemp > -10) {var yt = " & cooler by " + dtemp + " deg/s than yesterday @ " + "13:55" ;}
if ( dtemp <-9 && dtemp > -17) {var yt = " & much cooler by " + dtemp + " deg/s than yesterday @ " + "13:55" ;}
if ( dtemp <-16) {var yt = " & a great temperature decrease of " + dtemp + " deg/s since yesterday @ " + "13:55" ;}

//if (dewx>1) { document.write  ("<B>" + " wsk =" + wsk  + "&nbsp; &nbsp;    wdry=  " + wdry + "&nbsp; &nbsp;  dewt =" + dewt  +  "  <BR> " + "</B>"); }
//if (dewx>1) { document.write  ("<B>" + " ww =" + ww  + "&nbsp; &nbsp; &nbsp; &nbsp;  wdry=  " + wdry + "&nbsp; &nbsp; &nbsp; &nbsp;  dewt =" + dewt  +  "  <BR> " + "</B>"); }


if (wsxt	== 0)       		{var wsxt	=  "" }
if (wdry	== 0)       		{var wdry 	=  "" }
if (windx 	== 0)       		{var wdd 	=  "" }
if (dewx 	==0)       		{var dewt 	=  "" }
if (dewx 	>0 && xwet==15)       	{var dewt 	=  "" }
if (lwet	==0)       		{var prr 		=  "" }
if (xwet	==0)       		{var stime	=  "" }
if (xwet	==0)       		{var prat		=  "" }

if ( a>=0 && a<=8 ) { document.write ("<B>" + "2/5/12 " + " at " + " 13:55 " + wsk + dewt + wdry + ". " +"<BR>" + tpf + " temperatures " + ws + wdd + yt + " . " + "<BR>" + ext + "</B>" ); }
if ( a>8 && a<=10) { document.write ("<B>" + "2/5/12 " + " at " + " 13:55 " + wsk + wdry + ". " +"<BR>" + tpf + " temperatures " + vky + ws + wdd + yt + " . " + "<BR>" + "</B>" ); }
if ( a>10 && a<=15) { document.write ("<B>" + "2/5/12 " + " at " + " 13:55 " + wsk + wdry + ". " + "<BR>" + tpf + " temperatures " + vky + ws + wdd + yt + " . " + "<BR>" + "</B>" ); }
if ( a>15 && a<=17) { document.write ("<B>" + "2/5/12 " + " at " + " 13:55 " + wsk + dewt + wdry + ". " + "<BR>" + tpf + " temperatures " + vky + ws + wdd + yt + " . " + "<BR>" + "</B>" ); }
if ( a>17 && a<=19) { document.write ("<B>" + "2/5/12 " + " at " + " 13:55 " + wsk + dewt + wdry + ". " + "<BR>" + tpf + " temperatures " + ws + wdd + yt + " . " + "<BR>" + ext + "</B>" ); }
if ( a>19 && a<25 ) { document.write ("<B>" + "2/5/12 " + " at " + " 13:55 " + wsk + dewt + wdry + ". " + "<BR>" + tpf + " temperatures " + tcht + ws + wdd + yt + " . " + "<BR>" + "</B>" ); }
//if ( lwet >0 && pdif>0.01  ) 	{ document.write  ("<B>" + "Currently " + prr  + "." + "</B>" ); }
if ( a>19 && a<25 && lwet == 0 ) 	{ document.write  ("<B>" + " The moon is in the  " + mphase + " phase and its age is " + mooph + " day/s."       + "<BR>"          + "</B>" ); }





if ( pdif>0.01 && mpr>0.01 && tdiff<8) 		{ document.write  ("<B>" + "The max. precip. rate today so far is " + mpr  +  " inches per hour at " + mprt  + " hrs. "  + "<BR>" + "</B>" ); }


//if (a>1)   { document.write(" &nbsp; PCR ="  +   pcr  	+ " &nbsp;  PR="  +  pr 	+  " &nbsp; MPR =" + mpr    	+  "<BR>" ); }
//if (a>1)   { document.write(" &nbsp; dewt=" + dewt  	+ " &nbsp;  prr="  + prr  					+  "<BR>"); }





if (drh > 10 || drh <-10 ) { document.write("<B>" + "There is " + yrh + " in the humidity since yesterday @ " + "13:55" + "." + "<BR>" + "</B>"); }

//*************************************************************************************************
//FOG &FOG WITH PRECIP    	         20
//*************************************************************************************************

if (pr > 0.000 && lwet >10 && dailyrain >0.10 && dewx >10 && tempa >32 && tempa <50 &&  pr <1.000 && rh == 100 &&  windx<5  ) { document.write ( "<B>" +  "Currently " + prr+ " and Foggy conditions." + "<BR>" + "</B>" ); }
if (pr >=1.000 && lwet >12 && dailyrain >0.10 && dewx >10 && tempa >32 && tempa <50                     && rh == 100 &&  windx<5  ) { document.write ( "<B>" +  "Currently " + prr+ " and Foggy and Very Poor Visibility." + "<BR>" + "</B>" ); }



//*************************************************************************************************
// Precipitation  		         21

//************************************************************************************************

if (mm == 1)  {var pma = 3.04 , ddm=31 , mn= " Jan." ;}
if (mm == 2)  {var pma = 2.76 , ddm=28 , mn= " Feb." ;}
if (mm == 3)  {var pma = 4.04 , ddm=31 , mn= " March" ;}
if (mm == 4)  {var pma = 3.27 , ddm=30 , mn= " April" ;}
if (mm == 5)  {var pma = 3.78 , ddm=31 , mn= " May" ;}
if (mm == 6)  {var pma = 3.93 , ddm=30 , mn= " June" ;}
if (mm == 7)  {var pma = 4.51 , ddm=31 , mn= " July" ;}
if (mm == 8)  {var pma = 4.66 , ddm=31 , mn= " Aug." ;}
if (mm == 9)  {var pma = 4.13 , ddm=30 , mn= " Sep." ;}
if (mm == 10) {var pma = 2.98 , ddm=31 , mn= " Oct." ;}
if (mm == 11) {var pma = 3.24 , ddm=30 , mn= " Nov." ;}
if (mm == 12) {var pma = 3.26 , ddm=31 , mn= " Dec." ;}

paday=((pma)/(ddm));
pave=((paday)*(day));
pcurdepart= ((pmonth)-(pave));
if (pcurdepart >= 0.000)              {var pos = " + ";}
if (pcurdepart  < 0.000)              {var pos = "  ";}




if (dsp >=4 )  { document.write ( "<B>" +  " It has been " + dsp + " days since the last measurable precip. occurred in Glen Allen . " +  "<BR>" + "</B>" ); }
if (dsp >=4 )  { document.write ( "<B>" +  "The" +  mn  + " precip. departure is now " + pos  +  pcurdepart.toFixed(2)  + " inches" + "." + "<BR>" + "</B>" ); }



if ( yp > 0.00 && a>0  && a<20 && dailyrain == 0.00 )     	{ document.write ( "<B>" + "The total precip. yesterday was " + yp.toFixed(2) + " inches & for " + mn + " " + pmonth + " inches." + "<BR>" + "</B>" ); }
if ( yp > 0.00 && a>0  && a<20 && dailyrain> 0.00 )     	{ document.write ( "<B>" + "The total precip. yesterday was " + yp.toFixed(2) + " inches." + "<BR>" + "</B>" ); }


if (dailyrain >0.00)                        			{ document.write ( "<B>" +  "The precip. for today so far is " + dailyrain + " inches & for "+ mn + " " + pmonth + " inches and the ave. precip. to " + mn + "&nbsp;" + day + " is " + pave.toFixed(2) + " inches giving a departure of " + pos  +  pcurdepart.toFixed(2)  + " inches." + "<BR>" + "</B>" ); }
if (dailyrain >0.00 && pr == 0.000 && tdiff<12 ) {document.write ("<B>" + " It has been " + tdiff.toFixed(1) + " hr/s since last 0.01 inches of precip. at " + "8:11" + " hrs." + "<BR>" + "</B>" ); }



//*************************************************************************************************
//Solar Radiation    			22
//*************************************************************************************************


if (a>8 && a<=16 && pr ==0.000) {document.write("<B>" + "Max. solar rad. today " + srhi + " watts/m²" + "&nbsp;" + " now " + sr + "w/m² &nbsp; past hr. " + srch + "w/m²." + "<BR>" + "</B>");}


if (srhi == sryhi && day>4 && mm>1 ) { document.write ("<B>" + "Today's " + "394" + "watts/m² was the highest solar radiation for the year." + "<BR>" + "</B>"); var ccsr = "1" ; }
if (srhi == srmhi && day>4 && ccsr != "1" ) { document.write ("<B>" + "Today's " + "394" + "watts/m² was the highest solar radiation for " + mn + " at " + "13:29" + " hrs. " + "<BR>" + "</B>"); }




//*************************************************************************************************
// Temperature  			23
//*************************************************************************************************


if (templo > 70 && a < 11 ) 	 				{ document.write("<B>" +  "Warm night as the low  temp. last night was a warm " + templo + " °F" + " at " + temloti + " ." + "<BR>" + "</B>"); }
if (temphi > 90 && a > 16) { document.write("<B>" + "Hot day as the high temp. today was " + temphi + " °F" + " occurring at " + "13:47" + " hours. " + "<BR>" + "</B>"); }

if (templo >=10 && templo <20 && a < 10 ) 			{ document.write("<B>" +  "Cold night as the low  temp. last night was a cold "        + templo + " °F" + " at " + temloti + " ." + "<BR>" + "</B>"); }
if (templo <10 && a < 10 )        				{ document.write("<B>" +  "VERY cold night as the low  temp. last night was a frigid " + templo + " °F" + " at " + temloti + " ." + "<BR>" + "</B>"); }
if ((temphi > 70 && temphi < 90) && (mm>11 || mm<3)) { document.write("<B>" + "Warm day as the high temp. today was " + temphi + " °F" + " occurring at " + "13:47" + " hours. " + "<BR>" + "</B>"); }

if (maxratetemp >8)                               		{ document.write("<B>"  + " The maximum  temperature change in one hour today was " + maxratetemp + " °F" + " at "  + tmaxratetemp + " hours." + "<BR>" + "</B>"); }
{ document.write("<B>" + " HIGH temperature &nbsp;&nbsp; " + "43.8" + " °F" + " at " + "13:47" + " hours" + "<BR>" + "</B>" );}
{ document.write("<B>" + " LOW temperature &nbsp;&nbsp;&nbsp; " + "36.8" + " °F " + " at &nbsp;" + temloti + " hours" + "<BR>" + "</B>" );}
{ document.write("<B>" + " Current temp. " + tempa + " °F " + " at " + "13:55" + " hours" + "<BR>" + "</B>"); }
{ document.write("<B>" +  " Temp. range &nbsp;&nbsp; "   	+ tempran + "&nbsp; &nbsp;  °F for today"  + "<BR>" + "</B>" );}
if (day>3 && tempdepart >= 0.5 ) 	  			{ document.write("<B>" +  " The daily mean temp. departure is +"  	+  tempdepart.toFixed(1)  + " °F  for " + mn + " compared to the average." + "<BR>" + "</B>" ); }
if (day>3 && tempdepart < - 0.5 ) 	  			{ document.write("<B>" +  " The daily mean temperature departure is " +  tempdepart.toFixed(1)  + " °F  for " + mn + " compared to the average." + "<BR>" + "</B>" ); }



//*************************************************************************************************
//Relative Humidity  			24
//*************************************************************************************************
if (rhrate == 0 )  {var rhc  =  "  constant. ";}
if (rhrate < 0 )   {var rhc = "   decreasing. ";}
if (rh<100 && rhrate > 0 )  {var rhc = "   increasing. ";}
if (rh==100 && rhrate > 0 )  {var rhc = "   constant. ";}



if (rello == relylo && mm>1 ) { document.write("<B>" + "Today's " + "67" + "% was the lowest Relative Humidity for the year. " + "<BR>" + "</B>" ); var cc = "1" ; }
if (rello == relmlo && day>4 && cc != "1" ) { document.write("<B>" + "Today's " + "67" + "% was the lowest Relative Humidity for " + mn + " occurring at " + "13:46" + " hours. " + "</B>"); }


//*************************************************************************************************
// AWESOME WEATHER 			25
//*************************************************************************************************
if ((mm>3 && mm<6) && a> 7 && (tempa > 70 && tempa < 80)  && rh < 35 && windx < 8)   { document.write ("<B>" +   "Awesome SPRING day with pleasant temperatures and low humidity and bright skies. "  + "<BR>" + "</B>" );}
if ((mm>3 && mm<6) && a>19 && (tempa > 65 && tempa < 75)  && rh < 55 && windx < 5)   { document.write ("<B>" +   "Awesome SPRING night with cool temperatures and low humidity. "  + "<BR>" + "</B>" );}

if ((mm>5 && mm<9) && (a>=8 && a<=17) && (heatind > 60 && heatind < 75)  && rh < 50 && windx < 12 ) {document.write = "Awesome SUMMER day with pleasant temperatures and low humidity and bright skies." ;}
if ((mm>5 && mm<9) && a>19            && (heatind > 55 && heatind < 75)  && rh < 65 && windx < 10 ) {document.write = "Awesome SUMMER night with cool temps. and low humidity." ;}


if (temphi == yrhi && mm>1 ) { document.write("<B>" + "Today's " + "43.8" + " °F was the highest temp. for the year. " + "<BR>" + "</B>"); var cct = "1" ; }
if (temphi == mmhi && day>4 && cct != "1") { document.write("<B>" + "Today's " + "43.8" + " °F was the highest temp. for " + mn + " occurring at " + "13:47" + " hours. " + "<BR>" + "</B>"); }

if (templo == yrlo && mm>1 ) { document.write("<B>" + "Today's " + "36.8" + " °F was the lowest min. temp. for the year. " + "<BR>" + "</B>"); var cct = "1" ; }
if (templo == mmlo && day>4 && cct != "1") { document.write("<B>" + "Today's " + "36.8" + " °F was the lowest min. temp. for " + mn + " occurring at " + temloti + " hours. " + "<BR>" + "</B>"); }


//*************************************************************************************************
// WIND CHILL				26
//*************************************************************************************************

if ( winchl < 20 && windx >8 ) { document.write("<B>" + "The current wind chill is " + "40.7" + " °F. " + "<BR>" + "</B>"); }


if ( winchl == winchylo && windx >5 && mm>1 ) { document.write("<B>" + "Today's " + "8.8" + " °F was the lowest wind chill for the year. " + "<BR>" + "</B>"); var ccwc = "1" ; }
if ((winchh == "40.7" && windx >5) && (mm<3 || mm>11)&& ccwc != "1" ) { document.write("<B>" + "Today's " + "72.1" + " °F was the highest wind chill for " + mn + " occurring at " + "13:47" + " hours. " + "<BR>" + "</B>"); }
if ((winchl == winchmlo && windx > 5) && (mm<5 || mm>9) && day>4 && ccwc != "1" ) { document.write("<B>" + "Today's lowest wind chill was " + "25.3" + " °F and the lowest for " + mn + " at " + "7:09" + " hours. " + "<BR>" + "</B>"); }



//*************************************************************************************************
//Dew Point     			 27
//*************************************************************************************************
if (dewptnow <2)                   {var dptc  = " extremely low dew pt. - area deep into a arctic air mass.";}
if (dewptnow >1  && dewptnow <13)  {var dptc  = " very low dew pt. - arctic air mass.  ";}
if (dewptnow >12 && dewptnow <18)  {var dptc  = " moderately low dew pt - a very dry air mass. ";}
if (dewptnow >17 && dewptnow <23)  {var dptc  = " low dew pt - dry air mass. ";}
if (dewptnow >22 && dewptnow <39)  {var dptc  = " low ";}
if (dewptnow >38 && dewptnow <65)  {var dptc  = " comfortable ";}
if (dewptnow >64 && dewptnow <68 && (mm>3 && mm<10)) {var dptc  = " comfortable zone. ";}
if (dewptnow >64 && dewptnow <68 && (mm<4 && mm>9))  {var dptc  = " nearing the uncomfortable zone. ";}
if (dewptnow >67 && dewptnow <70)  {var dptc  = " somewhat uncomfortable. ";}
if (dewptnow >69 && dewptnow <75)  {var dptc  = " uncomfortable. ";}
if (dewptnow >74 && dewptnow <79)  {var dptc  = " VERY uncomfortable.";}
if (dewptnow >78 && dewptnow <82)  {var dptc  = " EXTREMELY uncomfortable.";}
if (dewptnow >81 && dewptnow <90)  {var dptc  = " DANGEROUS. ";}


if ("34.2" >70 && windx< 3 && (a<8 || a>20)) document.write ("<B>" + "The dew point is now " + "34.2" + " °F " + " &nbsp; & &nbsp; " + "today's max. dew pt. is " + "37.1" + " °F " + " at " + "0:00" + " hrs." + "<BR>" + "The dew pt change in past hour was " + "0.03" + " °F" + " & is " + dptc + "<BR>" + "</B>" ) ;
if ("34.2" >65 && windx<=6 && (a>=8 && a<=20)) document.write ("<B>" + "The dew point is now " + "34.2" + " °F " + " &nbsp; & &nbsp; " + " Today's max. dew pt is " + "37.1" + " °F " + " at " + "0:00" + " hrs." + "<BR>" + "The dew pt change in past hour was " + "0.03" + " °F" + " & is " + dptc + "<BR>" + "</B>" ) ;
if ("34.2" >70 && windx >6 && (a>=8 && a<=20)) document.write ("<B>" + "The dew point is now " + "34.2" + " °F " + " &nbsp; & &nbsp; " + " Today's max. dew pt is " + "37.1" + " °F " + " at " + "0:00" + " hrs." + "<BR>" + "The dew pt change in past hour was " + "0.03" + " °F" + " & is " + dptc + "<BR>" + "</B>" ) ;
if ("34.2" <20) document.write ("<B>" + "The dew point is now " + "34.2" + " °F" + " and today's min. dew point was " + "33.2" + " °F " + " at " + "12:10" + " hrs." + "<BR>" + "The dew pt change in past hour was " + "0.03" + " °F" + " & is " + dptc + "<BR>" + "</B>" ) ;

if (dewpthi == dpyhi && mm >1 ) { document.write("<B>" + "Today's " + "37.1" + " °F was the highest dew point for the year. " + "<BR>" + "</B>"); var ccdp = "1" ; }
if (dewpthi == dpmhi && day>4 && ccdp !="1") { document.write("<B>" + "Today's " + "37.1" + " °F was the highest dew point for " + mn + " occurring at " + "0:00" + " hours. " + "<BR>" + "</B>"); }

if (dewptlo == dpylo && mm>1 ) { document.write("<B>" + "Today's " + "33.2" + " °F was the lowest dew point for the year. " + "<BR>" + "</B>"); var ccdp = "1" ; }
if (dewptlo == dpmlo && day>4 && ccdp !="1") { document.write("<B>" + "Today's " + "33.2" + " °F was the lowest dew point for " + mn + " occurring at " + "12:10" + " hours. " + "<BR>" + "</B>"); }

//*************************************************************************************************
// HEAT INDEX				  28
//*************************************************************************************************
if (heatind > 94) { document.write("<B>" + "The heat index (best indicator of heat discomfort) is " + heatind + " °F " + "<BR>" + "The high heat index today so far is " + hhi + " °F" + " at " + "13:17" + " hours." + "<BR>" + "</B>"); }



if (hhi == hyhi && (mm>3 && mm<11)) { document.write("<B>" + "Today's " + "71.8" + " °F was the highest heat index for the year. " + "<BR>" + "</B>"); var cchi = "1" ; }
if (hhi == hmhi && day>4 && (mm>3 && mm<11)&& cchi != "1" ) { document.write("<B>" + "Today's " + "71.8" + " °F was the highest heat index for " + mn + " occurring at " + "13:31" + " hours. " + "<BR>" + "</B>"); }
if (hlo == hmlo && day>4 && (mm>4 && mm<10 )&& cchi != "1" ) { document.write("<B>" + "Today's " + "42.5" + " °F was the lowest heat index for " + mn + " occurring at " + temloti + " hours. " + "<BR>" + "</B>"); }



//*************************************************************************************************
// Wind 				 29
//*************************************************************************************************



if (windx>5 && windx<11 )    document.write("<B>" +  "Currently " + ws + " ave. direction of " + wdave + " deg/s at " + windx + " mph." + "<BR>" + "</B>");
if (windx>=11 && tempa>=70 && tempa<=79)   document.write("<B>" +  "Currently " + ws + " with the present wind direction being " + wdd + " at " + windx + " mph." + "<BR>" + "</B>");
if (windx>=11 && tempa>79)                 document.write("<B>" +  "Currently " + ws + " with a " + wdd + " wind " + " at " + windx + " mph." + "<BR>" + "</B>");
if (wmax>=19 ) document.write("<B>" + "The high wind gust today was " + wmax + " mph at " + "10:43" + " hours." + "<BR>" + "</B>");
if ("18" >=19 ) document.write("<B>" + "The high wind gust yesterday was " + "18" + " mph at " + "8:47" + " hours." + "<BR>" + "</B>");


if (wmax == winyhi && mm>1) { document.write("<B>" + "Today's " + "16"+ " mph wind gust was the highest for the year. " + "<BR>" + "</B>"); var ccwg = "1" ; }
if (wmax == winmhi && day>4 && ccwg != "1") { document.write("<B>" + "Today's " + "16" + " mph wind gust was the highest for " + mn + " occurring at " + "10:43" + " hours. " + "<BR>" + "</B>"); }

//*************************************************************************************************
// BAROMETER and Trend 		        30
//*************************************************************************************************

var barx = "30.13";
var brate = "-0.009";
var barhi = "30.15";
var bary = "30.15";
var bc = "-0.03";


var barxtwodecimalsupperbound = parseFloat(barx) + parseFloat(0.1);
var barxtwodecimalslowerbound = parseFloat(barx) - parseFloat(0.1);

barxtwodecimalsupperbound = barxtwodecimalsupperbound.toFixed(2);
barxtwodecimalslowerbound = barxtwodecimalslowerbound.toFixed(2);



if ( brate >  0.050 )                                  		{var brt = 1,brtt= " rising VERY RAPIDLY "  ;} // rising VERY RAPIDLY
if ( brate >  0.025 &&  brate <=0.050)                  	{var brt = 2,brtt= " rising RAPIDLY "  ;} // rising RAPIDLY
if ( brate >  0.010 &&  brate <=0.025)                  	{var brt = 3,brtt= " rising "  ;} // rising
if ( brate >=0.001 &&  brate <=0.010)		{var brt = 4,brtt= " rising slowly "  ;} // rising slowly
if ( brate == 0.000)		                  	{var brt = 5,brtt= " steady "  ;} // steady
if ( brate <= -0.001 && brate>=-0.010)		{var brt = 6,brtt= " falling slowly "  ;} // falling slowly
if ( brate < -0.010 && brate >= -0.025)                 	{var brt = 7,brtt= " falling "  ;} // falling
if ( brate < -0.025 && brate >= -0.050)                  	{var brt = 8,brtt= " falling rapidly "  ;} // falling rapidly
if ( brate < -0.050)                                   		{var brt = 9,brtt= " falling Very rapidly "  ;} // falling Very rapidly


if ( bc>     0.50)                                 			{var bdi = 0  ;} // Bar. up since yesterday
if ( bc>     0.30  &&  bc< 0.51)               		{var bdi = 1  ;}
if ( bc>     0.20  &&  bc< 0.31)               		{var bdi = 2  ;}
if ( bc>     0.10  &&  bc< 0.21)               		{var bdi = 3  ;}
if ( bc>=  0.01  &&  bc< 0.11)			{var bdi = 4  ;}
if ( bc == 0.00)		                     		{var bdi = 5  ;} // Bar. steady since yesterday
if ( bc<= -0.01 &&  bc>-0.11)			{var bdi = 6  ;}
if ( bc<    -0.10 &&  bc>-0.21)                		{var bdi = 7  ;}
if ( bc<    -0.20 &&  bc>-0.31)                		{var bdi = 8  ;}
if ( bc<    -0.30 &&  bc>-0.51)                		{var bdi = 9  ;}
if ( bc<    -0.50)                                 			{var bdi = 10 ;} // Bar. down since yesterday




// if current pressure is steady indicating a slow system movement but a pressure change of >0.60 should indicate fast moving systems

if (brt<5)               			  				{var dt= " barometer is now " + brtt +  " at a rate of " + brate  + " inches per hour" ;}
if (brt == 5 && bc  >  0.60 )                                  				{var dt= " barometer is steady now but has risen " + bc  + " inches since yesterday thus systems are moving fast and is often associated with windy conditions " ;cc=66666 ;}
if (brt == 5 && bc  >  0.40 &&  bc <=0.60)                  			{var dt= " barometer is steady now but has risen " + bc  + " inches since yesterday thus systems are moving pretty fast" ;}
if (brt == 5 && bc  >  0.30 &&  bc <=0.40)                  			{var dt= " barometer is steady now but has risen " + bc  + " inches since yesterday thus systems are moving faster than average" ;}
if (brt == 5 && bc  >=  0.01 &&  bc <=0.30)					{var dt= " barometer is steady now but has risen " + bc  + " inches since yesterday at this time thus systems are moving slowly" ;}
if (brt == 5 && bc  == 0.00 && lwet==0)		                 		{var dt= " barometer is very steady now thus systems are moving very slowly and the pressure change in the past 24 hours is 0.00 inches" ;}
if (brt == 5 && bc  == 0.00 && lwet>0)		                 		{var dt= " barometer is very steady now thus conditions should change little in the next 6 hours " ;}
if (brt == 5 && bc  <= -0.01 && bc >=-0.30)					{var dt= " barometer is steady now but has fallen " + bc  + " inches since yesterday at this time thus systems are moving slowly" ;}
if (brt == 5 && bc  < -0.30 && bc >= -0.40)                 			{var dt= " barometer is steady now but has fallen " + bc  + " inches since  yesterday thus systems are moving faster than average" ;}
if (brt == 5 && bc  < -0.40 && bc >= -0.60)                  			{var dt= " barometer is steady now but has fallen " + bc  + " inches since  yesterday thus systems are moving pretty fast" ;}
if (brt == 5 && bc  < -0.60)                                   				{var dt= " barometer is steady now but has fallen " + bc  + " inches since  yesterday thus systems are moving fast and is often associated with windy conditions " ;}
if (brt>5)               			    				{var dt= " barometer is now " + brtt +  " at a rate of " + brate  + " inches per hour" ;}






if (bdi<5 && brt<5)                	   					{var bc= " and the barometric pressure is " + bc  + " inches  higher today than yesterday at this time. " + "<BR>" ;}
if (bdi<5 && brt>5)                	   					{var bc= " but the barometric pressure is " + bc  + " inches  higher  now than yesterday at this time. " + "<BR>" ;}

if (bdi == 5 && brt<5)             	 					{var bc= " but the barometric pressure is nearly the same as yesterday at this time. " + "<BR>"  ;}
if (bdi == 5 && brt>5)                	 					{var bc= " but the barometric pressure is nearly the same as yesterday at this time. "+ "<BR>"   ;}

if (bdi>5 && brt<5)               						{var bc= " but the barometric pressure is " + bc  + " inches  lower now than yesterday at this time. " + "<BR>"   ;}
if (bdi>5 && brt>5)                						{var bc= " and the barometric pressure is " + bc  + " inches  lower now than yesterday at this time. " + "<BR>"   ;}

if (brt==5)                	               						{var bc= " " ;}


if ( brate > 0.09)                                  					{var barte = " rising VERY RAPIDLY ";}
if ( brate > 0.05 && brate < 0.10)                  				{var barte = " rising RAPIDLY ";}
if ( brate > 0.02 && brate < 0.06 )                 				{var barte = " rising ";}
if ( brate < 0.00 && brate > -0.03 )						{var barte = " steady ";}
if ( brate <-0.02 && brate > -0.06)                 				{var barte = " falling ";}
if ( brate <-0.05 && brate > -0.10 )                				{var barte = " falling rapidly ";}
if ( brate <-0.09)                                  					{var barte = " falling Very rapidly  ";}

if ((brt<3 && bc>.20) || (brt>7 && bc<-.20) )   				{ document.write  ( "The " + dt +bc + "<BR>" ); }


if (brt<3 && bc>.20)   {document.write ( "<B>" +  "The barometer is " + barx + " inches and is " + barte  + " at " + brate + " inches in past hour. "  + "<BR>" + "</B>" ); }
if (brt>7 && bc<-.20)  {document.write ( "<B>" +  "The barometer is " + barx + " inches and is " + barte  + " at " + brate + " inches in past hour. "  + "<BR>" + "</B>" ); }


if ( "30.15" > 30.50 && wdd>2 && wdd<6 && (mm< 3 || mm>11 )) {document.write ( "<B>" + "High barometric pressure often proceeds winter storms " + " 30.15 " + " inches was recorded at " + " 10:59 " + " hours. " + "</B>" ); }

if ( "30.15" > 30.50 && "329" < 100 && "36.8" < 15 && brate > -0.02 ) {document.write ( "<B>" + " Conditions are right for a significant winter snowstorm if a low pressure is in the SE states. " + "<BR>" + "</B>" ); }

if ( barx < 29.58 && (mm<4 || mm>11 ))  						{document.write ( "<B>" +  "Expect precip. with today's low pressure followed by windy conditions. " + "<BR>"  + "</B>" ); }


if (brate > 0.2 ) { document.write("<B>" + "The maximum barometer rise rate for today is " + "0.034" + " inches occurring at " + "8:29" + " hrs. " + "<BR>" + "</B>"); }
if (brate < -0.2 ) { document.write("<B>" + "The maximum barometer fall rate for today is " + "-0.022" + " inches occurring at " + "1:29" + " hrs. " + "<BR>" + "</B>"); }

if (barhi == baryhi && day>4 && mm>1) { document.write("<B>" + "Today's barometer was the highest for the year " + " at " + "30.15" + " inches occurring at " + "10:59" + " hrs. " + "<BR>" + "</B>"); var cc = "1" ; }
if (barhi == barmhi && day>4 && cc != "1" ) { document.write("<B>" + "Today's barometer was the highest for " + mn + " at "+ "30.15" + " inches occurring at " + "10:59" + " hrs. " + "<BR>" + "</B>"); }

if (barlo == barylo && mm>1 ) { document.write("<B>" + "Today's barometer was the lowest for the year " + " at " + "30.05" + " inches occurring at " + "4:59" + " hrs. " + "<BR>" + "</B>"); var cc = "1" ; }
if (barlo == barmlo && day>4 && cc != "1" ) { document.write("<B>" + "Today's barometer was the lowest for " + mn + " at " + "30.05" + " inches occurring at " + "4:59" + " hrs. " + "<BR>" + "</B>"); }




//*************************************************************************************************
// FORECAST AND WEATHER TRENDs 		31  use  && cc != "1"  to cut doubles   ;var cc = 1; with cold fronts
//*************************************************************************************************
// COLD FRONT APPROACHING Glen Allen  NO  PRECIPITATION YET
//  MUST BAROMETER FALL RATE OF > -0.03 && pr== 0.000
if (tempa >40 && brate< -0.03 && wdave >140 && wdave <270 && barx<29.75) { document.write("<B>" +  " A cold front is approaching the Glen Allen  area expect precip. and increasing winds with passage. " + "<BR>" + "</B>") ;var cc=1;}
if (tempa >40 && brate< -0.03 && wdave > 40 && wdave <130 && barx<29.75) { document.write("<B>" +  " A low pressure is approaching the Glen Allen  area expect precip. and increasing winds after passage. " + "<BR>" + "</B>") ;var cc=1;}

// COLD FRONT has passed Glen Allen  NO  PRECIPITATION
if (pr == 0.000 && dailyrain == 0.00 && xwet==0 && ww == "overcast"  && tch >3.5  && tempa >30 && brate> 0.03  && windx>10 && wdave >260 ) { document.write("<B>" +  " A Cold Front has passed the Glen Allen  area with no precip. but expect windy conditions and decreasing clouds. " + "<BR>" + "</B>");var cc=1; }

// COLD FRONT HAS PASSED  PRECIPITATION ENDING
if (pr == 0.000 && dailyrain >0.20 && lwet==0 && tempa >32 && tempa <70 && windx>9 && wdave > 260 && brate > 0.03 && thrch < -1.5 && dewptra < -2.0 && rh < 79) { document.write("<B>" + " Measurable rainfall interval ended earlier today and at " + "8:11" + " - no precip. currently and a cold frontal passage has occurred causing an increase in wind and drying conditions and decreasing clouds. " + "<BR>" + "</B>");var cc=1; }
if (pr == 0.000 && dailyrain >0.00 && lwet==0 && dewx == 0 && dewptnow >67 && rh >80 && a>9 && a<18) { document.write("<B>" + " precip. ended earlier today at " + "8:11" + " - no precip. currently but humid conditions and high dew point temps. may cause thunderstorms later today. " + "<BR>" + "</B>"); }


//  LIGHT OR MODERATE OR HEAVY PRECIPITATION OCCURRING AND INTENSITY -- MESURABLE
//  MUST    rh < 100 and Barometer steady or rising
if (pr == 0.000 && dailyrain >0.08 && lwet ==0  && tempa >30 && tempa <65 && windx>10 && thrch < -1  && wdave>260 && brate> 0.01)     { document.write("<B>" + " Decreasing clouds--- increasing winds and drying conditions after earlier precip. today. " + "<BR>" + "</B>"); }
if ( a>7 && a<17 && dailyrain >0.01 && lwet >13 && wdave >45 && wdave<100 && wdyes >10 && wdave<120 && dewx >2  && tempa >38 && tempa <60  &&  sr<60 && rh>70 && barx>29.91)         { document.write("<B>" + " Cloudy damp conditions with light precip. gray skies & gloomy weather. "                        + "<BR>" + "</B>"); }
if ((mm==12 || mm<5) && wdave >45 && wdave<100 && wdyes >10 && wdave<120 && dewx >2  && tempa >38 && tempa <60  &&  sr<80 && rh>70 && barx>29.91 && mm>9) { document.write("<B>" + " Morning fog is also very likely when land is colder then the water of the ocean and the bay."    + "<BR>" + "</B>"); }


