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)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}

function addToCart(idproduct, idprice){

	var xmlHttp = GetXmlHttpObject();
    var params = "idproduct=" + idproduct + "&idprice=" + idprice;
    xmlHttp.open("POST", "/browse/cart/action/add/", true);

    //Send the proper header information along with the request
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");
	  xmlHttp.onreadystatechange = function() { 
 	    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			var response = new String(xmlHttp.responseText);
			document.getElementById(idproduct).innerHTML = response;
		  
        }
	}
	xmlHttp.send(params);
}

function changeProductCount(idop, idorder, count){ 

	var xmlHttp = GetXmlHttpObject();
    var params = "idop=" + idop + "&idorder=" + idorder +"&count=" + count;
    xmlHttp.open("POST", "/browse/cart/action/count/", true);

    //Send the proper header information along with the request
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");
	  xmlHttp.onreadystatechange = function() { 
 	    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			var response = new String(xmlHttp.responseText);
			document.getElementById("all_price").innerHTML = response;
        }
	}
	xmlHttp.send(params);
}

function changeMark(mark){ 

	var xmlHttp = GetXmlHttpObject();
    var params = "mark=" + mark;
    xmlHttp.open("POST", "/browse/mark/name/"+mark, true);

    //Send the proper header information along with the request
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");
	  xmlHttp.onreadystatechange = function() { 
 	    if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			var response = new String(xmlHttp.responseText);
			document.getElementById("mark").innerHTML = response;
        }
	}
	xmlHttp.send(params);
}