// JavaScript Document
function nove_okno(adresa, jmeno, vzhled){
	secondWindow=window.open(adresa, jmeno, vzhled)
}

function isNumber(theField)   {
		var theInput = theField.value;
		var theLength = theInput.length;
		var cislo = true;
		for (var i = 0; i < theLength; i++)   {
				var theChar = theInput.substring(i,i+1);
						if (theChar < "0" || theChar >"9")   {
									cislo = false;
						}
		}
		if (cislo == true)   {
				return true;
				}
		else   {
				return false;
				}
}		

function isText(theField)   {
		var theInput = theField.value;
		var theLength = theInput.length; 
		var text = true;
		for (var i = 0; i < theLength; i++)   {
				var theChar = theInput.substring(i,i+1);
				if (theChar == ";" || theChar =="$" || theChar == "{" || theChar == "}" || theChar == "[" || theChar == "]" || theChar == "<" || theChar == ">")   {
							text = false;
				}
		}
		if (text == true)   {
				return true;
				}
		else   {
				return false;
				}
}

function isPhone(theField)   {
		var theInput = theField.value;
		var theLength = theInput.length;
		var tel = true;
		for (var i = 0; i < theLength; i++)   {
				var theChar = theInput.substring(i,i+1);
				if ((theChar < "0" || theChar >"9") && (theChar != " ") && (theChar != "+"))   {
							tel = false;
				}
		}
		if (tel == true)   {
				return true;
				}
		else   {
				return false;
				}
}		

function validForm(form)   {
	if (isText(form.Firma) == false)   { 
			alert ("Do pole  Firma nepište závorky a středník!");
    		return false;
	}
	if (isText(form.Jmeno) == false)   { 
			alert ("Do pole  Jmeno nepište závorky a středník!");
    		return false;
	}
	if (isText(form.Ulice) == false)   { 
			alert ("Do pole  Ulice nepište závorky a středník!");
    		return false;
	}
	if (isText(form.Obec) == false)   { 
			alert ("Do pole  Obec nepište závorky a středník!");
    		return false;
	}
	if (isPhone(form.Psc) == false)   { 
			alert ("Do pole PSČ pište jenom číslice nebo mezeru!");
    		return false;
	}
	if (isPhone(form.Telefon) == false)   { 
			alert ("Do pole Telefon pište jenom číslice, mezeru a +!");
    		return false;
	}
	if (isPhone(form.Fax) == false)   { 
			alert ("Do pole Fax pište jenom číslice, mezeru a +!");
    		return false;
	}
	if (isText(form.Email) == false)   { 
			alert ("Do pole  Email nepište závorky, středník a uvozovky!");
    		return false;
	}
	if (isText(form.Poznamka) == false)   { 
			alert ("Do pole  Vzkaz nepište závorky, středník a uvozovky!");
    		return false;
	}
	return true;
}

/*;<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">*/