NAME = Weather

INCLUDE_1 = 

IS_WEATHER = 1

CAN_EDIT_STYLE = 1
CAN_EDIT_BACKGROUND_IMAGE = [$DEFINITION]/background.png

BEGIN_BODY_ONLOAD

	<div id="[$DEF_name]Div" style="display: block;
	[$STYLE_background]
	[$STYLE_background-color]
	[$STYLE_color]
	[$STYLE_text-shadow]
	[$STYLE_font-family]
	[$STYLE_font-weight]
	[$STYLE_font-size]
	[$STYLE_height]
	[$STYLE_width]
	[$STYLE_margin]
	[$STYLE_padding]
	[$STYLE_font-style]
	[$STYLE_word-spacing]
	[$STYLE_text-align]
	[$STYLE_text-indent]
	[$STYLE_text-transform]
	[$STYLE_text-decoration]
	[$STYLE_line-height]
	[$STYLE_border]
	[$STYLE_border-top]
	[$STYLE_border-bottom]
	[$STYLE_border-left]
	[$STYLE_border-right]
	[$STYLE_position_element]
	[$STYLE_transform]
	min-height: 10px;
	overflow: hidden;
	">

		<img id="[$DEF_name]Icon" src="" alt="" style="display: none;
		width: 100%;
		height: 100%;
		[$STYLE_reflection]
		">      
	      
		<span id="[$DEF_name]Text" style="display: none;
		[$STYLE_position_content]
		[$STYLE_reflection]
		">
		</span>

	</div>

END_BODY_ONLOAD

BEGIN_ONLOAD

   [$DEF_name]Load();

END_ONLOAD

