var xmlHttp
var objj

function showpage(add,obj){

  if (add == 'about-us.php') document.title=':. درباره فروشگاه .: '; 
  else if (add=='contact-us.php') document.title=':. تماس با ما .:' ;
  else if (add=='register.php') document.title=':. عضویت .:' ;
  else if (add=='sell.php') document.title=':. فروش آهنگ .:' ;
  else if (add=='main.php') document.title=':. صفحه اصلی .:' ;
  else if (add=='my_pro.php') document.title=':. ساخته های من .:' ;	
  //else if (add.substr(0,12) == 'sec-news.php') document.title='';

  objj=obj;
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)  { 
       alert ("پشتيباني نمي كند HTTP Request مرورگر شما از");
    return ;
  } 
  var url=add;  
  xmlHttp.onreadystatechange=stateChanged ;	  
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);  
}
//********************
function stateChanged()
{ 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
     if(xmlHttp.status == 200) {
       document.getElementById(objj).innerHTML=xmlHttp.responseText;

     } else {
	   if (xmlHttp.status==12029) 
	      document.getElementById(objj).innerHTML='<div align="center" ><br><font dir="rtl" size="1" color="#ab0a0a" face="Tahoma">دسترسي به سرور به دليل قطع ارتباط ميسر نيست.</font></div>';
	   else
		  document.getElementById(objj).innerHTML='<div align="center" ><br><font dir="rtl" size="1" color="#ab0a0a" face="Tahoma">خطاي شماره '+xmlHttp.status +'، پيغام: '+xmlHttp.statusText+'</font></div>';
	  }  
  }
  else{
          //document.getElementById(objj).innerHTML='<div style="color:#666666; padding-top:10px; padding-bottom:9px; direction:rtl; font-size:10px; text-align:center"><img src="images/icon-wait.gif" align="middle"/><br>در حال فراخواني...</div>';
		  
	   document.getElementById(objj).innerHTML='<div style="background-color:#d11e1e; color:#FFFFFF;position:absolute; left:89%; top:0px; margin-left:0px; margin-top:0px; padding:0px 0px 0px; width:110px"><div align="center" style="direction:rtl; font-size:10px">&nbsp;<img src="image/progress.gif" align="middle" /> در حال فراخواني...</div></div>';


  }
} 
//********************

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try{
		  // Firefox, Opera 8.0+, Safari
		  xmlHttp=new XMLHttpRequest();
	}
	catch (e){
	    // Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
//********************




