// JavaScript Document

function add_product_to_cart(product_id,quantity)
{
var xml_http;
try
{
xml_http=new XMLHttpRequest();
}
catch(e)
{
try
{
xml_http=new ActiveXObject("Msxml2.XMLHTTP");   
}
catch (e)
{
try
{
xml_http=new ActiveXObject("Microsoft.XMLHTTP");      
}
catch (e)
{
return false;
}
}
}
var url = "add_product_to_cart.php";
var params="product_id=" + product_id + "&quantity=" + quantity;
xml_http.onreadystatechange=function()
{
if(xml_http.readyState==4 && xml_http.status == 200)
{

// Take action here. 


}
}
xml_http.open("GET",url+"?"+params,true);
xml_http.send(params);
}