BEGIN_DEFINITION

	var [$DEF_name]Interval 	= 1000 * [$DEF_interval];
	var [$DEF_name]IntervalID 	= 0;
	var [$DEF_name]LastShown 	= 0;
	var [$DEF_name]IconSet      = "[$DEF_iconSet]";
	
	var [$DEF_name]AppleIcons =
	[
	  "mini-sun.png",   	// 1  Sunny
	  "mini-suncloud.png",	// 2  Mostly Sunny
	  "mini-suncloud.png",	// 3  Partly Sunny
	  "mini-suncloud.png",	// 4  Intermittent Clouds
	  "mini-sunhaze.png",	// 5  Hazy Sunshine
	  "mini-clouds.png",	// 6  Mostly Cloudy
	  "mini-clouds.png",	// 7  Cloudy (am/pm)
	  "mini-clouds.png",	// 8  Dreary (am/pm)
	  "moon-1.png", 		// 9  retired
	  "moon-1.png", 		// 10 retired
	  "mini-fog.png", 		// 11 fog (am/pm)
	  "mini-rain.png", 		// 12 showers (am/pm)
	  "mini-cloudrain.png",	// 13 Mostly Cloudy with Showers
	  "mini-sunrain.png",	// 14 Partly Sunny with Showers
	  "mini-lightning.png",	// 15 Thunderstorms (am/pm)
	  "mini-lightning.png",	// 16 Mostly Cloudy with Thunder Showers
	  "mini-lightning.png",	// 17 Partly Sunnty with Thunder Showers
	  "mini-rain.png",		// 18 Rain (am/pm)
	  "mini-flurries.png",	// 19 Flurries (am/pm)
	  "mini-flurries.png",	// 20 Mostly Cloudy with Flurries
	  "mini-flurries.png",	// 21 Partly Sunny with Flurries
	  "mini-snow.png",     	// 22 Snow (am/pm)
	  "mini-snow.png",      // 23 Mostly Cloudy with Snow
	  "mini-ice.png",      	// 24 Ice (am/pm)
	  "mini-snowrain.png",	// 25 Sleet (am/pm)
	  "mini-hail.png",  	// 26 Freezing Rain (am/pm)
	  "moon-1.png",         // 27 retired
	  "moon-1.png",         // 28 retired
	  "mini-snowrain.png",	// 29 Rain and Snow Mixed (am/pm)
	  "mini-sun.png",      	// 30 Hot (am/pm)
	  "mini-sun.png",   	// 31 Cold (am/pm)
	  "mini-wind.png",    	// 32 Windy (am/pm)
	  
	  // Night only Icons;
	  "moon-18.png",   		// 33 Clear
	  "moon-18.png", 		// 34 Mostly Clear
	  "moon-18.png", 		// 35 Partly Cloudy
	  "moon-18.png", 		// 36 Intermittent Clouds
	  "moon-18.png", 		// 37 Hazy
	  "moon-18.png",       	// 38 Mostly Cloudy
	  "moon-18.png", 		// 39 Partly Cloudy with Showers
	  "moon-18.png", 		// 40 Mostly Cloudy with Showers
	  "moon-18.png", 		// 41 Partly Cloudy with Thunder Showers
	  "moon-18.png", 		// 42 Mostly Cloudy with Thunder Showers
	  "moon-18.png", 		// 43 Mostly Cloudy with Flurries
	  "moon-18.png",  		// 44 Mostly Cloudy with Flurries
	];

	var [$DEF_name]Icons =
	[
	  "sunny.png",         	// 1  Sunny
	  "cloudy1.png",      	// 2  Mostly Sunny
	  "cloudy2.png",       	// 3  Partly Sunny
	  "cloudy3.png",       	// 4  Intermittent Clouds
	  "cloudy4.png",       	// 5  Hazy Sunshine
	  "cloudy5.png",       	// 6  Mostly Cloudy
	  "cloudy5.png",       	// 7  Cloudy (am/pm)
	  "overcast.png",      	// 8  Dreary (am/pm)
	  "dunno.png",         	// 9  retired
	  "dunno.png",         	// 10 retired
	  "fog.png",           	// 11 fog (am/pm)
	  "shower1.png",       	// 12 showers (am/pm)
	  "shower3.png",       	// 13 Mostly Cloudy with Showers
	  "shower2.png",       	// 14 Partly Sunny with Showers
	  "tstorm3.png",       	// 15 Thunderstorms (am/pm)
	  "tstorm2.png",       	// 16 Mostly Cloudy with Thunder Showers
	  "tstorm1.png",       	// 17 Partly Sunnty with Thunder Showers
	  "light_rain.png",    	// 18 Rain (am/pm)
	  "cloudy5.png",       	// 19 Flurries (am/pm)
	  "cloudy4.png",       	// 20 Mostly Cloudy with Flurries
	  "cloudy2.png",       	// 21 Partly Sunny with Flurries
	  "snow5.png",         	// 22 Snow (am/pm)
	  "snow3.png",         	// 23 Mostly Cloudy with Snow
	  "hail.png",          	// 24 Ice (am/pm)
	  "sleet.png",         	// 25 Sleet (am/pm)
	  "hail.png",          	// 26 Freezing Rain (am/pm)
	  "dunno.png",         	// 27 retired
	  "dunno.png",         	// 28 retired
	  "sleet.png",         	// 29 Rain and Snow Mixed (am/pm)
	  "sunny.png",         	// 30 Hot (am/pm)
	  "sunny_night.png",   	// 31 Cold (am/pm)
	  "mist.png",          	// 32 Windy (am/pm)
	  
	  // Night only Icons;
	  "sunny_night.png",   	// 33 Clear
	  "cloudy1_night.png", 	// 34 Mostly Clear
	  "cloudy2_night.png", 	// 35 Partly Cloudy
	  "cloudy3_night.png", 	// 36 Intermittent Clouds
	  "cloudy4_night.png", 	// 37 Hazy
	  "cloudy5.png",       	// 38 Mostly Cloudy
	  "shower2_night.png", 	// 39 Partly Cloudy with Showers
	  "shower3_night.png", 	// 40 Mostly Cloudy with Showers
	  "tstorm1_night.png", 	// 41 Partly Cloudy with Thunder Showers
	  "tstorm2_night.png", 	// 42 Mostly Cloudy with Thunder Showers
	  "cloudy4_night.png", 	// 43 Mostly Cloudy with Flurries
	  "cloudy4_night.png", 	// 44 Mostly Cloudy with Flurries
	];

	//-------------------------------------------------------------

	function [$DEF_name]IconPath(index)
	{
		if ([$DEF_name]IconSet == 'Apple')
		{
			iconPath = "[$DEFINITION]/WeatherIcons/" + [$DEF_name]IconSet + "/" + [$DEF_name]AppleIcons[index];
		}
		else if (([$DEF_name]IconSet == 'Accu1')||([$DEF_name]IconSet == 'Accu2'))
		{
			icon = sprintf("%02d.gif", index+1); // array index 0... translates to name 01...
			iconPath = "[$DEFINITION]/WeatherIcons/" + [$DEF_name]IconSet + "/" + icon;
		}
		else
		{
			iconPath = "[$DEFINITION]/WeatherIcons/" + [$DEF_name]IconSet + "/" + [$DEF_name]Icons[index];
		}
		
		return iconPath;
	}
	
	//-------------------------------------------------------------

	function [$DEF_name]Update(obj)
	{
		if (obj.error)
		{
			document.getElementById("[$DEF_name]Text").innerHTML = obj.errorString;
		}
		else
		{
			var FormatStr = "[$DEF_format]";
			var theText;
			
			var useObj = {error:false, errorString:null};
			
			useObj = obj.forecast[0];
			
			//---
			
			if (FormatStr.search(/\$ICON/i) != -1)
			{
				if (FormatStr.search(/\$ICON00/i) != -1) 		tmpObj = obj.forecast[0];
				else if (FormatStr.search(/\$ICON01/i) != -1) 	tmpObj = obj.forecast[1];
				else if (FormatStr.search(/\$ICON02/i) != -1) 	tmpObj = obj.forecast[2];
				else if (FormatStr.search(/\$ICON03/i) != -1) 	tmpObj = obj.forecast[3];
				else if (FormatStr.search(/\$ICON04/i) != -1) 	tmpObj = obj.forecast[4];
				else if (FormatStr.search(/\$ICON05/i) != -1) 	tmpObj = obj.forecast[5];
				else if (FormatStr.search(/\$ICON06/i) != -1) 	tmpObj = obj.forecast[6];
				
				iconPath = [$DEF_name]IconPath(tmpObj.icon);
				
				document.getElementById("[$DEF_name]Icon").style.display = 'block';
				document.getElementById("[$DEF_name]Icon").src = iconPath;
			}
			else
			{
				theText = FormatStr;
				//---
				
				theText = theText.replace(/\$CITY/g, obj.city);

				theText = theText.replace(/\$CTF/g, useObj.temp + "&#176;F");
				theText = theText.replace(/\$RCTF/g, useObj.realFeel + "&#176;F");
				
				theText = theText.replace(/\$CTC/g, toCelsius(useObj.temp) + "&#176;C");
				theText = theText.replace(/\$RCTC/g, toCelsius(useObj.realFeel) + "&#176;C");

				theText = theText.replace(/\$HUM/g, useObj.humidity);
				theText = theText.replace(/\$PRESDIR/g, useObj.pressureDir);
				theText = theText.replace(/\$PRES/g, useObj.pressure);
				theText = theText.replace(/\$PRECIP/g, useObj.precip);
				theText = theText.replace(/\$SR/g, useObj.sunRise.str);
				theText = theText.replace(/\$SS/g, useObj.sunSet.str);
				theText = theText.replace(/\$MR/g, useObj.moonRise.str);
				theText = theText.replace(/\$MS/g, useObj.moonSet.str);
				theText = theText.replace(/\$UV/g, useObj.UVIndex);
				theText = theText.replace(/\$VIS/g, useObj.visibility);
				theText = theText.replace(/\$AIR/g, useObj.airQuality);
				theText = theText.replace(/\$PTREE/g, useObj.pollenTree);
				theText = theText.replace(/\$PWEED/g, useObj.pollenWeed);
				theText = theText.replace(/\$PGRASS/g, useObj.pollenGrass);
				theText = theText.replace(/\$PMOLD/g, useObj.pollenMold);
				
				for (i = 0; i <= 6; ++i)
				{
					sel = sprintf("%02d", i);
					
					tmpObj = obj.forecast[i];
					
					iconPath = [$DEF_name]IconPath(tmpObj.icon);
					
					rep = '<img src=' + "\"" + iconPath + "\"" + ' width="[$DEF_iconSize]" alt="" align=absmiddle>';
					rx = new RegExp("\\$WICON"+sel, "gi"); 	theText = theText.replace(rx, rep);
					
					halfSize = [$DEF_iconSize] / 2;
					rep = '<img src=' + "\"" + iconPath + "\"" + ' width="' + halfSize + '" alt="" align=absmiddle>';
					rx = new RegExp("\\$SICON"+sel, "gi"); 	theText = theText.replace(rx, rep);
					
					doubleSize = [$DEF_iconSize] * 2;
					rep = '<img src=' + "\"" + iconPath + "\"" + ' width="' + doubleSize + '" alt="" align=absmiddle>';
					rx = new RegExp("\\$LICON"+sel, "gi"); 	theText = theText.replace(rx, rep);
					
					rx = new RegExp("\\$SD"+sel, "g");		theText = theText.replace(rx, tmpObj.desc);
					rx = new RegExp("\\$LD"+sel, "g");		theText = theText.replace(rx, tmpObj.longDesc);
					rx = new RegExp("\\$DAY"+sel, "g");		theText = theText.replace(rx, tmpObj.day);
					rx = new RegExp("\\$DATE"+sel, "g");	theText = theText.replace(rx, tmpObj.date);
				
					rx = new RegExp("\\$HTF"+sel, "g");		theText = theText.replace(rx, tmpObj.tempHi + "&#176;F");
					rx = new RegExp("\\$RHTF"+sel, "g");	theText = theText.replace(rx, tmpObj.realFeelHi + "&#176;F");
					rx = new RegExp("\\$LTF"+sel, "g");		theText = theText.replace(rx, tmpObj.tempLo + "&#176;F");
					rx = new RegExp("\\$RLTF"+sel, "g");	theText = theText.replace(rx, tmpObj.realFeelLo + "&#176;F");
				
					rx = new RegExp("\\$HTC"+sel, "g");		theText = theText.replace(rx, toCelsius(tmpObj.tempHi) + "&#176;C");
					rx = new RegExp("\\$RHTC"+sel, "g");	theText = theText.replace(rx, toCelsius(tmpObj.realFeelHi) + "&#176;C");
					rx = new RegExp("\\$LTC"+sel, "g");		theText = theText.replace(rx, toCelsius(tmpObj.tempLo) + "&#176;C");
					rx = new RegExp("\\$RLTC"+sel, "g");	theText = theText.replace(rx, toCelsius(tmpObj.realFeelLo) + "&#176;C");

					rx = new RegExp("\\$WS"+sel, "g");		theText = theText.replace(rx, tmpObj.windSpeed);
					rx = new RegExp("\\$WD"+sel, "g");		theText = theText.replace(rx, tmpObj.windDir);
					rx = new RegExp("\\$WG"+sel, "g");		theText = theText.replace(rx, tmpObj.windGust);
					rx = new RegExp("\\$RAIN"+sel, "g");	theText = theText.replace(rx, tmpObj.rainAmt);
					rx = new RegExp("\\$SNOW"+sel, "g");	theText = theText.replace(rx, tmpObj.snowAmt);
					rx = new RegExp("\\$PR"+sel, "g");		theText = theText.replace(rx, tmpObj.precipAmt);
					rx = new RegExp("\\$MAXUV"+sel, "g");	theText = theText.replace(rx, tmpObj.maxUV);
					rx = new RegExp("\\$TSTORM"+sel, "g");	theText = theText.replace(rx, tmpObj.tStormProb);
				}
				
				//---
				
				document.getElementById("[$DEF_name]Text").style.display = 'block';
				document.getElementById("[$DEF_name]Text").innerHTML = theText;
			}
		}
	}

	//-------------------------------------------------------------

	function [$DEF_name]Load()
	{
		var CurrentTimestamp = new Date();
		var CurrentTime = CurrentTimestamp.getTime();
		
		delete CurrentTimestamp;
		
		if ([$DEF_name]LastShown + [$DEF_name]Interval - 1000 <= CurrentTime)
		{
			url = "http://apple.accuweather.com/adcbin/apple/Apple_Weather_Data.asp?zipcode=[$DEF_postal]";

			var xmlReq = new XMLHttpRequest();
			xmlReq.onreadystatechange = function(e){[$DEF_name]Callback(e, xmlReq);}
			xmlReq.overrideMimeType("text/xml");
			xmlReq.open("GET", url);
			xmlReq.setRequestHeader("Cache-Control", "no-cache");
			xmlReq.setRequestHeader("wx", "385");
			xmlReq.send(null); 

			var CurrentTimestamp = new Date();
			[$DEF_name]LastShown = CurrentTimestamp.getTime();
			delete CurrentTimestamp;
		}

		if ([$DEF_name]IntervalID)
		{
			clearInterval( [$DEF_name]IntervalID );
			[$DEF_name]IntervalID = 0;
		}
		
		if ([$DEF_name]Interval)
			[$DEF_name]IntervalID = setInterval([$DEF_name]Load, [$DEF_name]Interval);
	}

	//-------------------------------------------------------------

	function [$DEF_name]Callback(event, xmlReq)
	{
		if (xmlReq.readyState != 4)						return;
		if (xmlReq.status != 200 && xmlReq.status != 0)	return;
		if (!xmlReq.responseXML)						return;

		var obj = {error:false, errorString:null};
		
		var CurrentConditions = findChild(findChild(xmlReq.responseXML, "adc_Database"), "CurrentConditions");
		var Planets = findChild(findChild(xmlReq.responseXML, "adc_Database"), "Planets");
		var AirAndPollen = findChild(findChild(xmlReq.responseXML, "adc_Database"), "AirAndPollen");
		var Forecast = findChild(findChild(xmlReq.responseXML, "adc_Database"), "Forecast");

		tag = findChild(CurrentConditions, "City");
		obj.city = trimWhiteSpace(tag.firstChild.data.toString());
		
		//---
		{
			var j = 0;
			
			obj.forecast = new Array;
		
			for (child = Forecast.firstChild; child; child = child.nextSibling)
			{
				if (child.nodeName == 'day')
				{
					var foreObj = {error:false, errorString:null};
					
					tag = findChild(child, 'DayCode');
					if (tag != null)
						foreObj.day = trimWhiteSpace(tag.firstChild.data.toString()).substring(0, 3);

					tag = findChild(child, 'ObsDate');
					if (tag != null)
						foreObj.date = trimWhiteSpace(tag.firstChild.data.toString());

					tag = findChild(child, 'High_Temperature');
					if (tag != null)
						foreObj.tempHi = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'Low_Temperature');
					if (tag != null)
						foreObj.tempLo = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'Real_Feel_High');
					if (tag != null)
						foreObj.realFeelHi = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'Real_Feel_Low');
					if (tag != null)
						foreObj.realFeelLo = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'TXT_Short');
					if (tag != null)
						foreObj.desc = ucwords(trimWhiteSpace(tag.firstChild.data).toLowerCase());

					tag = findChild(child, 'TXT_Long');
					if (tag != null)
						foreObj.longDesc = ucwords(trimWhiteSpace(tag.firstChild.data).toLowerCase());

					tag = findChild(child, 'WindSpeed');
					if (tag != null)
						foreObj.windSpeed = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'WindDirection');
					if (tag != null)
						foreObj.windDir = trimWhiteSpace(tag.firstChild.data);

					tag = findChild(child, 'WindGust');
					if (tag != null)
						foreObj.windGust = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'Max_UV');
					if (tag != null)
						foreObj.maxUV = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'Rain_Amount');
					if (tag != null)
						foreObj.rainAmt = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'Snow_Amount');
					if (tag != null)
						foreObj.snowAmt = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'Precip_Amount');
					if (tag != null)
						foreObj.precipAmt = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'TStorm_Prob');
					if (tag != null)
						foreObj.tStormProb = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

					tag = findChild(child, 'WeatherIcon');
					if (tag != null)
					{
						foreObj.icon = parseInt(trimWhiteSpace(tag.firstChild.data), 10);
						foreObj.icon -= 1; //Accuweather starts at 1
					}
					
					obj.forecast[j++] = foreObj;
				}
			}
		}
		
		//---
		
		tag = findChild(CurrentConditions, "Temperature");
		obj.forecast[0].temp = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

		tag = findChild(CurrentConditions, "RealFeel");
		obj.forecast[0].realFeel = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

		tag = findChild(CurrentConditions, "WeatherText");
		obj.forecast[0].desc = ucwords(trimWhiteSpace(tag.firstChild.data).toLowerCase());

		tag = findChild(CurrentConditions, "Humidity");
		obj.forecast[0].humidity = trimWhiteSpace(tag.firstChild.data);

		tag = findChild(CurrentConditions, "Pressure");
		obj.forecast[0].pressure = trimWhiteSpace(tag.firstChild.data);
		obj.forecast[0].pressureDir = tag.getAttribute("state");
		
		tag = findChild(CurrentConditions, "WindSpeed");
		obj.forecast[0].windSpeed = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

		tag = findChild(CurrentConditions, "WindDirection");
		obj.forecast[0].windDir = trimWhiteSpace(tag.firstChild.data);

		tag = findChild(CurrentConditions, "Visibility");
		obj.forecast[0].visibility = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

		tag = findChild(CurrentConditions, "Precip");
		obj.forecast[0].precip = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

		tag = findChild(CurrentConditions, "UVIndex");
		obj.forecast[0].UVIndex = parseInt(trimWhiteSpace(tag.firstChild.data), 10);

		tag = findChild(CurrentConditions, "WeatherIcon");
		obj.forecast[0].icon = parseInt(trimWhiteSpace(tag.firstChild.data), 10);
		obj.forecast[0].icon -= 1; //Accuweather starts at 1
		
		//---
		
		tag = findChild(AirAndPollen, "Tree");
		obj.forecast[0].pollenTree = trimWhiteSpace(tag.firstChild.data);

		tag = findChild(AirAndPollen, "Weed");
		obj.forecast[0].pollenWeed = trimWhiteSpace(tag.firstChild.data);

		tag = findChild(AirAndPollen, "Grass");
		obj.forecast[0].pollenGrass = trimWhiteSpace(tag.firstChild.data);

		tag = findChild(AirAndPollen, "Mold");
		obj.forecast[0].pollenMold = trimWhiteSpace(tag.firstChild.data);

		tag = findChild(AirAndPollen, "AirQuality");
		obj.forecast[0].airQuality = trimWhiteSpace(tag.firstChild.data);

		//---
		
		tag = findChild(Planets, "Sun");
		if (tag != null)
		{
			var rise = tag.getAttribute("rise");
			var set = tag.getAttribute("set");

			if (rise != null && set != null)
			{
				obj.forecast[0].sunSet = parseTimeString(set);
				obj.forecast[0].sunRise = parseTimeString(rise);
			}
		}

		tag = findChild(Planets, "Moon");
		if (tag != null)
		{
			var rise = tag.getAttribute("rise");
			var set = tag.getAttribute("set");

			if (rise != null && set != null)
			{
				obj.forecast[0].moonSet = parseTimeString(set);
				obj.forecast[0].moonRise = parseTimeString(rise);
			}
		}

		//---
		
		[$DEF_name]Update(obj);
	}

