function checkContact() {
	if (document.forms[0].interesse.value == "Maak uw keuze") {
		alert("Geef aan waar dit bericht betrekking op heeft")
		document.forms[0].interesse.focus()
		return false
	} else if (document.forms[0].frmNaam.value == "") {
		alert("Vul uw naam in")
		document.forms[0].frmNaam.focus()
		return false
	} else if (document.forms[0].frmPlaats.value == "") {
		alert("Vul uw woonplaats in")
		document.forms[0].frmPlaats.focus()
		return false
	} else if (document.forms[0].frmTel.value == "") {
		alert("Vul uw telefoonnummer in")
		document.forms[0].frmTel.focus()
		return false
	} else if (!isTelNummer(document.forms[0].frmTel.value)) {
		alert("Het door u ingevulde telefoonummer is onjuist")
		document.forms[0].frmTel.focus()
		return false
	} else if (document.forms[0].frmMail.value=="")	{
		alert("Vul uw e-mailadres in")
		document.forms[0].frmMail.focus()
		return false
	} else if (!checkEmail(document.forms[0].frmMail.value)) {
		alert("Het is door u ingevulde e-mailadres in onjuist")
		document.forms[0].frmMail.focus()
		return false
	} else
		document.forms[0].submit()
}

function checkPostcode(strPostcode, n) {
    var intCharCodeMin = 65
    var intCharCodeMax = 122
    var intCharCodeMinInside = 90
    var intCharCodeMaxInside = 97

    strPostcode = String(strPostcode)

    if (strPostcode.length < 6)
        return false

    if(strPostcode.length > 7)
        return false

    strPostcode = strPostcode.replace(" ", "")

    if (strPostcode.length == 7)
        return false;

    if (String(parseInt(strPostcode.substr(0,4))).length != 4)
        return false

    for (i = 4;i < 6;i++)
		if (strPostcode.charCodeAt(i) < intCharCodeMin || strPostcode.charCodeAt(i) > intCharCodeMax || (strPostcode.charCodeAt(i) > intCharCodeMinInside && strPostcode.charCodeAt(i) < intCharCodeMaxInside))
		    return false

    return true
}

function isTelNummer(str) {
    if(!str)
        return false

    for(var i = 0;i < str.length;i++) {
        var ch = str.charAt(i)

        if ("0123456789-() +".indexOf(ch) == -1)
            return false
    }

    return true
}

function checkEmail(strEmail) {
	strtmpEmail = String(strEmail)

	if (strtmpEmail.indexOf("@") == -1 || strtmpEmail.indexOf(".") == -1)
		return false

	nAt = strtmpEmail.indexOf("@")

	if (nAt > 0) {
		strCheck = strtmpEmail.slice(nAt + 1)

		if (strCheck.indexOf(".") <= 0 )
			return false
		else
			return ((parseInt(strCheck.length) -1) - parseInt(strCheck.indexOf("."))  > 1)
	} else
		return false
}
