function addToCart(id, q, desc) {
       if(q==null) q=1;
       if(desc==null) desc='';
	var atcreq = new JsHttpRequest();
	atcreq.onreadystatechange = function() {
		if (atcreq.readyState == 4) {
			atcreq.onreadystatechange = this.dummy;			
			if (atcreq.responseJS) {
				setCartInformHtml(atcreq.responseJS.html||'failed');
			}
			if(atcreq.responseText) {
				alert(atcreq.responseText);
			}
		}
	}
	atcreq.caching = false;
	atcreq.open('POST', '/_admin/modules/ishop/components/cartchecker/process/process_0.php', true);
	atcreq.send({cart_act:'add', item_id: id, item_qty: q, item_desc: desc});	

};

function setCartInformHtml(html) {
       alert('Предмет добавлен в корзину!');
	if(html) {
		var el = document.getElementById('cartinform');
		if(el !=null && typeof(el) == "object") {
			el.innerHTML = html;
		} else {
			//alert("Can't find 'cartinform' object")
		}
	}
}
