function ShowHide(id) {
	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block';
	} else {
		document.getElementById(id).style.display = 'none';
	}
}

function confirmBuy(buyUrl) {
	if(confirm("Opravdu chcete vystavit fakturu?")) {
		document.location = delUrl;
	}
}

function confirmDobropis(buyUrl) {
	if(confirm("Opravdu chcete vystavit dobropis? je zakazka s minusem?")) {
		document.location = delUrl;
	}
}

function confirmBuy1(buyUrl) {
	if(confirm("Opravdu chcete vystavit prodejku - do 10000Kč?")) {
		document.location = delUrl;
	}
}

function alertBuy() {
	alert("Not enough credit to buy this file");
}

function confirmDelete(delUrl) {
	if(confirm("Opravdu chcete tuto zakazku smazat?")) {
		document.location = delUrl;
	}
}

function confirmDeleteFa(delUrl) {
	if(confirm("Opravdu chcete tuto fakturu smazat?")) {
		document.location = delUrl;
	}
}

function confirmUhrada(delUrl) {
	if(confirm("Chcete tuto f;u oznacit jako uhrazenou?")) {
		document.location = delUrl;
	}
}

function confirmDeleteUser(delUrl) {
	if(confirm("Do you really want to delete this user?")) {
		document.location = delUrl;
	}
}

function calcDoprava() {
	document.getElementById('doprava').value = document.getElementById('km').value * 15;
}

function calcCelkem() {
	cena = document.getElementById('cena').value;
	slevap = Math.floor(document.getElementById('sleva').value);
	sleva = (cena / 100) * slevap;
	doplnkove = document.getElementById('doplnkove').value;
	doprava = document.getElementById('doprava').value;
	document.getElementById('celkem').value = Math.round((cena - sleva) + (doplnkove * 1) + (doprava * 1));
}


