
function wi(url, width, height)
{
	width += 50; height += 50;
	window.open(url, 'foto', 'width='+width+', height='+height+', toolbar=no, location=no, resizable=yes, scrollbars=yes, top=100, left=100');
	return false; 
}

function w(url)
{
    window.open(url, "page", "menubar=yes, location=yes, status=yes, toolbar=no, scrollbars=yes, resizable=yes");
    return false;
}


function trim(hodnota)
{
	if(hodnota.charAt(0) == " ") {
		hodnota = hodnota.substring(1,hodnota.length);
		hodnota = trim(hodnota);
	}
	if(hodnota.charAt(hodnota.length-1) == " ") {
		hodnota = hodnota.substring(0,hodnota.length-1);
		hodnota=trim(hodnota);
	}
	return hodnota;
}

function check_form()
{
	var error = false;
	var report = '';
	var jmeno_prijmeni = document.getElementById('jmeno_prijmeni').value;
	jmeno_prijmeni = trim(jmeno_prijmeni);
	if (jmeno_prijmeni.length == 0) {
		error = true;
		report += 'Nebylo zadáno jméno a příjmení!\n';
	}
	var telefon = document.getElementById('telefon').value;
	telefon = trim(telefon);
	if (telefon.length == 0) {
		error = true;
		report += 'Nebyl zadán telefon!\n';
	}
	var termin = document.getElementById('termin').value;
	termin = trim(termin);
	if (termin.length == 0) {
		error = true;
		report += 'Nebyl zadán termín!\n';
	}
	var pocet_osob = document.getElementById('pocet_osob').value;
	pocet_osob = trim(pocet_osob);
	if (pocet_osob.length == 0) {
		error = true;
		report += 'Nebyl zadán počet osob!\n';
	}

	if (error) {
		alert(report);
		return false;
	}

	var check = document.getElementById('check_value');
	check.value = 1;
	return true;
}