END_DEFINITION

BEGIN_DEF

	DEF_name = 
	DEF_location = San Diego, CA
	DEF_postal = 92101
	DEF_interval = 300
	DEF_iconSize = 24
	DEF_iconSet = Accu1
	DEF_format = [$CITY<br>$CTF $SD00<br>$LICON00$WICON01$WICON02$WICON03$WICON04$WICON05$WICON06<br>Hi: $HTF00 Lo: $LTF00<br>Sunrise: $SR Sunset: $SS]

END_DEF

BEGIN_FORMAT_MENU
	
	BEGIN_FORMAT_ENTRY
		CODE = 1
		DESC = Weather Icon Only
		FORMAT = $ICON00
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 1
		DESC = Default
		FORMAT = $CITY<br>$CTF $SD00<br>$LICON00$WICON01$WICON02$WICON03$WICON04$WICON05$WICON06<br>Hi: $HTF00 Lo: $LTF00<br>Sunrise: $SR Sunset: $SS
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 1
		DESC = City, Description, Temp, Hi, Lo (F)
		FORMAT = $CITY: $SD00<br>Cur: $CTF Hi: $HTF00 Lo: $LTF00
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 1
		DESC = City, Description, Temp, Hi, Lo (C)
		FORMAT = $CITY: $SD00<br>Cur: $CTC Hi: $HTC00 Lo: $LTC00
	END_FORMAT_ENTRY
	
	//---
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		DESC = 7-Day Icons
		FORMAT = $WICON00$WICON01$WICON02$WICON03$WICON04$WICON05$WICON06
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		DESC = Air Quality and Pollen Counts
		FORMAT = Air: $AIR Tree: $PTREE Weed: $PWEED Grass: $PGRASS Mold: $PMOLD
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		DESC = Sunrise and Sunset
		FORMAT = Sunrise: $SR Sunset: $SS
	END_FORMAT_ENTRY
	
	//---
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		DESC = Normal Icon
		FORMAT = $WICON00
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		DESC = Large Icon
		FORMAT = $LICON00
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $SICON00
		DESC = Small Icon
	END_FORMAT_ENTRY

	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $CITY
		DESC = City
	END_FORMAT_ENTRY
		
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $WICON00
		DESC = Inline Weather Icon
	END_FORMAT_ENTRY

	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $SD00 
		DESC = Short Description
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $LD00 
		DESC = Long Description
	END_FORMAT_ENTRY

	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $DAY00 
		DESC = Weekday
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $DATE00 
		DESC = Date
	END_FORMAT_ENTRY

	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $CTF 
		DESC = Current Temperature (F)
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $HTF00 
		DESC = High Temperature (F)
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $LTF00 
		DESC = Low Temperature (F)
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $RCTF 
		DESC = Current Temperature (F) 'Feels Like'
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $RHTF00 
		DESC = High Temperature (F) 'Feels Like'
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $RLTF00 
		DESC = Low Temperature (F) 'Feels Like'
	END_FORMAT_ENTRY

	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $HUM 
		DESC = Humidity
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $PRES 
		DESC = Barometric Pressure
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $PRESDIR 
		DESC = Barometer Trend
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $PRECIP 
		DESC = Current Precipitation
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $UV 
		DESC = UV Index
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $VIS 
		DESC = Visibility
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $AIR 
		DESC = Air Quality
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $PTREE 
		DESC = Tree Pollen
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $PWEED 
		DESC = Weed Pollen
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $PGRASS 
		DESC = Grass Pollen
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $PMOLD 
		DESC = Mold Pollen
	END_FORMAT_ENTRY
		
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $WS00 
		DESC = Wind Speed
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $WD00 
		DESC = Wind Direction
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $WG00 
		DESC = Wind Gust
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $PR00 
		DESC = Precipitation
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $RAIN00 
		DESC = Rain
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $SNOW00 
		DESC = Snow
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $MAXUV00 
		DESC = Max. UV
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $TSTORM00 
		DESC = Thunderstorm Probability
	END_FORMAT_ENTRY

	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $CTC 
		DESC = Current Temperature (C)
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $HTC00 
		DESC = High Temperature (C)
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $LTC00 
		DESC = Low Temperature (C)
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $RCTC 
		DESC = Current Temperature (C) 'Feels Like'
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $RHTC00 
		DESC = High Temperature (C) 'Feels Like'
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $RLTC00 
		DESC = Low Temperature (C) 'Feels Like'
	END_FORMAT_ENTRY

	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $SR 
		DESC = Sunrise
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $SS 
		DESC = Sunset
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $MR 
		DESC = Moonrise
	END_FORMAT_ENTRY
	
	BEGIN_FORMAT_ENTRY
		CODE = 0
		FORMAT = $MS 
		DESC = Moonset
	END_FORMAT_ENTRY
	
END_FORMAT_MENU

BEGIN_STYLE

	STYLE_background = none;
	STYLE_width = 320px;
	STYLE_height = 110px;
	STYLE_padding = 0px 0px 0px 0px;
	STYLE_position_element = 0px 0px;
	STYLE_position_content = 0px 0px;
	STYLE_background-color = none;
	STYLE_transform = none;
	STYLE_reflection = none;
	STYLE_font-size = 12px;
	STYLE_text-align = center;
	STYLE_border = none;
	STYLE_color = rgba(255, 128, 128, 1);
	STYLE_text-shadow = 4px 4px 4px rgba(0, 0, 0, 0.75);
	STYLE_font-family = Helvetica;
	STYLE_font-weight = bold;
	STYLE_margin = 0px 0px 0px 0px;
	STYLE_font-style = normal;
	STYLE_word-spacing = 0px;
	STYLE_text-indent = 0px;
	STYLE_text-transform = none;
	STYLE_text-decoration = none;
	STYLE_line-height = none;
	STYLE_border-top = none;
	STYLE_border-bottom = none;
	STYLE_border-left = none;
	STYLE_border-right = none;

END_STYLE
