function DPotreby_Order_Form_Class()
{
	this.reInteger = /^\d+$/

/*
	this.onAddProduct = function()
	{
		amount = document.getElementById('amount');

		if (amount.value == "")
		{
			alert("Zadejte počet kusů produktu!");
			amount.focus();
			return false;
		}

		if (!(this.reInteger.test(amount.value) && amount.value > 0))
		{
			alert('Neplatná hodnota v poli "Počet kusů"!');
			amount.focus();
			return false;
		}

		return true;
	}
*/
	this.onSubmit = function()
	{
		var agr = document.getElementById('agreement');
		if (!agr.checked)
		{
			alert("Než přejdete k dalšímu kroku objednávky, musíte vyjádřit\nsouhlas s obchodními podmínkami a reklamačním řádem.");
			agr.focus();
			return false;
		}
		return true;
	}

	this.submitForm = function()
	{
		var orderform = document.getElementById('objednavka');
		orderform.submit();
	}

	this.onDeliverySelect = function(radio)
	{
		this.submitForm();
	}

	this.onPaymentSelect = function(radio)
	{
		this.submitForm();
	}

	this.onRemove = function(cpid)
	{
		var cpf = document.getElementById('rcpid');
		cpf.value = cpid;
		this.submitForm();
		return false;
	}

	this.doProfileEdit = function()
	{
		var eb = document.getElementById('lfedit');
		eb.click();
	}
}

var DPotreby_Order_Form = new DPotreby_Order_Form_Class();
