function select_state_extended()
{
	if(document.zonechoice.state)
	{
			indx = document.zonechoice.state.selectedIndex;
			if(indx == 0)
			{
				alert('Please select a state.');
			}
			else
			{
				if(document.zonechoice.zip)
				{
					document.zonechoice.zip.value='';
				}
				if(document.zonechoice.zone)
				{
					document.zonechoice.zone.selectedIndex = 0;
				}
				document.zonechoice.submit();
			}
	}
}		

function select_zone_extended()
{
	if(document.zonechoice.zone)
	{
			indx = document.zonechoice.zone.selectedIndex;
			if(indx == 0)
			{
				alert('Please select a region.');
			}
			else
			{
				if(document.zonechoice.zip)
				{
					document.zonechoice.zip.value='';
				}
				document.zonechoice.submit();
			}
	}
}

function select_zip_extended()
{
	var error = 0;
	if(document.zonechoice.zip)
	{
		zip_val = document.zonechoice.zip.value;
		zips_val = '';

		if(document.zonechoice.zips)
		{
			zips_val = document.zonechoice.zips.value;
		}
	
		if( zip_val.match(/[^0-9]/) )
		{
			error = 1;
		}
		if( zip_val.match(/[^a-zA-Z]/) )
		{
		
			if(error == 0)
			{	
				if(document.zonechoice.zip.value == '' || document.zonechoice.zip.value.length > 7)
				{
					alert("Please provide 7 digit zipcode.");
					return;
				}
			}
			if( error )
			{
				alert("Pleaser provide a valid zipcode or city name.");
			}
			else
			{
				document.zonechoice.submit();
			}
		}
		else 
		{
				document.zonechoice.submit();
		}
	}
}

function viewRadar(url)
{
	ret = window.open(url,"radar", "toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=700,height=700");
	ret.focus();
}

function viewPage(url)
{
	ret = window.open(url,"new", "toolbar=no,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=700,height=700");
	ret.focus();
}
