// JavaScript Document
var vwstemp = 'C';
var vwswind = 'N';
var vwsbaro = 'mb';
var vwsrain = 'mm';
var vwsheight = 'M';
var vwsdist = 'M';
var vwsknots = 'N';
var flashcolor = '#006600'; // RGB color to flash for changed observations
var flashtime  = 1000;    // miliseconds to keep flash color on (2000 = 2 seconds);
var reloadTime = 5000;      // reload AJAX conditions every 5 seconds (= 5000 ms)
var maxupdates = 0;	         // Maxium Number of updates allowed (set to zero for unlimited)
var wflashDir = '../wflash/';   // URL for directory for WeatherFlash relative to this script with
var imagedir = './images/ajax-images'  // place for wind arrows, rising/falling arrows, etc.
var useunits = 'C';         // 'E'=USA(English) or 'M'=Metric or 'W'=use WeatherFlash settings
var useKnots = false;       // set to true to use wind speed in Knots (otherwise 
var useMPS   = false;       // set to true for meters/second for metric wind speeds, false= km/h
var showUnits = true;       //  set to false if no units are to be displayed
var useAMPM   = true;       // set to false for 24hr time (only used for update time value)
var showNoWind = true;      // true shows wind=0 as 'Calm' and gust=0 as 'No Wind'
var thermometer = './thermometer.php'; // script for dynamic thermometer PNG image (optional)
var wrName   = 'wr-';       // first part of the graphic filename (followed by winddir to complete it)
var wrType   = '.gif';      // extension of the graphic filename
var wrHeight = '187';        // windrose graphic height=
var wrWidth  = '170';        // windrose graphic width=
var wrCalm   = 'wr-calm.gif';  // set to full name of graphic for calm display ('wr-calm.gif')
var langPauseMsg = 'Updates paused - reload page to start'; // substitute this for ajaxindicator when
var langMonths = new Array ( "January","February","March","April","May",
			"June","July","August","September","October","November","December");
var langDays = new Array ( "Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");	
var langBaroTrend = new Array (
 "Steady", "Rising Slowly", "Rising Rapidly", "Falling Slowly", "Falling Rapidly");
var langUVWords = new Array (
 "None", "Low", "Medium", "High",
 "Very&nbsp;High", /* be sure to include &nbsp; for space */
 "Extreme" );
var langBeaufort = new Array ( /* Beaufort 0 to 12 in array */
 "Calm", "Light air", "Light breeze", "Gentle breeze", "Moderate breeze", "Fresh breeze",
 "Strong breeze", "Near gale", "Gale", "Strong gale", "Storm",
 "Violent storm", "Hurricane"
);
var langWindDir = new Array( /* used for alt and title tags on wind dir arrow and wind direction display */
	"N", "NNE", "NE", "ENE", 
	"E", "ESE", "SE", "SSE", 
	"S", "SSW", "SW", "WSW", 
	"W", "WNW", "NW", "NNW");
var langWindCalm = 'Calm';
var langGustNone = 'None';
var langWindFrom = 'Wind from '; /* used on alt/title tags on wind direction arrow*/
var langBaroRising = 'Rising %s '; /* used for trend arrow alt/title tags .. %s marks where value will be placed */
var langBaroFalling = 'Falling %s ';
var langBaroPerHour = '/hour.'; /* will be assembled as rising/falling + value + uom + perhour text */
var langThermoCurrently = 'Currently: '; /* used on alt/title tags for thermometer */
var langThermoMax     = 'Max: ';
var langThermoMin     = 'Min: ';
var langTempRising = 'Rising %s '; /* used for trend arrow alt/title tags .. %s marks where value will be placed */
var langTempFalling = 'Falling %s ';
var langTempPerHour = '/hour.';
var langHumRising = 'Rising %s '; /* used for trend arrow alt/title tags .. %s marks where value will be placed */
var langHumFalling = 'Falling %s ';
var langHumPerHour = '/hour.';
var wflashFile = wflashDir+'data/wflash.txt'; // location of wflash.txt relative to this page on website
var wflashFile2 = wflashDir+'data/wflash2.txt'; // location of wflash2.txt relative to this page on website
var wflashUnitsFile = wflashDir+'Config/Units.txt'; // location of Config/Units.txt file for wflash
var ie4=document.all;
var browser = navigator.appName;
var ie8 = false;
if (ie4 && /MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ieversion>=8) {
   ie4=false;
   ie8=true;
 }
}

var counterSecs = 0;  // for MCHALLIS counter script from weather-watch.com (adapted by K. True)
var updates = 0;		// update counter for limit by maxupdates
var lastajaxtime = 'unknown'; //used to reset the counter when a real update is done
var doTooltip = 0;   // set to 1 to have ajaxed variable names appear as tooltips (except for graphics)
var uomTemp = '&deg;F'; 	var uomTempCnvt = 0;
var uomWind = ' mph';   	var uomWindCnvt = 0;
var uomBaro = ' inHg';  	var uomBaroCnvt = 0;
var uomRain = ' in';    	var uomRainCnvt = 0;
var uomHumid= '%';      
var uomSolar= ' W/m<sup>2</sup>';
var uomHeight = ' ft';  	var uomHeightCnvt = 0;
var uomDistance = ' miles'; var uomDistanceCnvt = 0;
var uomPerHr = '/hr';
var uomWindDir = '&deg;';
var dpBaro = 2;
var dpRain = 2;
var dpcloudbase = 1;

