
function check_number(my_product, my_number, message){
	var filter = /(^\d+$)/;
	if(my_number != "" && !filter.test(my_number)) {
		alert(message);
		$('product_'+my_product).value = 1;
	} else {

	}
} // end of the 'check_number()' function

function reportError() {
	alert('The requested URL was not found on this server.');
} // end of the 'reportError()' function
	
function Webshop(myValue, myAction, kom) {
	var objID = 'webshop_'+myValue;
	var myAjax = new Ajax.Updater({	success: objID },	'include/webshop_cart.php', {
			method: 'post',
			parameters: 'value='+myValue+'&action='+myAction+'&kom='+kom,
			onFailure: reportError,
			onComplete: WebshopCart
		}
	);
	
} // end of the 'Webshop()' function

function WebshopCart() {
	var objID = 'my_chart';
	var myAjax = new Ajax.Updater({	success: objID },	'include/webshop_my_cart.php', {
			method: 'post',
			onFailure: reportError
		}
	);
	
} // end of the 'WebshopCart()' function

function Kupi() {
	var myAjax = new Ajax.Request('include/webshop_order.php', {
			method: 'get',
			onFailure: reportError,
			onComplete: KupiSubmit
		}
	);
	
} // end of the 'Kupi()' function

function KupiSubmit(originalRequest) {
	var xmlDocument = originalRequest.responseXML;
	var xmlOrder = xmlDocument.getElementsByTagName('order');
	var xmlID   = xmlDocument.getElementsByTagName('id').item(0).firstChild.data;
		
	document.KupiForm.ShoppingCartID.value = xmlID;
	document.KupiForm.submit();
} // end of the 'KupiSubmit()' function
