function addToCart(idProduct, idWwariant) {
    //alert(idProduct);
    //alert(wariant);
    var quant = document.getElementById('quantInput');
    var quantValue = 1;
    if(quant) quantValue = quant.value;        
	advAJAX.get({
		url: "ajaxActions.php",
		parameters : {
			action	 	 : 3,            
			idProduct	 : idProduct,
            quant        : quantValue,
            idWariant    : idWwariant
		},
		onSuccess : function(obj) {
			var response = obj.responseText;
			response = response.split("%%$$##"); 
			var messageBox = document.getElementById("messageBox");
            var messageBoxRight = document.getElementById("mbRightCorner");
            var messageBoxContent = document.getElementById("mbContent");
           
			messageBox.style.display = "block";
            centerBox('messageBox');            
			if (response[0] != '') document.getElementById('topShopcart').innerHTML = response[0];
            messageBoxRight.style.background = "url('../img/bgr/messageBox/cart/right.gif') no-repeat";
			messageBoxContent.innerHTML = response[1];
            setTimeout('hideBox("messageBox")', 2000);
			

		},
		onError : function(obj) { alert("Error: " + obj.status); }
	});
}

function hideBox(boxId) {
    var messageBox = document.getElementById(boxId);
    messageBox.style.display="none";
}

function addToCloset(idProduct, idWariant) {
	advAJAX.get({
		url: "ajaxActions.php",
		parameters : {
			action	  : 4,
			idProduct : idProduct,
            idWariant : idWariant
		},
		onSuccess : function(obj) {
			var response = obj.responseText;			
            var messageBox = document.getElementById("messageBox");
            var messageBoxRight = document.getElementById("mbRightCorner");
            var messageBoxContent = document.getElementById("mbContent");   
            
            messageBox.style.display = "block";
            centerBox('messageBox');                 
            messageBoxRight.style.background = "url('../img/bgr/messageBox/closet/right.gif') no-repeat";
            messageBoxContent.innerHTML = response;            
            setTimeout('hideBox("messageBox")', 2000);
		},
		onError : function(obj) { alert("Error: " + obj.status); }
	});
}

function removeFromCloset(idProduct, idWariant, idCustomer) {
	advAJAX.get({
		url: "ajaxActions.php",
		parameters : {
			action	 	 : 5,
			idProduct	     : idProduct,
            idWariant : idWariant,
			idCustomer	     : idCustomer
		},
		onSuccess : function(obj) {			
			window.location="klient,4.html";
		},
		onError : function(obj) { alert("Error: " + obj.status); }
	});
}