function changeWeather(){
	var city1 =document.getElementById("weatherSelect").value;
	var city2 = city1 + '.swf';
      	setWeatherLink(city2);
      	resetCookie('weatherCookieOntario', city1);
}

function setWeatherLink(city){
	var weatherText= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="100%" height="100">';
	weatherText = weatherText + '<param name=movie value="http://www.weatheroffice.com/FlashFeed/WxLinks/' + city + '">';
	weatherText = weatherText + '<param name=quality value=high>    <embed src="http://www.weatheroffice.com/FlashFeed/WxLinks/' + city + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100%" height="100">';
      	weatherText = weatherText + '</object>';
      	var weather =document.getElementById("weatherDiv");
      	weather.innerHTML="" + weatherText + "";
}
// check to see if a cookie is set for weather, if not, then set the weather to Toronto.
function setWeatherLink2(){
	var countryCookie = getCookie("weatherCookieOntario");
	if(!countryCookie){ // if there is no cookie
		//alert("11111111111");
		var date = new Date();
		date.setTime(date.getTime()+(1200*24*60*60*1000));
		document.cookie = "weatherCookieOntario="+ 'CYYZ' + "; expires=" + date.toGMTString() +"; path=/";
		setWeatherLink('CYYZ.swf');
	}
	else {
		//alert(countryCookie);
		document.all.weatherSelect.value=countryCookie;
		setWeatherLink(countryCookie + '.swf');
	}
}

function resetCookie(name, code){
	date2 = new Date();
	date2.setTime(date2.getTime()+(1200*24*60*60*1000));
	document.cookie = name + "="+ code + "; expires=" + date2.toGMTString() +"; path=/";
}


