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 timbatdongsan()

 {

 	xmlHttp = GetXmlHttpObject();

    if(xmlHttp==null) 

    {    

        alert("Trinh duyet k ho tro");

        return;

    }

    else

    {

        xmlHttp.onreadystatechange = xulydulieutrave;

        xmlHttp.open('GET','content/search/timbatdongsan.php',true);

        xmlHttp.send(null);

    }

 }

 function xulydulieutrave()

 {

 	if(xmlHttp.readyState==4)

      {

    	document.getElementById("boxshow").innerHTML=xmlHttp.responseText;

       }

 }



/*---------------------------------*/

 function timcongtybds()

 {

 	xmlHttp = GetXmlHttpObject();

    if(xmlHttp==null) 

    {    

        alert("Trinh duyet k ho tro");

        return;

    }

    else

    {

        xmlHttp.onreadystatechange = xulydulieutrave;

        xmlHttp.open('GET','content/search/timcongtybds.php',true);

        xmlHttp.send(null);

    }

 }

 function timtintucvanban()

 {

 	xmlHttp = GetXmlHttpObject();

    if(xmlHttp==null) 

    {    

        alert("Trinh duyet k ho tro");

        return;

    }

    else

    {

        xmlHttp.onreadystatechange = xulydulieutrave;

        xmlHttp.open('GET','content/search/timtintucvanban.php',true);

        xmlHttp.send(null);

    }

 }





//-----------------------------------------------------------------------------------------



 function tinvip()

 {

 	xmlHttp = GetXmlHttpObject();

    if(xmlHttp==null) 

    {    

        alert("Trinh duyet k ho tro");

        return;

    }

    else

    {

        xmlHttp.onreadystatechange = hienthitin;

        xmlHttp.open('GET','content/ajaxquery/tinvip.php',true);

        xmlHttp.send(null);

    }

 }

 

 function tintrensan()

 {

 	xmlHttp = GetXmlHttpObject();

    if(xmlHttp==null) 

    {    

        alert("Trinh duyet k ho tro");

        return;

    }

    else

    {

        xmlHttp.onreadystatechange = hienthitin;

        xmlHttp.open('GET','content/ajaxquery/tintrensan.php',true);

        xmlHttp.send(null);

    }

 }

  function tinbdsplaza()

 {

 	xmlHttp = GetXmlHttpObject();

    if(xmlHttp==null) 

    {    

        alert("Trinh duyet k ho tro");

        return;

    }

    else

    {

        xmlHttp.onreadystatechange = hienthitin;

        xmlHttp.open('GET','content/ajaxquery/tinbdsplaza.php',true);

        xmlHttp.send(null);

    }

 }

 function hienthitin()

 {

 	if(xmlHttp.readyState==4)

      {

    	document.getElementById("raovatshow").innerHTML=xmlHttp.responseText;

       }

 }

/*---------------------------------*/
 function loadtext(loai)
 {
 	xmlHttp = GetXmlHttpObject();
    if(xmlHttp==null) 
    {    
        alert("Trinh duyet k ho tro");
        return;
    }
    else
    {
		alert(loai);
		xmlHttp.onreadystatechange = loadsp_lenmanhinh1;
		if(loai=="cannang")
		{
			xmlHttp.open('GET','content/homeajax/cam_nang_bds.php',true);
			xmlHttp.send(null);
		}
		if(loai=="bieudo")
		{
			xmlHttp.open('GET','content/homeajax/bieu_do_bds.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;
      }
 }

 /*--------------------------------------------------------*/
