		var xmlHttp;
		
		function createXMLHttpRequest() {
			if ( window.ActiveXObject ) {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} else if ( window.XMLHttpRequest ) {
				xmlHttp = new XMLHttpRequest();
			}
		}

		//Contact Form.
		
		function CheckContact() {
			var get_name = document.frm_contact.naam.value;
			var get_voornaam = document.frm_contact.voornaam.value;
			var get_bedrijf = document.frm_contact.bedrijf.value;
			var get_functie = document.frm_contact.functie.value;
			var get_straat = document.frm_contact.straat.value;
			var get_postcode = document.frm_contact.postcode.value;
			var get_woonplaats = document.frm_contact.woonplaats.value;
			
			var get_email = document.frm_contact.email.value;
			var get_telefoon = document.frm_contact.telefoon.value;
			var get_gsm = document.frm_contact.gsm.value;
			var get_bericht = document.frm_contact.bericht.value;
			
			if (document.frm_contact.checkbox_gegevens.checked == true) {
				var get_gegevens = 'on';
			} else {
				var get_gegevens = 'off';
			}

			createXMLHttpRequest();
			xmlHttp.onreadystatechange = outputContact;
			xmlHttp.open("GET","ajax_email.php?name=" + get_name + "&voornaam=" + get_voornaam + "&email=" + get_email + "&bedrijf=" + get_bedrijf + "&functie=" + get_functie + "&straat=" + get_straat + "&postcode=" + get_postcode + "&woonplaats=" + get_woonplaats + "&telefoon=" + get_telefoon + "&gsm=" + get_gsm + "&bericht=" + get_bericht + "&gegevens=" + get_gegevens, true);
			xmlHttp.send(null);
		}

		function outputContact() {
			if ( xmlHttp.readyState == 4 ) {
				if ( xmlHttp.status == 200 ) {
					if ( xmlHttp.responseText == 'email' ) {
						document.getElementById("mail_errorbox").style.visibility = "visible";
						document.getElementById("mail_errorbox").innerHTML = '<div style="font-size: 0.9em; color: #cc0000; background: #ffcccc url(../img/alert_red.gif) no-repeat left center; width: 650px; margin: 10px 0 10px 0; padding: 5px 0 5px 30px; border: 1px solid #cc0000;">Gelieve een contactmiddel in te vullen</div>';
					} else if ( xmlHttp.responseText == 'email2' ) {
						document.getElementById("mail_errorbox").style.visibility = "visible";
						document.getElementById("mail_errorbox").innerHTML = '<div style="font-size: 0.9em; color: #ff6600; background: #ffcc99 url(../img/alert_orange.gif) no-repeat left center; width: 650px; margin: 10px 0 10px 0; padding: 5px 0 5px 30px; border: 1px solid #ff6600;">Gelieve een geldig e-mailadres in te vullen</div>';
					} else if ( xmlHttp.responseText == 'naam' ) {
						document.getElementById("mail_errorbox").style.visibility = "visible";
						document.getElementById("mail_errorbox").innerHTML = '<div style="font-size: 0.9em; color: #cc0000; background: #ffcccc url(../img/alert_red.gif) no-repeat left center; width: 650px; margin: 10px 0 10px 0; padding: 5px 0 5px 30px; border: 1px solid #cc0000;">Gelieve uw naam in te vullen.</div>';
					} else if ( xmlHttp.responseText == 'voornaam' ) {
						document.getElementById("mail_errorbox").style.visibility = "visible";
						document.getElementById("mail_errorbox").innerHTML = '<div style="font-size: 0.9em; color: #cc0000; background: #ffcccc url(../img/alert_red.gif) no-repeat left center; width: 650px; margin: 10px 0 10px 0; padding: 5px 0 5px 30px; border: 1px solid #cc0000;">Gelieve uw voornaam in te vullen.</div>';
					} else {
						document.getElementById("mail_errorbox").style.visibility = "visible";
						document.getElementById("mail_errorbox").innerHTML = '<div style="font-size: 0.9em; color: #66cc00; background: #ccff99 url(../img/alert_green.gif) no-repeat left center; width: 650px; margin: 10px 0 10px 0; padding: 5px 0 5px 30px; border: 1px solid #66cc00;">Uw e-mail werd goed verzonden.</div>';
					}
				}
			}
		}
