
	var xmlhttp_obj;
	
	function weather_handleInfo()
	{
		if(xmlhttp_obj.readyState == 1)
		{
			var _tmp = document.getElementById('weatherdiv');
			_tmp.innerHTML = '<table width="50%" border="0"><tr><td colspan="2"> جاري التحميل </td></tr><tr><td></td><td></td></tr><tr><td colspan="2"><img src="./prayer_times_files/loading.gif" border="0"></td></tr><tr><td></td><td></td></tr></table>';
		}
		else if(xmlhttp_obj.readyState == 2)
		{
			var _tmp = document.getElementById('weatherdiv');
			_tmp.innerHTML = '<table width="50%" border="0"><tr><td colspan="2"> جاري التحميل </td></tr><tr><td></td><td></td></tr><tr><td colspan="2"><img src="./prayer_times_files/loading.gif" border="0"></td></tr><tr><td></td><td></td></tr></table>';
		}
		else if(xmlhttp_obj.readyState == 3)
		{
			var _tmp = document.getElementById('weatherdiv');
			_tmp.innerHTML = '<table width="50%" border="0"><tr><td colspan="2"> جاري التحميل </td></tr><tr><td></td><td></td></tr><tr><td colspan="2"><img src="./prayer_times_files/loading.gif" border="0"></td></tr><tr><td></td><td></td></tr></table>';
		}
		if(xmlhttp_obj.readyState == 4)
		{
			if(xmlhttp_obj.status == 200 ){
				var response = xmlhttp_obj.responseText;
				var _tmp = document.getElementById('weatherdiv');
				_tmp.innerHTML = response;
			}
		}
	}
	
	function weather_ajax(city_code)
	{
		
		var tmp = Math.floor(Math.random()*1000000+1);
		url = './lib/weather_ajax.php?cc='+city_code+'&mm='+tmp;
		
		// code for Mozilla, etc.
		if(window.XMLHttpRequest) 
		{
			xmlhttp_obj=new XMLHttpRequest()
			if(xmlhttp_obj)
			{
				xmlhttp_obj.onreadystatechange = weather_handleInfo
				xmlhttp_obj.open("GET",url,true)
				xmlhttp_obj.send(null)
			}
		}
		// code for IE
		else if (window.ActiveXObject) 
		{
			xmlhttp_obj=new ActiveXObject("Microsoft.XMLHTTP")
			if(xmlhttp_obj)
			{
				xmlhttp_obj.onreadystatechange = weather_handleInfo
				xmlhttp_obj.open("GET",url,true)
				xmlhttp_obj.send()
			} 
		}	
	}
	

	function get_weather_ajax()
	{
		
		var city_code = document.getElementById('weathercityid').value;
		var tmp = Math.floor(Math.random()*1000000+1);
		var url = './lib/weather_ajax.php?action=currentweather&cc='+city_code+'&mm='+tmp;

		// code for Mozilla, etc.
		if(window.XMLHttpRequest) 
		{
			xmlhttp_obj=new XMLHttpRequest()
			if(xmlhttp_obj)
			{
				xmlhttp_obj.onreadystatechange = weather_handleInfo
				xmlhttp_obj.open("GET",url,true)
				xmlhttp_obj.send(null)
			}
		}
		// code for IE
		else if (window.ActiveXObject) 
		{
			xmlhttp_obj=new ActiveXObject("Microsoft.XMLHTTP")
			if(xmlhttp_obj)
			{
				xmlhttp_obj.onreadystatechange = weather_handleInfo
				xmlhttp_obj.open("GET",url,true)
				xmlhttp_obj.send()
			} 
		}	
	}