d 					= document;

WeatherShowHide		= 0;
WeatherPixelOffset	= 4; 	// pixels to be shown at once
WeatherInterval		= 15;	// smoothness of the animation

WeatherDisplay		= new Array();
WeatherDisplay[0]	= 'none';
WeatherDisplay[1]	= 'block';

/////////////////////////////////////////////////////////////////////////////////////
//	SHOW THE WEATHER STATION WHEN THE SCREEN-WIDTH IS BIG ENOUGH
/////////////////////////////////////////////////////////////////////////////////////

function WeatherStation()
	{
// retry showing the weather-station when page is not loaded at this moment
if(d.getElementById('WeatherContainer') == null){setTimeout("WeatherStation()",5);}
// show | hide weather-station when clients-screen is too small
else{if(d.body.clientWidth >= WeatherScreenMinWidth)d.getElementById('WeatherContainer').style.display = 'block';}
	}

/////////////////////////////////////////////////////////////////////////////////////
//	SHOW | HIDE THE EXTENDED WEATHER INFO
/////////////////////////////////////////////////////////////////////////////////////
 
function ShowWeather(WeatherTextHeight)
	{
// alert ('data to be revealed : '+WeatherTextHeight+' px');
	if(WeatherShowHide == 0)
		{
	WeatherShowHide = 1;
	d.getElementById('WeatherText').style.display = WeatherDisplay[1];
		if(WeatherAnimated)FadeXtraTxt('FadeIn',WeatherTextHeight);
		else{d.getElementById('WeatherText').style.height = WeatherTextHeight+'px';}
//	alert('fade in');
		}

	else
		{
	WeatherShowHide = 0;
		if(WeatherAnimated)FadeXtraTxt('FadeOut',WeatherTextHeight);
		else{d.getElementById('WeatherText').style.height = '1px';d.getElementById('WeatherText').style.display = WeatherDisplay[0];}
//	alert('fade out');
		}
	}
	
function FadeXtraTxt(FadeInOut,WeatherTextHeight)
	{

	if(FadeInOut == 'FadeIn')
		{
	WeatherHeightTmp1 = 1*d.getElementById('WeatherText').style.height.substring(0,d.getElementById('WeatherText').style.height.indexOf('p'));
	WeatherHeightTmp2 = WeatherHeightTmp1+WeatherPixelOffset;
	d.getElementById('WeatherText').style.height = WeatherHeightTmp2+'px';
	WeatherTextHeight2 = WeatherTextHeight;
	if(WeatherHeightTmp2 < WeatherTextHeight)setTimeout("FadeXtraTxt('FadeIn',WeatherTextHeight2)",WeatherInterval);
		}

	if(FadeInOut == 'FadeOut')
		{
	WeatherHeightTmp1 = 1*d.getElementById('WeatherText').style.height.substring(0,d.getElementById('WeatherText').style.height.indexOf('p'));
	WeatherHeightTmp2 = WeatherHeightTmp1-WeatherPixelOffset;
	d.getElementById('WeatherText').style.height = WeatherHeightTmp2+'px';
	WeatherTextHeight2 = WeatherTextHeight;
	if(WeatherHeightTmp2 > 0)setTimeout("FadeXtraTxt('FadeOut',WeatherTextHeight2)",WeatherInterval);
	else{d.getElementById('WeatherText').style.display = WeatherDisplay[0];}
		}

	}