<?xml version="1.0" encoding="UTF-8"?>
<includes>

	<include name="weather-details-zoom">

		<!-- zoom Dialog background -->
		<control type="image">
			<visible>Skin.HasSetting(Weather.Zoom.Detailed) + !String.IsEmpty(Window(weather).Property(Detailed.IsFetched))</visible>
			<include>FullscreenDimensions</include>
			<texture border="5">overlays/diffuse-overlay.png</texture>
		</control>

		<control type="group">
			<width>1400</width>
			<height>800</height>
			<top>140</top>
			<left>260</left>

			<visible>Skin.HasSetting(Weather.Zoom.Detailed) + !String.IsEmpty(Window(weather).Property(Detailed.IsFetched))</visible>
			<include content="ItemFocusBorder">
				<param name="bottom" value="20" />
			</include>
			<control type="multiimage">
				<description>current weather icon</description>
				<left>40</left>
				<top>80</top>
				<width>220</width>
				<height>220</height>
				<imagepath>$INFO[ListItem.Icon]</imagepath>
				<timeperimage>70</timeperimage>
				<fadetime>1</fadetime>
				<randomize>false</randomize>
				<aspectratio align="center" aligny="center">keep</aspectratio>
			</control>

			<control type="label">
				<left>40</left>
				<right>20</right>
				<top>20</top>
				<width>1060</width>
				<height>50</height>
				<font>font16</font>
				<textcolor>NormalTextColor</textcolor>
				<label>$INFO[ListItem.Label]</label>
			</control>

			<control type="label">
				<right>60</right>
				<top>40</top>
				<height>50</height>
				<font>font36</font>
				<align>right</align>
				<label>$INFO[ListItem.Property(HighTemperature),[COLOR=HighTemp],[/COLOR]]$INFO[ListItem.Property(LowTemperature), [COLOR=LowTemp],[/COLOR]]</label>
			</control>

			<control type="label">
				<width>1060</width>
				<left>320</left>
				<top>75</top>
				<height>40</height>
				<font>font16</font>
				<textcolor>TitleTextColor</textcolor>
				<label>$INFO[ListItem.Label2]</label>
			</control>


			<control type="label">
				<width>1060</width>
				<left>320</left>
				<top>130</top>
				<height>30</height>
				<font>font15</font>
				<textcolor>AltTextColor</textcolor>
				<label>$LOCALIZE[383]: $INFO[ListItem.Property(WindDirection)] $INFO[ListItem.Property(WindSpeed)]</label>
			</control>

			<control type="textbox">
				<width>1050</width>
				<left>320</left>
				<top>175</top>
				<height>600</height>
				<autoscroll delay="8000" time="8000" repeat="20000">true</autoscroll>
				<label>$INFO[ListItem.Property(DetailedOutlook)]</label>
			</control>
		</control>
	</include>

	<include name="weather-alert-zoom">

		<!-- zoom Dialog background -->
		<control type="image">
			<visible>Skin.HasSetting(Weather.Zoom.Alert)</visible>
			<include>FullscreenDimensions</include>
			<texture border="5">overlays/diffuse-overlay.png</texture>
		</control>

		<control type="group">
			<width>1400</width>
			<height>1000</height>
			<top>40</top>
			<left>260</left>

			<visible>Skin.HasSetting(Weather.Zoom.Alert)</visible>
			<include content="ItemFocusBorder">
				<param name="bottom" value="20" />
			</include>

			<control type="label">
				<left>40</left>
				<top>20</top>
				<width>1360</width>
				<height>50</height>
				<font>font16</font>
				<label>[COLOR=Alert]$INFO[ListItem.Label][/COLOR]</label>
			</control>
			<control type="textbox">
				<left>40</left>
				<top>120</top>
				<width>1360</width>
				<height>860</height>
				<font>font15</font>
				<autoscroll delay="8000" time="8000" repeat="20000">true</autoscroll>
				<label>$INFO[ListItem.Property(description)]</label>
			</control>
		</control>
	</include>

	<include name="weather-alert-item">
		<param name="index" />
		<definition>
			<item>
				<label>$INFO[Window(weather).Property(Alerts.$PARAM[index].event)]</label>
				<label2>$INFO[Window(weather).Property(Alerts.$PARAM[index].headline)]</label2>
				<property name="description">$INFO[Window(weather).Property(Alerts.$PARAM[index].description)]</property>
				<property name="instruction">$INFO[Window(weather).Property(Alerts.$PARAM[index].instruction)]</property>
				<visible>!String.IsEmpty(Window(weather).Property(Alerts.$PARAM[index].event))</visible>
			</item>
		</definition>
	</include>


	<include name="weather-daily-item">
		<param name="index" />
		<definition>
			<item>
				<label>$INFO[Window(weather).Property(Daily.$PARAM[index].LongDay)] ($INFO[Window(weather).Property(Daily.$PARAM[index].ShortDate)])</label>
				<label2>$INFO[Window(weather).Property(Daily.$PARAM[index].Outlook)]</label2>
				<icon>$INFO[Window(weather).Property(Daily.$PARAM[index].RemoteIcon)]</icon>
				<property name="DetailedOutlook">$INFO[Window(weather).Property(Daily.$PARAM[index].DetailedOutlook)]</property>
				<property name="HighTemperature">$INFO[Window(weather).Property(Daily.$PARAM[index].HighTemperature)]</property>
				<property name="LowTemperature">$INFO[Window(weather).Property(Daily.$PARAM[index].LowTemperature)]</property>
				<property name="Precipitation">$INFO[Window(weather).Property(Daily.$PARAM[index].Precipitation)]</property>
				<property name="ChancePrecipitation">$INFO[Window(weather).Property(Daily.$PARAM[index].ChancePrecipitation)]</property>
				<property name="WindSpeed">$INFO[Window(weather).Property(Daily.$PARAM[index].WindSpeed)]</property>
				<property name="WindDirection">$INFO[Window(weather).Property(Daily.$PARAM[index].WindDirection)]</property>
				<property name="Dewpoint">$INFO[Window(weather).Property(Daily.$PARAM[index].Dewpoint)]</property>
				<property name="Humidity">$INFO[Window(weather).Property(Daily.$PARAM[index].Humidity)]</property>
				<visible>Skin.HasSetting(Enable.RemoteWeatherIcons) + !String.IsEmpty(Window(weather).Property(Daily.$PARAM[index].LongDay))</visible>
			</item>
			<item>
				<label>$INFO[Window(weather).Property(Daily.$PARAM[index].LongDay)] $INFO[Window(weather).Property(Daily.$PARAM[index].ShortDate)]</label>
				<label2>$INFO[Window(weather).Property(Daily.$PARAM[index].Outlook)]</label2>
				<icon>$VAR[WeatherIconVar]$INFO[Window(weather).Property(Daily.$PARAM[index].FanartCode)]$VAR[WeatherIconExtVar]</icon>
				<property name="DetailedOutlook">$INFO[Window(weather).Property(Daily.$PARAM[index].DetailedOutlook)]</property>
				<property name="HighTemperature">$INFO[Window(weather).Property(Daily.$PARAM[index].HighTemperature)]</property>
				<property name="LowTemperature">$INFO[Window(weather).Property(Daily.$PARAM[index].LowTemperature)]</property>
				<property name="Precipitation">$INFO[Window(weather).Property(Daily.$PARAM[index].Precipitation)]</property>
				<property name="ChancePrecipitation">$INFO[Window(weather).Property(Daily.$PARAM[index].ChancePrecipitation)]</property>
				<property name="WindSpeed">$INFO[Window(weather).Property(Daily.$PARAM[index].WindSpeed)]</property>
				<property name="WindDirection">$INFO[Window(weather).Property(Daily.$PARAM[index].WindDirection)]</property>
				<property name="Dewpoint">$INFO[Window(weather).Property(Daily.$PARAM[index].Dewpoint)]</property>
				<property name="Humidity">$INFO[Window(weather).Property(Daily.$PARAM[index].Humidity)]</property>
				<visible>!Skin.HasSetting(Enable.RemoteWeatherIcons) + !String.IsEmpty(Window(weather).Property(Daily.$PARAM[index].LongDay))</visible>
			</item>
		</definition>
	</include>

	<include name="weather-day-item">
		<param name="index" />
		<definition>
			<item>
				<label>$INFO[Window(weather).Property(Day$PARAM[index].Title)]</label>
				<label2>$INFO[Window(weather).Property(Day$PARAM[index].Outlook)]</label2>
				<icon>$INFO[Window(weather).Property(Day$PARAM[index].RemoteIcon)]</icon>
				<property name="HighTemperature">$INFO[Window(weather).Property(Day$PARAM[index].HighTemp)]</property>
				<property name="LowTemperature">$INFO[Window(weather).Property(Day$PARAM[index].LowTemp)]</property>
				<property name="Precipitation">$INFO[Window(weather).Property(Day$PARAM[index].Precipitation)]</property>
				<property name="WindSpeed">$INFO[Window(weather).Property(Day$PARAM[index].WindSpeed)]</property>
				<property name="WindDirection">$INFO[Window(weather).Property(Day$PARAM[index].WindDirection)]</property>
				<visible>Skin.HasSetting(Enable.RemoteWeatherIcons) + !String.IsEmpty(Window(weather).Property(Day$PARAM[index].Title))</visible>
			</item>
			<item>
				<label>$INFO[Window(weather).Property(Day$PARAM[index].Title)]</label>
				<label2>$INFO[Window(weather).Property(Day$PARAM[index].Outlook)]</label2>
				<icon>$VAR[WeatherIconVar]$INFO[Window(weather).Property(Day$PARAM[index].FanartCode)]$VAR[WeatherIconExtVar]</icon>
				<property name="HighTemperature">$INFO[Window(weather).Property(Day$PARAM[index].HighTemp)]</property>
				<property name="LowTemperature">$INFO[Window(weather).Property(Day$PARAM[index].LowTemp)]</property>
				<property name="Precipitation">$INFO[Window(weather).Property(Day$PARAM[index].Precipitation)]</property>
				<property name="WindSpeed">$INFO[Window(weather).Property(Day$PARAM[index].WindSpeed)]</property>
				<property name="WindDirection">$INFO[Window(weather).Property(Day$PARAM[index].WindDirection)]</property>
				<visible>!Skin.HasSetting(Enable.RemoteWeatherIcons) + !String.IsEmpty(Window(weather).Property(Day$PARAM[index].Title))</visible>
			</item>
		</definition>
	</include>

	<include name="weather-hour-item">
		<param name="index" />
		<definition>
			<item>
				<label>$INFO[Window(weather).Property(Hourly.$PARAM[index].Time)]</label>
				<icon>$INFO[Window(weather).Property(Hourly.$PARAM[index].RemoteIcon)]</icon>
				<property name="ShortDate">$INFO[Window(weather).Property(Hourly.$PARAM[index].ShortDate)]</property>
				<property name="Temperature">$INFO[Window(weather).Property(Hourly.$PARAM[index].Temperature)]</property>
				<property name="Precipitation">$INFO[Window(weather).Property(Hourly.$PARAM[index].Precipitation)]</property>
				<property name="ChancePrecipitation">$INFO[Window(weather).Property(Hourly.$PARAM[index].ChancePrecipitation)]</property>
				<property name="WindSpeed">$INFO[Window(weather).Property(Hourly.$PARAM[index].WindSpeed)]</property>
				<property name="WindDirection">$INFO[Window(weather).Property(Hourly.$PARAM[index].WindDirection)]</property>
				<property name="Humidity">$INFO[Window(weather).Property(Hourly.$PARAM[index].Humidity)]</property>
				<property name="Dewpoint">$INFO[Window(weather).Property(Hourly.$PARAM[index].DewPoint)]</property>
				<property name="UVIndex">$INFO[Window(weather).Property(Hourly.$PARAM[index].UVIndex)]</property>
				<property name="Snow">$INFO[Window(weather).Property(Hourly.$PARAM[index].Snow)]</property>
				<property name="HeatIndex">$INFO[Window(weather).Property(Hourly.$PARAM[index].HeatIndex)]</property>
				<property name="WindChill">$INFO[Window(weather).Property(Hourly.$PARAM[index].WindChill)]</property>
				<property name="FeelsLike">$INFO[Window(weather).Property(Hourly.$PARAM[index].FeelsLike)]</property>
				<label2>$INFO[Window(weather).Property(Hourly.$PARAM[index].Outlook)]</label2>
				<visible>Skin.HasSetting(Enable.RemoteWeatherIcons) + !String.IsEmpty(Window(weather).Property(Hourly.$PARAM[index].Temperature))</visible>
			</item>
			<item>
				<label>$INFO[Window(weather).Property(Hourly.$PARAM[index].Time)]</label>
				<icon>$VAR[WeatherIconVar]$INFO[Window(weather).Property(Hourly.$PARAM[index].FanartCode)]$VAR[WeatherIconExtVar]</icon>
				<property name="ShortDate">$INFO[Window(weather).Property(Hourly.$PARAM[index].ShortDate)]</property>
				<property name="Temperature">$INFO[Window(weather).Property(Hourly.$PARAM[index].Temperature)]</property>
				<property name="Precipitation">$INFO[Window(weather).Property(Hourly.$PARAM[index].Precipitation)]</property>
				<property name="ChancePrecipitation">$INFO[Window(weather).Property(Hourly.$PARAM[index].ChancePrecipitation)]</property>
				<property name="WindSpeed">$INFO[Window(weather).Property(Hourly.$PARAM[index].WindSpeed)]</property>
				<property name="WindDirection">$INFO[Window(weather).Property(Hourly.$PARAM[index].WindDirection)]</property>
				<property name="Humidity">$INFO[Window(weather).Property(Hourly.$PARAM[index].Humidity)]</property>
				<property name="Dewpoint">$INFO[Window(weather).Property(Hourly.$PARAM[index].DewPoint)]</property>
				<property name="UVIndex">$INFO[Window(weather).Property(Hourly.$PARAM[index].UVIndex)]</property>
				<property name="Snow">$INFO[Window(weather).Property(Hourly.$PARAM[index].Snow)]</property>
				<property name="HeatIndex">$INFO[Window(weather).Property(Hourly.$PARAM[index].HeatIndex)]</property>
				<property name="WindChill">$INFO[Window(weather).Property(Hourly.$PARAM[index].WindChill)]</property>
				<property name="FeelsLike">$INFO[Window(weather).Property(Hourly.$PARAM[index].FeelsLike)]</property>
				<label2>$INFO[Window(weather).Property(Hourly.$PARAM[index].Outlook)]</label2>
				<visible>!Skin.HasSetting(Enable.RemoteWeatherIcons) + !String.IsEmpty(Window(weather).Property(Hourly.$PARAM[index].Temperature))</visible>
			</item>
		</definition>
	</include>

	<include name="WeatherWidgetContents">
		<visible>String.IsEqual(Container(9000).ListItem.Property(widget),weather) + !IsEmpty(Weather.Plugin)</visible>
		<top>390</top>
		<left>$PARAM[left]</left>
		<width>$PARAM[width]</width>
		<height>390</height>
		<onleft>9000</onleft>
		<onright>$PARAM[id]</onright>
		<onback>9000</onback>
		<onup>9000</onup>
		<ondown>9000</ondown>
		<!-- <onclick>ActivateWindow(weather)</onclick> -->
		<onclick>Skin.ToggleSetting(Weather.Zoom.Detailed)</onclick>
		<onfocus>Skin.Reset(Weather.Zoom.Detailed)</onfocus>
		<onunfocus>Skin.Reset(Weather.Zoom.Detailed)</onunfocus>
		<preloaditems>2</preloaditems>
		<viewtype label="21371">list</viewtype>
		<!-- <scrolltime tween="quadratic" easing="out">300</scrolltime> -->
		<orientation>horizontal</orientation>

		<itemlayout height="390" width="350">
			<include content="ItemBorder">
			</include>
			<control type="label">
				<left>20</left>
				<right>20</right>
				<top>327</top>
				<height>50</height>
				<label>$INFO[ListItem.Label]</label>
			</control>
			<control type="multiimage">
				<left>75</left>
				<top>72</top>
				<width>180</width>
				<height>180</height>
				<aspectratio scalediffuse="false" align="center" aligny="center">keep</aspectratio>
				<imagepath>$INFO[ListItem.Icon]</imagepath>
				<timeperimage>70</timeperimage>
				<fadetime>1</fadetime>
				<randomize>false</randomize>
			</control>
			<control type="label">
				<top>20</top>
				<left>20</left>
				<width>310</width>
				<height>60</height>
				<font>font15</font>
				<align>center</align>
				<selectedcolor>SelectedColor</selectedcolor>
				<label>$INFO[ListItem.Label2]</label>
			</control>
			<control type="label">
				<top>250</top>
				<left>20</left>
				<width>310</width>
				<height>60</height>
				<font>font15</font>
				<align>center</align>
				<selectedcolor>SelectedColor</selectedcolor>
				<label>$INFO[ListItem.Property(HighTemperature),[COLOR=HighTemp],[/COLOR]]$INFO[ListItem.Property(LowTemperature), [COLOR=LowTemp],[/COLOR]]</label>
			</control>
			<control type="image">
				<top>20</top>
				<left>20</left>
				<right>20</right>
				<height>310</height>
				<texture border="5">overlays/diffuse-overlay.png</texture>
				<visible>Skin.HasSetting(Enable.HighlightFocused)</visible>
			</control>
		</itemlayout>

		<focusedlayout height="390" width="350">
			<control type="button" id="3060">
				<visible>false</visible>
				<description>Dummy object to catch focus so we can clear property</description>
				<onfocus>Skin.Reset(Weather.Zoom.Detailed)</onfocus>
				<onunfocus>Skin.Reset(Weather.Zoom.Detailed)</onunfocus>
			</control>
			<include content="ItemFocusBorder">
			</include>

			<control type="label">
				<left>20</left>
				<right>20</right>
				<top>327</top>
				<height>50</height>
				<label>$INFO[ListItem.Label]</label>
			</control>
			<control type="multiimage">
				<left>75</left>
				<top>72</top>
				<width>180</width>
				<height>180</height>
				<aspectratio scalediffuse="false" align="center" aligny="center">keep</aspectratio>
				<imagepath>$INFO[ListItem.Icon]</imagepath>
				<timeperimage>70</timeperimage>
				<fadetime>1</fadetime>
				<randomize>false</randomize>
			</control>
			<control type="label">
				<top>20</top>
				<left>20</left>
				<width>310</width>
				<height>60</height>
				<font>font15</font>
				<align>center</align>
				<label>$INFO[ListItem.Label2]</label>
			</control>
			<control type="label">
				<top>250</top>
				<left>20</left>
				<width>310</width>
				<height>60</height>
				<font>font15</font>
				<align>center</align>
				<label>$INFO[ListItem.Property(HighTemperature),[COLOR=HighTemp],[/COLOR]]$INFO[ListItem.Property(LowTemperature), [COLOR=LowTemp],[/COLOR]]</label>
			</control>
		</focusedlayout>
		<content>
			<!-- try to get Daily info, but if that is not available, fetch Day info as a backup -->

			<include content="weather-daily-item" condition="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="1" />
			</include>
			<include content="weather-daily-item" condition="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="2" />
			</include>
			<include content="weather-daily-item" condition="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="3" />
			</include>
			<include content="weather-daily-item" condition="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="4" />
			</include>
			<include content="weather-daily-item" condition="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="5" />
			</include>
			<include content="weather-daily-item" condition="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="6" />
			</include>
			<include content="weather-daily-item" condition="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="7" />
			</include>
			<include content="weather-daily-item" condition="!String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="8" />
			</include>


			<include content="weather-day-item" condition="String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="0" />
			</include>
			<include content="weather-day-item" condition="String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="1" />
			</include>
			<include content="weather-day-item" condition="String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="2" />
			</include>
			<include content="weather-day-item" condition="String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="3" />
			</include>
			<include content="weather-day-item" condition="String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="4" />
			</include>
			<include content="weather-day-item" condition="String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="5" />
			</include>
			<include content="weather-day-item" condition="String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="6" />
			</include>
			<include content="weather-day-item" condition="String.IsEmpty(Window(weather).Property(Daily.IsFetched))">
				<param name="index" value="7" />
			</include>
		</content>
	</include>



</includes>


