function valid()
{
	if((document.Form1.txtweather.value == "") || (Trim(document.Form1.txtweather.value)== ""))
	{
		
		alert("Please Enter City, State or US Zip Code");
		document.Form1.txtweather.focus();
		document.Form1.txtweather.value ="";
		return false
	}
	else
	{
		if(IsChar(document.Form1.txtweather.value) == false)
		{
			alert("Invalid City, State or US Zip Code");
			document.Form1.txtweather.focus();
			return false
		}	
		
		if(IsNumber(document.Form1.txtweather.value) == true)
		{
			var zip = document.Form1.txtweather.value;
			if (zip.length > 5)
			{
				alert("Invalid City, State or US Zip Code");
				document.Form1.txtweather.focus();
				return false
			}
		}
	}

}





function IsNumber(strString)
   //  check for valid numeric strings
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;
   
  //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
 function IsChar(strString)
   //  check for valid numeric strings
   {
   var strValidChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, -";
   var strChar;
   var blnResult = true;
   
  //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
   
   /////////////////////////
   function createRequestObject()
		{		
			var request_obj ;
			var browser = navigator.appName ;
		
			if (browser == "Microsoft Internet Explorer")
			{
				request_obj = new ActiveXObject("Microsoft.XMLHttp");
			} 
			else
			{
				request_obj = new XMLHttpRequest();
			}
			
			return request_obj
		 }
		 
		 var http2 = createRequestObject();
		 
		 function handledatabind2()
		 	{
		 		if (http2.readyState==1)
		 		{
		 			document.getElementById('divmcity').innerHTML = "<P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><TABLE id='Table3' cellSpacing='0' cellPadding='0' height='100%' width='80%' align='center' border='0'><TR><TD align='center'><img src='images/AnimatedLoading.gif'></TD></TR></TABLE><P>&nbsp;</P><P>&nbsp;</P>";
		 		}
		 		if (http2.readyState==4)
		 		{
		 			document.getElementById('divmcity').innerHTML = "";
		 			var response =  http2.responseText;
		 			document.getElementById('divmcity').innerHTML = response;
		 		}
		 	}
		 	
		  function chkkeypress()
		  {
			var txt = document.Form1.txtweather.value;
			if(txt.length >= 3)
			{
				var lval = document.Form1.txtweather.value;
				http2.open('get',"List_MultiCities.aspx?mcity=" + lval + "");
				http2.onreadystatechange = handledatabind2;
				http2.send(null);
				
			}
		 }
		 	
		 function load_txt()
			{
						
				document.Form1.txtweather.value = document.Form1.lstcities.value;
			}
		
	/////////////////////////////
	