// ----------------------------------------------------------------------------
function AddProductToCart(p_form) {
	//alert('aaaaa');
	p_form.submit();
}

// ----------------------------------------------------------------------------
function ShowYourCart(p_idUser) {
	//alert('aaaaa');
	document.location = 'shop.php?action=showYourCart&id_user='+p_idUser+'&';
}

// ----------------------------------------------------------------------------
function SaveCart(p_form) {
	p_form.action = 'shop.php?action=saveCart';
	p_form.submit();
}
// ----------------------------------------------------------------------------
function SendOrder(p_form) {
	p_form.action = 'shop.php?action=sendOrder';
	p_form.submit();
}
// ----------------------------------------------------------------------------
function DeleteCartItem(p_form, p_indexDelete) {
	p_form.action = 'shop.php?action=deleteCartItem&indexDelete='+p_indexDelete;
	p_form.submit();
}
// ----------------------------------------------------------------------------
function SetTotalPrice() {
	//LIMIT_KOSZTY_DOSTARCZENIA
	var amountPaymentType;
	var sumPrice;
	var totalPrice = document.getElementById('total_price');
	sumPrice = document.getElementById('sum_price').value;

	if(sumPrice <= LIMIT_KOSZTY_DOSTARCZENIA) {
		if (document.getElementById('ptZaPobraniem').checked) {
			amountPaymentType = 11.50;
		}
		else {
			amountPaymentType = 8.00;
		}
	}
	else {
		amountPaymentType = 0.00;
	}

	//alert('amountPaymentType: ' + amountPaymentType + ', sumPrice: ' + sumPrice);
	totalPrice.innerHTML = (amountPaymentType*1.00 + sumPrice*1.00) + " PLN";
}
// ----------------------------------------------------------------------------
function Prnt(x) {
	try {
		//alert('Rozpoczynam drukowanie');
		w = window.open('','printable');
		document.getElementById('strefaDrukowania').className='tekst_druk';
		setTimeout("w.document.body.innerHTML=document.getElementById('strefaDrukowania').innerHTML", 1110);

		setTimeout('w.print()', 1200);
		setTimeout('w.close()', 1200);
	}
	catch(Exception) {
		//alert('Ta strona nie mo�e zosta� wydrukowana.');
	}
}
// ----------------------------------------------------------------------------
