// FUNCTIE AANMELDING
function checkorder(theForm)
{
		if (theForm.name.value == '')
		{
			alert(" Fill in name please.")
			theForm.name.focus();
			return false;
		}
		if (theForm.street.value == '')
		{
			alert(" Fill in street please.")
			theForm.street.focus();
			return false;
		}
		if (theForm.housenumber.value == '')
		{
			alert(" Fill in housenumber please.")
			theForm.housenumber.focus();
			return false;
		}

		if (theForm.city.value == '')
		{
			alert(" Fill in city please.")
			theForm.city.focus();
			return false;
		}		
		if (theForm.postalcode.value == '')
		{
			alert(" Fill in postalcode please.")
			theForm.postalcode.focus();
			return false;
		}
		if (theForm.country.value == '')
		{
			alert(" Fill in country please.")
			theForm.country.focus();
			return false;
		}
		if (theForm.email.value == '')
		{
			alert(" Fill in email please.")
			theForm.email.focus();
			return false;
		}
		var filter = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,4})(\]?)$/; // valid
		if (!filter.test(theForm.email.value))
		{
			alert ("Fill in a correct email address.");
			theForm.email.focus();
			return false;
		}
		if (theForm.companyname.value != '' && theForm.vat.value == '')
		{
			alert("If you are a company, Fill in VAT identification number please.")
			theForm.vat.focus();
			return false;
		}
		if (theForm.amount.value == 0 && theForm.airtime.value == 0 && theForm.batterypack.value == 0)
		{
			alert(" Select device, airtime or batterypack please.")
			theForm.amount.focus();
			return false;
		}
		

}

function loginaccount(theForm)
{
		if (theForm.accountname.value == '')
		{
			alert(" Fill in accountname please.")
			theForm.accountname.focus();
			return false;
		}

	if (theForm.username.value == '')
		{
			alert(" Fill in username please.")
			theForm.username.focus();
			return false;
		}
		if (theForm.password.value == '')
		{
			alert(" Fill in password please.")
			theForm.password.focus();
			return false;
		}
}

function asklogincode(theForm)
{
		if (theForm.emailaddress.value == '')
		{
			alert(" Fill in emailaddress please.")
			theForm.emailaddresss.focus();
			return false;
		}
		var filter = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,4})(\]?)$/; // valid
		if (!filter.test(theForm.emailaddress.value))
		{
			alert ("Fill in a correct email address.");
			theForm.emailaddress.focus();
			return false;
		}

}

function newaccount(theForm)
{
		if (theForm.name.value == '')
		{
			alert(" Fill in name please.")
			theForm.name.focus();
			return false;
		}
		if (theForm.street.value == '')
		{
			alert(" Fill in street please.")
			theForm.street.focus();
			return false;
		}
		if (theForm.housenumber.value == '')
		{
			alert(" Fill in housenumber please.")
			theForm.housenumber.focus();
			return false;
		}
		
		if (theForm.zip.value == '')
		{
			alert(" Fill in zipcode please.")
			theForm.zip.focus();
			return false;
		}
		if (theForm.city.value == '')
		{
			alert(" Fill in city please.")
			theForm.city.focus();
			return false;
		}
		if (theForm.telephone.value == '')
		{
			alert(" Fill in telephone please.")
			theForm.telephone.focus();
			return false;
		}
		if (theForm.email.value == '')
		{
			alert(" Fill in email please.")
			theForm.email.focus();
			return false;
		}
		
}

function acceptterms(theForm)
{
		if (theForm.accept.checked == false)
		{
			alert(" Accept Terms and conditions.")
			theForm.accept.focus();
			return false;
		}
}

function check_searchform(theForm)
{
		if (theForm.searchquery.value == '')
		{
			alert("Vul zoekwoord in a.u.b.")
			theForm.searchquery.focus();
			return false;
		}
}

