
function popitup0(url) {
	newwindow=window.open(url,'name','menubar=yes,status=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=16,screenX=16,top=16,screenY=16');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitup(url) {
	newwindow=window.open(url,'name','height=720,width=590,scrollbars=yes,resizable=yes,left=16,screenX=16,top=16,screenY=16');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitup2(url) {
	newwindow=window.open(url,'name','height=345,width=590,scrollbars=yes,resizable=yes,left=16,screenX=16,top=16,screenY=16');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitup2_noscroll(url) {
	newwindow=window.open(url,'name','height=335,width=590,scrollbars=no,resizable=yes,left=16,screenX=16,top=16,screenY=16');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitup2a_noscroll(url) {
	newwindow=window.open(url,'name','height=450,width=590,scrollbars=no,resizable=yes,left=16,screenX=16,top=16,screenY=16');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitup2a(url) {
	newwindow=window.open(url,'name','height=460,width=590,scrollbars=yes,resizable=yes,left=16,screenX=16,top=16,screenY=16');
	if (window.focus) {newwindow.focus()}
	return false;
}

function popitup3(url) {
	var cgi = url + "?searchvalue=" + document.getElementById("suchform").suchfeld.value + "&type=any&dirs=/&exdirs=/inc;/css;/cgi-bin;/download;/images;/js;/swf";
	newwindow=window.open(cgi,'name','height=720,width=590,scrollbars=yes,resizable=yes,left=16,screenX=16,top=16,screenY=16');
	if (window.focus) {newwindow.focus()}
	return false;
}

function confirm2 () {
	// check the contents of the contact form
	// if they are valid, accept the form after a user confirmation
	for (i = 0; i < document.kontaktform.elements.length; i++) {
		var str = document.kontaktform.elements[i].value;
		// check the validity of the email field
		if (document.kontaktform.elements[i].name == "ContactEmail") {
			if (str == "") {
				alert("Prosíme zadejte svou e-mailovou adresu.");
				return false;
			}
			// test if javascripts contains the regexp-function
			var regexp_available = false;
			if (typeof(RegExp) == 'function') {
				var b = new RegExp('abc');
				if (b.test('abc') == true) { regexp_available = true; }
			}
			if (regexp_available == true) {
				// test the email-string against this regexp: <name>@<2ndleveldomain>.<1stleveldomain>
				reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)(\\@)([a-zA-Z0-9\\-\\.]+)(\\.)([a-zA-Z]{2,4})$');
				if ((reg.test(str)) == false) { 
					alert("E-mailová adresa je neplatná.");
					return false;
				}
			}
			else {
				// no regexp: test '@' and '.' and string length
				if (str.length < 8 || str.indexOf('@',0) == -1 || str.indexOf('.',0) == -1) {
					alert("E-mailová adresa je neplatná.");
					return false;
				}
			}
		}
		// check the subject text field
		if (document.kontaktform.elements[i].name == "ContactText" && str.length < 10) {
			alert("Prosíme napište svou zprávu.");
			return false;
		}
	}
	if (confirm("Má se Vaše zpráva odeslat?") == false) {
		return false;
	}
	else {
		alert("Vaše zpráva byla úspěšně odeslána.\n\nDěkujeme!");
		return true;
	}
}

function confirm3 () {
	// check the contents of the  brochure order form
	// if they are valid, accept the form after a user confirmation
	for (i = 0; i < document.BestellForm.elements.length; i++) {
		var str = document.BestellForm.elements[i].value;
		// check the address fields
		if (document.BestellForm.elements[i].name == "VornameNachname") {
			if (str.length < 8) {
				alert("Prosíme zadejte Vaše jméno a příjmení.");
				return false;
			}
		}
		if (document.BestellForm.elements[i].name == "StrasseHausnummer") {
			if (str.length < 5) {
				alert("Prosíme zadejte Vaši ulici a číslo domu.");
				return false;
			}
		}
		if (document.BestellForm.elements[i].name == "PLZOrt") {
			if (str.length < 8) {
				alert("Prosíme zadejte poštovní směrovací číslo a město.");
				return false;
			}
		}
	}
	if (confirm("Má se Vaše objednávka odeslat?") == false) {
		return false;
	}
	else {
		alert("Vaše objednávka byla úspěšně odeslána.\n\nDěkujeme!");
		return true;
	}
}

