var Cart = {
	getItem: function (el, pid, jqSelector) {
		var cid = el.options[el.selectedIndex].value;
		$.ajax({
			type: "GET",
			data: {action: "getItem", item_1: cid.split("|")[0], product_id: pid},
			url: "ajax.php",
			success: function (json) {
				switch (json.status) {
					case true:
						if (json.content == null) {
							$(jqSelector).hide();
							$(el).nextAll('.PoductBuyButton').attr('disabled', true);
						} else {
							if (/\D/.test(json.content))
							{
								$(jqSelector).html(json.content).show();
							} else {
								$(jqSelector).html('<input type="hidden" name="article_id" value="'+json.content+'" />').show();
							}

							if (cid.split("|")[1] === '1') {
								$(el).nextAll('.PoductBuyButton').attr('disabled', false);
							} else {
								$(el).nextAll('.PoductBuyButton').attr('disabled', true);
							}
						}						
						break;
					case false:
						if (cid.split("|")[1] === '1') {
							$(el).nextAll('.PoductBuyButton').attr('disabled', false);
						} else {
							$(el).nextAll('.PoductBuyButton').attr('disabled', true);
						}
						$(jqSelector).hide();
						break;
				}				
			}
		});
	}
};
