
loading_text='<table dir="rtl"   width="793" border="0" align="center" cellpadding="0" cellspacing="0" > <tr><td width="32"><img src="images/down_04.gif" width="32" height="50" alt="" /></td><td background="images/down_02.gif" class="body"><div style=" text-align:center ; padding:0px; margin:0px; color:#000099; width:500px; height:19px;"> <span >جارى تحميل الصفحة المطلوبة من الخادم برجاء الانتظار</span>  . . .</div></td><td  background="images/down_02.gif" class="body"><div style=" text-align:center ; padding:0px; margin:0px; color:#000099; width:220px; height:19px;"><img src="images/ajax-loader.gif" width="220" height="19"></div></td><td width="27" background="images/down_02.gif"><img src="images/down_01.gif" width="27" height="50" alt="" /></td></tr></table>';

error_loading_text='<div align="right" class="status">خطأ اثناء تحميل الصفحة المطلوبة .!</div>';


function ajax_page(page)
	{
	var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	    catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		}
      }
	}
	xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==0)
  			{
			document.getElementById("page_body").innerHTML=error_loading_text;
		}
		else if(xmlHttp.readyState==1 || xmlHttp.readyState==2 ||  xmlHttp.readyState==3)
		  {
		  document.getElementById("page_body").innerHTML=loading_text;
		}
		else if(xmlHttp.readyState==4)
		  {

		  document.getElementById("page_body").innerHTML=xmlHttp.responseText;
		  //alert(xmlHttp.responseText);
		}

	}
	
	var url="get_sub.php";
	url=url+"?sub="+page;
	url=url+"&sid="+Math.random();
	//xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

