var fcstString;var postal;var iconArray = new Array();iconArray['395'] = 'Snow.gif'iconArray['392'] = 'LightSnow.gif'iconArray['389'] = 'Lightning.gif'iconArray['386'] = 'Lightning.gif'iconArray['377'] = 'FreezeRain.gif'iconArray['374'] = 'FreezeRain.gif'iconArray['371'] = 'Snow.gif'iconArray['368'] = 'LightSnow.gif'iconArray['365'] = 'RainSnow.gif'iconArray['362'] = 'RainSnow.gif'iconArray['359'] = 'Rain.gif'iconArray['356'] = 'Rain.gif'iconArray['353'] = 'LightRain.gif'iconArray['350'] = 'FreezeRain.gif'iconArray['338'] = 'Snow.gif'iconArray['335'] = 'Snow.gif'iconArray['332'] = 'Snow.gif'iconArray['329'] = 'Snow.gif'iconArray['326'] = 'LightSnow.gif'iconArray['323'] = 'LightSnow.gif'iconArray['320'] = 'FreezeRain.gif'iconArray['317'] = 'FreezeRain.gif'iconArray['314'] = 'FreezeRain.gif'iconArray['311'] = 'FreezeRain.gif'iconArray['308'] = 'Rain.gif'iconArray['305'] = 'Rain.gif'iconArray['302'] = 'Rain.gif'iconArray['299'] = 'LightRain.gif'iconArray['296'] = 'LightRain.gif'iconArray['293'] = 'LightRain.gif'iconArray['284'] = 'FreezeRain.gif'iconArray['281'] = 'FreezeRain.gif'iconArray['266'] = 'LightRain.gif'iconArray['263'] = 'LightRain.gif'iconArray['260'] = 'Fog.gif'iconArray['248'] = 'Fog.gif'iconArray['230'] = 'Snow.gif'iconArray['227'] = 'Snow.gif'iconArray['200'] = 'Lightning.gif'iconArray['185'] = 'FreezeRain.gif'iconArray['182'] = 'RainSnow.gif'iconArray['179'] = 'LightSnow.gif'iconArray['176'] = 'LightRain.gif'iconArray['143'] = 'LightRain.gif'iconArray['122'] = 'Cloudy.gif'iconArray['119'] = 'Cloudy.gif'iconArray['116'] = 'PartCloud.gif'iconArray['113'] = 'Sunny.gif' function signIn(redirect){	var tForm=document.getElementById('signUp');	var uname = document.getElementById('username');	uname = uname.value;	var pwd = document.getElementById('password');	pwd = pwd.value;		location.href='/basf/agprocan/WebSecureAuth.nsf?Login&username=' + uname + '&password=' + pwd + '&redirectTo=/basf/agprocan/WebSecureAuth.nsf/SecureLoginRedirect?OpenNavigator%26section=' + redirect + '&';}  function getWeather()  {	reg = /\s/;	postal=postal.replace(reg,'');    var vurl='/basf/agprocan/agsolutions/ASMain.nsf/WebAJAXWeatherNew?OpenNavigator&PC=' + postal; 	doHTTPGet(vurl,'getWeatherData(retText)');  }  function getWeatherData(html){      if(html.indexOf("error") == -1)   {   var jsonDataObject = eval('(' + html+ ')');       var temp;       var windStr;       html = '<img src="/basf/agprocan/agsolutions/ASMain.nsf/' + iconArray[jsonDataObject.data.current_condition[0].weatherCode] + '" style="display: block; margin: 0 auto;" />';        if(isNaN(postal)) //If it's not the US (they only provide data for USA, Canada, and UK)        {   temp = "C"        	  fcstString = "TP=Met"        	  windStr = jsonDataObject.data.current_condition[0].windspeedKmph + ' km/h';        }        else        {    temp = "F"        	   fcstString = "TP=Imp"        	   windStr = jsonDataObject.data.current_condition[0].windspeedMiles + ' m/h';        }        html = html + "Current: " + eval("jsonDataObject.data.current_condition[0].temp_" + temp) + '\u00BA' + temp +', ';        html = html + jsonDataObject.data.current_condition[0].weatherDesc[0].value + '<br/>';        html = html + "High: " + eval("jsonDataObject.data.weather[0].tempMax" + temp) + '\u00BA' + temp +'<span style="margin-right: 1em">&nbsp;</span>' ;        html = html + "Low: " + eval("jsonDataObject.data.weather[0].tempMin" + temp) + '\u00BA' + temp + '<br/>' ;        html = html + "Wind: " + jsonDataObject.data.current_condition[0].winddir16Point + windStr;                fcstString = fcstString + "&Max1=" + eval("jsonDataObject.data.weather[1].tempMax" + temp)         fcstString = fcstString + "&Min1=" + eval("jsonDataObject.data.weather[1].tempMin" + temp)         fcstString = fcstString + "&Max2=" + eval("jsonDataObject.data.weather[2].tempMax" + temp)         fcstString = fcstString + "&Min2=" + eval("jsonDataObject.data.weather[2].tempMin" + temp)        fcstString = fcstString + "&Max3=" + eval("jsonDataObject.data.weather[3].tempMax" + temp)         fcstString = fcstString + "&Min3=" + eval("jsonDataObject.data.weather[3].tempMin" + temp)                //Sometimes the 4th day isn't provided for some reason and then a few minutes later for the very same zip it is        if(jsonDataObject.data.weather.length > 4)        {	fcstString = fcstString + "&Max4=" + eval("jsonDataObject.data.weather[4].tempMax" + temp)         	fcstString = fcstString + "&Min4=" + eval("jsonDataObject.data.weather[4].tempMin" + temp)        	fcstString = fcstString + "&WC4=" +  iconArray[jsonDataObject.data.weather[4].weatherCode];        }       fcstString = fcstString + "&WC1=" +  iconArray[jsonDataObject.data.weather[1].weatherCode];       fcstString = fcstString + "&WC2=" +  iconArray[jsonDataObject.data.weather[2].weatherCode];       fcstString = fcstString + "&WC3=" +  iconArray[jsonDataObject.data.weather[3].weatherCode];       fcstString = fcstString + "&PC=" +  postal   }   else   {   html = "<br/><br/>Please enter a postal code.<br/><br/><br/>"   }   var weatherData= document.getElementById("weatherData");   weatherData.innerHTML = html;}	function setNewZip(){	newZip = document.getElementById("NewZip");	postal = newZip.value;	reg = /\s/;		if (postal == "")	{	alert("Please enter a new postal code");		return;	}	// Set the cookie.	var expirydate = new Date();	expirydate.setFullYear(expirydate.getFullYear() + 1, 1, 1);	document.cookie = "PCode=" + postal.replace(reg,'') + "; expires=" + expirydate.toGMTString();	getWeather();	}function longTermFor(lang)   {     showPopFrame('popUpDef', 430, 230, '/basf/agprocan/agsolutions/asmain.nsf/LTForecast?OpenNavigator&'+fcstString);  } 
