var initValues = new Object(); 
initValues.prename = "First name"; 
initValues.surname = "Surname"; 
initValues.email = "E-mail"; 
initValues.street = "Street, no."; 
initValues.zipcode = "ZIP/Postal Code"; 
initValues.city = "City"; 
initValues.phone = "Telephone"; 
initValues.title = "Title"; 
initValues.company = "Company"; 
initValues.fax = "Fax"; 
initValues.comment = "Comment"; 
initValues.countryname = "Country"; 

function checkForm() {
	var isValueMissing = false;
	var el = document.forms[1].elements;
	var i;

	for (i=0; i < el.length; i++)
	{
		if (	(el[i].id.indexOf("mandatorycheckbox_") == 0 &&
			 el[i].checked == false) ||

			(el[i].id.indexOf("mandatory") == 0 &&
			 (el[i].value == initValues[el[i].name] || el[i].value == ""))   )
		{
			isValueMissing = true;
		}
	}

	 if (isValueMissing) {
		alert("Please complete the fields marked with an asterisk *.");
		return;
	 }

	for (i=0; i < el.length; i++) {
		if (el[i].value == initValues[el[i].name])
		{

			el[i].value = "";	// Entfernen der Voreinstellungen aller Felder, die nicht gesetzt sind
		}
	}

	document.forms[1].submit();
}

//remove label text in input fields

function clearInitValue(el, initString)

{

	// clear text input value when input field is gaining focus for the first time

	if (el && initString && el.value == initString)

		el.value = "";

}
