/*--------------------------------: www.moheet-tech.net, .com, .org :--------------------------------*/

function GEID(elm)
{
	if( document.getElementById(elm) ) return document.getElementById(elm);	
	else return false;
}

var moheetHttpReq = false;

if( window.XMLHttpRequest )
{
	moheetHttpReq = new XMLHttpRequest();
}
else if( window.ActiveXObject )
{
	moheetHttpReq = new ActiveXObject('Microsoft.XMLHTTP');
}
else
{
	alert('Sorry, Your Web browser does not support AJAX Technology!');
}


function getMoheetAjaxedData(moheetUrl, moheetDiv, moheetLng)
{
	if( moheetHttpReq )
	{
		var moheetHttpDiv = document.getElementById(moheetDiv);
		var RD = Math.random();
		
		moheetHttpReq.open('GET', moheetUrl+'&R='+RD);

		moheetHttpReq.onreadystatechange = function()
		{
			if( moheetHttpReq.readyState < 4 )
			{
				moheetMsg = moheetLng=='Ar' ? '<img src=images/map_loading.gif>' : 'Sending, Please wait ...';	

				moheetHttpDiv.innerHTML = moheetMsg;
				//moheetHttpDiv.style.color='#F15B20';
			}
			else
			{
				if( moheetHttpReq.readyState == 4 && moheetHttpReq.status == 200 )
				{
					moheetHttpDiv.innerHTML = moheetHttpReq.responseText;
				
				}
			}	
		}
		moheetHttpReq.send(null);
	}
}


function pstMoheetAjaxedData( moheetUrl, moheetDiv, moheetPst, moheetLng )
{
	if( moheetHttpReq )
	{
		var moheetHttpDiv = document.getElementById( moheetDiv );
		
		moheetHttpReq.open('POST', moheetUrl);
		moheetHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		moheetHttpReq.onreadystatechange = function()
		{
			if( moheetHttpReq.readyState < 4 )
			{
				moheetMsg = moheetLng=='Ar' ? 'جار الإرسال، انتظر من فضلك ...' : 'Sending, Please wait ...';	
				moheetHttpDiv.innerHTML = moheetMsg;
				//moheetHttpDiv.style.color='#F15B20';
			}
			else
			{
				if( moheetHttpReq.readyState == 4 && moheetHttpReq.status == 200 )
				{
					moheetHttpDiv.innerHTML = moheetHttpReq.responseText;
				}
			}	
		}
		moheetHttpReq.send(moheetPst);
	}
}

