var cst="";

function checkform()
{
	if(document.vermaufp.city[0].checked == false && document.vermaufp.city[1].checked == false && document.vermaufp.city[2].checked == false)
	{
		document.vermaufp.city[0].focus();
		alert("Please enter a city or a region in which you are looking for a flat.");
		return false;
	}

	if(document.vermaufp.object.value == "")
	{
		document.vermaufp.object.focus();
		alert("Please describe briefly what kind of object you are looking for.");
		return false;
	}

	if(document.vermaufp.erlaeuterung.value.length>200)
	{
		document.vermaufp.erlaeuterung.focus();
		alert("Your entry under 'Comments' is too long (max. 200 characters). Please use the field 'Additional information' if necessary.");
		return false;
	}

	if(isNaN(document.vermaufp.auswahl1.value))
	{
		document.vermaufp.auswahl1.focus();
		alert("This field is just for numbers.");
		return false;
	}

	if(isNaN(document.vermaufp.auswahl2.value))
	{
		document.vermaufp.auswahl2.focus();
		alert("This field is just for numbers.");
		return false;
	}

	if(isNaN(document.vermaufp.auswahl3.value))
	{
		document.vermaufp.auswahl3.focus();
		alert("This field is just for numbers.");
		return false;
	}

	if(isNaN(document.vermaufp.auswahl4.value))
	{
		document.vermaufp.auswahl4.focus();
		alert("This field is just for numbers.");
		return false;
	}

	if(isNaN(document.vermaufp.auswahl5.value))
	{
		document.vermaufp.auswahl5.focus();
		alert("This field is just for numbers.");
		return false;
	}

	if(document.vermaufp.howmany[0].checked == false && document.vermaufp.howmany[1].checked == false)
	{
		document.vermaufp.howmany[0].focus();
		alert("Please enter details for your inquiry: \nfor a single person / for several persons, \nsmoker / non-smoker");
		return false;
	}

	if(document.vermaufp.start.value == "")
	{
		document.vermaufp.start.focus();
		alert("Please enter the date when you want to move in.");
		return false;
	}

	if(document.vermaufp.time[0].checked == false && document.vermaufp.time[1].checked == false && document.vermaufp.time[2].checked == false)
	{
		window.location.href = "#anker";
		alert("Please select one of the 3 options under 'I am looking for'");
		return false;
	}

	if(document.vermaufp.rent.value == "")
	{
		document.vermaufp.rent.focus();
		alert("Please enter an approximate maximum rent.");
		return false;
	}

	if(document.vermaufp.notes.value.length>400)
	{
		document.vermaufp.notes.focus();
		alert("Your entry under 'Remarks' is too long (max. 400 characters).");
		return false;
	}

	if(document.vermaufp.name.value == "")
	{
		document.vermaufp.name.focus();
		alert("Please enter your full name.");
		return false;
	}

	if(document.vermaufp.status.value == "")
	{
		document.vermaufp.status.focus();
		alert("Please enter the legal form of the company / institution.");
		return false;
	}

	if(document.vermaufp.adr1.value == "")
	{
		document.vermaufp.adr1.focus();
		alert("Please enter a full address.");
		return false;
	}

	if(document.vermaufp.plz.value == "")
	{
		document.vermaufp.plz.focus();
		alert("Please enter the post code.");
		return false;
	}

	if(document.vermaufp.ort.value == "")
	{
		document.vermaufp.ort.focus();
		alert("Please enter a full address.");
		return false;
	}

	if(document.vermaufp.contactPARTNER.value == "")
	{
		document.vermaufp.contactPARTNER.focus();
		alert("Please enter the name of the in house contact person or the name of the real tenant.");
		return false;
	}

	if(document.vermaufp.fone1.value == "")
	{
		document.vermaufp.fone1.focus();
		alert("Please give us a telephone number where you can be reached.");
		return false;
	}

	if(document.vermaufp.agreetoagb.checked == false)
	{
		document.vermaufp.agreetoagb.focus();
		alert("Please confirm your inquiry and the acceptance of our General Terms and Conditions of Business in the field below.");
		return false;
	}


	document.vermaufp.ref.value = unescape(cst);

	document.vermaufp.submit();
}