function addToCart(id)
{
  sendForm({id: id, wb: '8|reloadCart()'}, '/store/cmd/cart/addpost/');
}
function deleteFromCart(id) {
  sendForm({id: id, wb: '8|reloadCart()'}, '/store/cmd/cart/deletepost/');
}
function removeAllChilds(elt) 
{
	if (elt.hasChildNodes)
	{
		while (elt.childNodes.length > 0) {
			elt.removeChild(elt.firstChild);
		}
	}
}
function reloadCart()
{
  // перезагружаю первую часть.
  var req = new JsHttpRequest();
  req.onreadystatechange = function() {
    if (req.readyState == 4) {
			$("#korzina1").html(req.responseText);
    }
  }
  req.open('GET', '/store/tmpl/top_cart/', true);
  req.send({ajax: 1});

  // перезагружаю вторую часть.
  var req2 = new JsHttpRequest();
  req2.onreadystatechange = function() {
    if (req2.readyState == 4) {
			$("#korzina2").html(req2.responseText);
    }
  }
  req2.open('GET', '/store/tmpl/popup_cart/', true);
  req2.send({ajax: 1});
}
