function tim(str)
{
	var url ="source/search.php";
	url +="?str="+str;
	url+="&thdiem=".concat((new Date()).getTime());	
	try{ 
	var h;
	if(window.ActiveXObject) h=new ActiveXObject("Microsoft.XMLHTTP");				
	else h= new XMLHttpRequest();	
	h.onreadystatechange=function() {	
			
			if (h.readyState==4) 
			{
				if (h.status==200) 
				{
						document.getElementById("mid").innerHTML=h.responseText;
				}
				else 
					alert("Không l?y d? li?u du?c. " + h.statusText+ "-"+ h.responseText);
			}			
	}
	h.open("GET",url);	
	h.send(null);	
	}
	catch (e) { alert("L?i "+ e.description + "-"+ h.responseText);}
}
function giohang(id,cmd)
{
	var url ="source/xuly.php";
	url +="?id="+id+"&cmd="+cmd;
	url+="&thdiem=".concat((new Date()).getTime());	
	try{ 
	var h;
	if(window.ActiveXObject) h=new ActiveXObject("Microsoft.XMLHTTP");				
	else h= new XMLHttpRequest();	
	h.onreadystatechange=function() {	
			
			if (h.readyState==4) 
			{
				if (h.status==200) 
				{					
					var kq=h.responseText.split('.');
					document.getElementById("soluong").innerHTML=kq[0];
					document.getElementById("tongtien").innerHTML=kq[1];
					alert('Sản phẩm đã được đưa vào giỏ hàng của bạn');
				}
				else 
					alert("Không l?y d? li?u du?c. " + h.statusText+ "-"+ h.responseText);
			}			
	}
	h.open("GET",url);	
	h.send(null);	
	}
	catch (e) { alert("L?i "+ e.description + "-"+ h.responseText);}
}
