// JavaScript Document
var xmlhttp;
var xmlloadRaoVatHome;
            function getxmlhttpobject()
                {
                    var xmlhttp=null;
                    try{
                        //Firefox, Opera 8.0+, Safari
                        xmlhttp = new XMLHttpRequest();
                        }    
                        catch(e){
                            try{
                                //IE 5.5 +
                                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
                                }
                                catch(e){                        
                                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");                            
                                }
                            }
                            return xmlhttp;
                    }
            function stateChanged()
                {
                    if(xmlhttp.readyState==3)        
                        {
                            document.getElementById('divCustomerInfo').innerHTML='<font color=white>Dang tai du lieu...</font>';
                            }
                    if(xmlhttp.readyState==4)        
                        {
                            document.getElementById('divCustomerInfo').innerHTML=xmlhttp.responseText;
                        }
                    }
            function Save_item(sId)
                {
                    
					xmlhttp=getxmlhttpobject();
                    if(xmlhttp==null){
                        alert("Trinh duyet cua ban khong ho tro ajax!");
                        return false;
                    }
					//var sId = document.getElementById("txtCustomerId").value;
					sId=escape(sId);
                    var url="http://antiem.net/saveItem.php";
                    url=url+"?id="+sId;
                	
                   // xmlhttp.onreadystatechange=stateChanged;
                    xmlhttp.open("GET",url,true);
                    xmlhttp.send(null);//goi du lieu 
                  } 
			 function Del_Saved_item(sId)
                {
                    
					xmlhttp=getxmlhttpobject();
                    if(xmlhttp==null){
                        alert("Trinh duyet cua ban khong ho tro ajax!");
                        return false;
                    }
					//var sId = document.getElementById("txtCustomerId").value;
					sId=escape(sId);
                    var url="http://antiem.net/DelSavedItem.php";
                    url=url+"?id="+sId;
                	//alert(url);
                   // xmlhttp.onreadystatechange=stateChanged;
                    xmlhttp.open("GET",url,true);
                    xmlhttp.send(null);//goi du lieu 
                  }  	
				  
//-------------------------------------------------------------------------------------------------------------------------------
 function stateChangedRaoVatHome()
   {
                    if(xmlloadRaoVatHome.readyState==3)        
                        {
                            document.getElementById('RaoVatHome').innerHTML='<font color=white>Dang tai du lieu...</font>';
                            }
                    if(xmlloadRaoVatHome.readyState==4)        
                        {
                            document.getElementById('RaoVatHome').innerHTML=xmlloadRaoVatHome.responseText;
                        }
    }
	function loadRaoVatHome(sId)
                {
                    var url="http://antiem.net/loadRaoVatHome.php";
					//var url="http://localhost/antiemmoi/loadRaoVatHome.php";
					xmlloadRaoVatHome=getxmlhttpobject();
                    if(xmlloadRaoVatHome==null){
                        alert("Trinh duyet cua ban khong ho tro ajax!");
                        return false;
                    }
					
                    
                    url=url+"?id="+sId;
                	//alert(url);
                    xmlloadRaoVatHome.onreadystatechange=stateChangedRaoVatHome;
                    xmlloadRaoVatHome.open("GET",url,true);
                    xmlloadRaoVatHome.send(null);
                  } 

//-------------------------------------------------------------------------------------------------------------------------------
