var xmlHttp;
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)
        {
            try
            {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    return xmlHttp;
 }
 
 function loaddata(idtin,id)
 {
 	xmlHttp = GetXmlHttpObject();
    if(xmlHttp==null) 
    {    
        alert("Trinh duyet k ho tro");
        return;
    }
    else
    {
		if(idtin = 347)
		{
        xmlHttp.onreadystatechange = xulydulieutrave;
        xmlHttp.open('GET','content/homeajax/menu.php',true);
        xmlHttp.send(null);
		}
		if(idtin = 344)
		{
        xmlHttp.onreadystatechange = xulydulieutrave;
        xmlHttp.open('GET','content/homeajax/newsindex.php',true);
        xmlHttp.send(null);
		}
    }
 }
 function xulydulieutrave()
 {
    	document.getElementById("txtshow").innerHTML=xmlHttp.responseText;

 }

/*---------------------------------*/
 function loadsp()
 {
 	xmlHttp = GetXmlHttpObject();
    if(xmlHttp==null) 
    {    
        alert("Trinh duyet k ho tro");
        return;
    }
    else
    {
        xmlHttp.onreadystatechange = loadsp_lenmanhinh;
        xmlHttp.open('GET','content/sanpham/sanphammoi.php',true);
        xmlHttp.send(null);
    }
 }
  function loadsp1()
 {
 	xmlHttp = GetXmlHttpObject();
    if(xmlHttp==null) 
    {    
        alert("Trinh duyet k ho tro");
        return;
    }
    else
    {
        xmlHttp.onreadystatechange = loadsp_lenmanhinh;
        xmlHttp.open('GET','content/sanpham/sanphambanchay.php',true);
        xmlHttp.send(null);
    }
 }
 function loadsp_lenmanhinh()
 {
 	 if(xmlHttp.readyState==4)
      {
 			document.getElementById("show1").innerHTML=xmlHttp.responseText;
       }
 }

/*---------------------------------*/
 function loadtext(id,i)
 {
 	xmlHttp = GetXmlHttpObject();
    if(xmlHttp==null) 
    {    
        alert("Trinh duyet k ho tro");
        return;
    }
    else
    {
    	if(i==1)
        {
        	xmlHttp.onreadystatechange = loadsp_lenmanhinh1;
       	}
        else
        {
        	xmlHttp.onreadystatechange = loadsp_lenmanhinh2;
        }
		if(id == 347)
		{
        xmlHttp.open('GET','content/homeajax/menu.php',true);
        xmlHttp.send(null);
		}
		if(id == 344)
		{
        xmlHttp.open('GET','content/homeajax/newsindex.php',true);
        xmlHttp.send(null);
		}
    }
 }
  function loadsp_lenmanhinh2()
 {
 	 if(xmlHttp.readyState==4)
      {
 			document.getElementById("show2").innerHTML=xmlHttp.responseText;
      }
 }
   function loadsp_lenmanhinh1()
 {
 	 if(xmlHttp.readyState==4)
      {
 			document.getElementById("show1").innerHTML=xmlHttp.responseText;
      }
 }
 /*--------------------------------------------------------*/
  function loadsanpham(idtin,cmd)
 {
 	xmlHttp = GetXmlHttpObject();
    if(xmlHttp==null) 
    {    
        alert("Trinh duyet k ho tro");
        return;
    }
    else
    {
        xmlHttp.onreadystatechange = xulydulieutrave;
        xmlHttp.open('GET','content/sanpham/showthongtin1.php?idtin=' + idtin +'&ac='+cmd,true);
        xmlHttp.send(null);
    }
 }
 function xulydulieutrave()
 {
 	if(xmlHttp.readyState==4)
      {
    	document.getElementById("txtshow").innerHTML=xmlHttp.responseText;
       }
 }
 function remove_image(name)
 {
 	xmlHttp = GetXmlHttpObject();
    if(xmlHttp==null) 
    {    
        alert("Trinh duyet k ho tro");
        return;
    }
    else
    {
        xmlHttp.onreadystatechange = removeimage;
        xmlHttp.open('GET','remoimage.php?name='+name,true);
        xmlHttp.send(null);
    }
 }
 function removeimage()
 {
 	if(xmlHttp.readyState==4)
      {
    	document.getElementById("abc").innerHTML=xmlHttp.responseText;
	  }
 }

