// JavaScript Document
//must have cookies.js attached!
function isValid5Num(field){
	var pat=/^[0-9]{5}$/;
	if(pat.test(field.value)){
		//alert("Please enter the " +field.id)
		//field.focus();
		return true;}
	else {return false;}
}
function enableWeaForm(field){
	if(isValid5Num(field)){
		document.frmWeather.chkWeaDef.disabled=false;
		document.frmWeather.btnWeather.disabled=false;
	}else{
		document.frmWeather.chkWeaDef.disabled=true;
		document.frmWeather.btnWeather.disabled=true;
	}
}
function GetNewWeather(value){
	if(document.frmWeather.chkWeaDef.checked==true){
		createCookie('defZipcode', value, expirationDate);
		deleteCookie('tempZipcode', '');
	}
	else{createCookie('tempZipcode', value, '');}
}
/////////////////////////////////// Accuweather //////////////////////////////////////////////
function addweather(zip,size,theme,_link){
var width=435, bgColor1='#FFFFCC', bgColor2='';
if(!_link){width=630;}

if(ssl){
document.write('<p class="ssl">');
document.write('The weather can only be viewed in the unencrypted mode.<br />');
document.write('Click on the button to switch.</p>');
document.write('<input type="button" value="Switch" onClick="Switch()">');
}else{
/*document.write('<form name="frmWeather" method="post" action="">');
document.write('<table width="435" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" class="tblWeather">');
document.write('<tr><td class="wbrd1"><div align="center" class="divtblWeather">');
document.write('<label id="lblWeaZip" class="lblWeaZip">Enter Zip Code:</label>');
document.write('<input class="inputWea" name="txtZip" type="text" size="7" maxlength="5" onKeyUp="enableWeaForm(this);" onBlur="enableWeaForm(this);" />');
document.write('<input name="btnWeather" type="submit" value="Get Weather" disabled onClick="GetNewWeather(this.form.txtZip.value);" />');
document.write('<input name="chkWeaDef" type="checkbox" value="" disabled />');
document.write('<label id="lblWeaDef" class="remember">Remember</label>');
document.write('&nbsp;&nbsp;<a href="http://zip4.usps.com/zip4/citytown.jsp" target="_blank" class="aWeaZip">Find a Zip Code</a>');
document.write('</div></td></tr><tr><td>');
document.write('<table width="435" border="0" cellspacing="0" cellpadding="0" onMouseOver="this.bgColor=\''+bgColor1+'\'" onMouseOut="this.bgColor=\''+bgColor2+'\';">');
document.write('<tr><td class="wbrd2"><div align="center"><a class="aWeaTools" href="tools.htm">Click here for the Current Radar, US Temperature Maps, and 5-Day Forecast</a></div></td>');
document.write('</tr><tr><td style="background-color:#FFFFFF;">');*/
document.write('<script src="http://netwx.accuweather.com/netweatherV2.asp?zipcode='+zip+'&lang=eng&size='+size+'&theme='+theme+'&metric=0"></script>');
//ocument.write('</td></tr></table></td></tr></table></form>');
	
	
	
	
	
	
	
	
	
	
	
	
/*document.write('<div id="divWeather" class="divWeather">');
document.write('<form name="frmWeather" method="post" action="">');
document.write('<table width="'+width+'" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" class="tblWeather">');
document.write('<tr><td class="wbrd1"><div align="center" class="divtblWeather">');
document.write('<label id="lblWeaZip" class="lblWeaZip">Enter Zip Code:</label>');
document.write('<input class="inputWea" name="txtZip" type="text" size="7" maxlength="5" onKeyUp="enableWeaForm(this);" onBlur="enableWeaForm(this);" />');
document.write('<input name="btnWeather" type="submit" value="Get Weather" disabled onClick="GetNewWeather(this.form.txtZip.value);" />');
document.write('<input name="chkWeaDef" type="checkbox" value="" disabled />');
document.write('<label id="lblWeaDef" class="remember">Remember</label>');
document.write('&nbsp;&nbsp;<a href="http://zip4.usps.com/zip4/citytown.jsp" target="_blank" class="aWeaZip">Find a Zip Code</a>');
document.write('</div></td></tr><tr><td>');
document.write('<table width="'+width+'" border="0" cellspacing="0" cellpadding="0" onMouseOver="this.bgColor=\''+bgColor1+'\';" onMouseOut="this.bgColor=\''+bgColor2+'\';">');
document.write('<tr><td class="wbrd2"><div align="center">');
document.write('<a class="aWeaTools" href="tools.htm">Click here for the Current Radar, US Temperature Maps, and 5-Day Forecast</a>');
if(_link){document.write('<a class="aWeaTools" href="tools.htm">Click here for the Current Radar, US Temperature Maps, and 5-Day Forecast</a>');}
else{
document.write('<div class="divtblWeather"><a class="aWeaTools" href="http://wwwa.accuweather.com/adcbin/public/index.asp?partner=netWeather">Weather Forecasts</a>');
document.write('<span class="aSpacer"> | </span>');
document.write('<a class="aWeaTools" href="http://wwwa.accuweather.com/maps-satellite.asp?partner=netWeather">Weather Maps</a>');
document.write('<span class="aSpacer"> | </span>');
document.write('<a class="aWeaTools" href="http://wwwa.accuweather.com/index-radar.asp?partner=netWeather">Weather Radar</a></div>');
}
document.write('</div></td></tr><tr><td style="background-color:#FFFFFF;">');
document.write('<script src="http://netwx.accuweather.com/netweatherV2.asp?zipcode='+zip+'&lang=eng&size='+size+'&theme='+theme+'&metric=0"></script>');
document.write('</td></tr></table></td></tr></table></form>');
document.write('</div>');*/
}}