function orderajax(ref, id, cnt) {
	var req = new Subsys_JsHttpRequest_Js();
	req.onreadystatechange = function() {
		if (req.readyState == 4) {
			if (req.responseJS.HTML && req.responseJS.HTML != '' || req.responseJS.SUCCESS && req.responseJS.SUCCESS != '') {
				if(req.responseJS.HTML)	document.getElementById('basket').innerHTML = req.responseJS.HTML;
				if(req.responseJS.SUCCESS != '') {
					showNotify(req.responseJS.SUCCESS);
				}
			} 
			if(req.responseJS.ERROR && req.responseJS.ERROR != '') {
				showNotify(req.responseJS.ERROR);
			}
			
		}
	}

	req.open(null, '?jsmodule=ShopItem', true);
	req.send( {ref: ref, id : id, cnt : document.getElementsByName(cnt)[0].value} );
}

function showNotify(t) {
	var text = "";
	notify = document.getElementById("divPopup");
	var YOffset = document.all ? iecompattest().scrollTop : pageYOffset;
	sh = Math.floor(iecompattest().clientHeight/2) - 100 + YOffset;
	sw = Math.floor(iecompattest().clientWidth/2) - 150;
	notify.className = "addNotify";
	notify.style.top = sh + "px";
	notify.style.left = sw + "px";
	notify.style.height = 200 + "px";
	notify.style.width = 300 + "px";
	text += "<span>" + t + "</span>";
	text += "<button onclick=\"closePopup()\">ok</button>";
	notify.innerHTML = text;
	notify.style.display = "block";
}

function iecompattest() {
return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body
}

function closePopup() {
notify = document.getElementById("divPopup");
notify.style.display = "none";
notify.style.height = "0";
notify.style.width = "0";
notify.innerHTML = "";
}
