	var xmlHttp;
	
	function createXMLHttpRequest() {
		if ( window.ActiveXObject ) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} else if ( window.XMLHttpRequest ) {
			xmlHttp = new XMLHttpRequest();
		}
	}
	
	// SITE SEARCH FUNCTION
	function searchStr() {
		var get_str = document.getElementById("search-field").value;
	
		document.getElementById("searchpage").action = "search-result.php?str=" + get_str;
		document.getElementById("searchpage").submit();		
	}
	
	//SUBSCRIBE NEWSLETTER RIGHT SIDE
	function submit_register() {
		var get_str = document.getElementById("email-field").value;
	
		document.getElementById("newsletter_form").action = "newsletter-ok.php?str=" + get_str;
		document.getElementById("newsletter_form").submit();
	}
	
	//Check Contact Form.
	function check_contact_form() {
		//Haal de waarden van de velden op
		get_naam = document.getElementById("frm_naam").value;
		get_company = document.getElementById("frm_company").value;
		get_address = document.getElementById("frm_address").value;
		get_email = document.getElementById("frm_email").value;
		get_phone = document.getElementById("frm_phone").value;
		get_message = document.getElementById("frm_message").value;
		get_spamcode = document.getElementById("frm_spamcode").value;
	
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = outputCheck_contact_form;
		xmlHttp.open("GET","ajax/ajax_check_contact_form.php?naam=" + get_naam + "&company=" + get_company + "&address=" + get_address + "&email=" + get_email + "&phone=" + get_phone + "&message=" + encodeURI(get_message) + "&spamcode=" + get_spamcode, true);
		xmlHttp.send(null);
	}
	
	function outputCheck_contact_form() {
		if ( xmlHttp.readyState == 4 ) {
			if ( xmlHttp.status == 200 ) {
				if ( xmlHttp.responseText == 'mail_sent' ) {
					document.getElementById("frm_contact").action = "contact-bedankt.php";
					document.getElementById("frm_contact").submit();
				} else {
					document.getElementById("frm_button_div").innerHTML = xmlHttp.responseText;
				}
			}
		}
	}
	
	//Check Subscriber Form.
	function check_subscriber_form() {
		//Haal de waarden van de velden op
		get_name = document.getElementById("frm_name").value;
		get_company = document.getElementById("frm_company").value;
		get_email = document.getElementById("frm_email").value;
		get_function = document.getElementById("frm_function").value;
		get_spamcode = document.getElementById("frm_spamcode").value;
	
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = outputCheck_subscriber_form;
		xmlHttp.open("GET","ajax/ajax_check_subscriber_form.php?name=" + get_name + "&company=" + get_company + "&email=" + get_email + "&function=" + get_function + "&spamcode=" + get_spamcode, true);
		xmlHttp.send(null);
	}
	
	function outputCheck_subscriber_form() {
		if ( xmlHttp.readyState == 4 ) {
			if ( xmlHttp.status == 200 ) {
				if ( xmlHttp.responseText == 'mail_sent' ) {
					document.getElementById("frm_subscriber").action = "newsletter-bedankt.php";
					document.getElementById("frm_subscriber").submit();
				} else {
					document.getElementById("frm_button_div").innerHTML = xmlHttp.responseText;
				}
			}
		}
	}
	
	//Check Modules Form.
	function check_modules_form(module) {
		//Haal de waarden van de velden op
		get_email = document.getElementById("frm_email").value;
		get_industry = document.getElementById("frm_industry").value;
		get_function = document.getElementById("frm_function").value;
		get_company = document.getElementById("frm_company").value;
		get_phone = document.getElementById("frm_phone").value;
		get_spamcode = document.getElementById("frm_spamcode").value;
	
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = outputCheck_modules_form;
		xmlHttp.open("GET","ajax/ajax_check_modules_form.php?module=" + module + "&email=" + get_email + "&industry=" + get_industry + "&function=" + get_function + "&company=" + get_company + "&phone=" + get_phone + "&spamcode=" + get_spamcode , true);
		xmlHttp.send(null);
	}
	
	function outputCheck_modules_form() {
		if ( xmlHttp.readyState == 4 ) {
			if ( xmlHttp.status == 200 ) {
				document.getElementById("frm_button_div").innerHTML = xmlHttp.responseText;
			}
		}
	}
	
	//Check Modules Form.
	function check_ideabox_form() {
		//Haal de waarden van de velden op
		get_company = document.getElementById("frm_company").value;
		get_email = document.getElementById("frm_email").value;
		get_name = document.getElementById("frm_name").value;
		get_spamcode = document.getElementById("frm_spamcode").value;
		get_phone = document.getElementById("frm_phone").value;
		get_function = document.getElementById("frm_function").value;
		get_bug = document.getElementById("frm_bug").value;
	
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = outputCheck_ideabox_form;
		xmlHttp.open("GET","ajax/ajax_check_ideabox_form.php?name=" + get_name + "&company=" + get_company + "&function=" + get_function + "&bug=" + encodeURI(get_bug) + "&email=" + get_email + "&phone=" + get_phone + "&spamcode=" + get_spamcode, true);
		xmlHttp.send(null);
	}
	
	function outputCheck_ideabox_form() {
		if ( xmlHttp.readyState == 4 ) {
			if ( xmlHttp.status == 200 ) {
				if ( xmlHttp.responseText == 'mail_sent' ) {
					document.getElementById("frm_ideabox").action = "ideabox-bedankt.php";
					document.getElementById("frm_ideabox").submit();
				} else {
					document.getElementById("frm_button_div").innerHTML = xmlHttp.responseText;
				}
			}
		}
	}
	
	
	
	//Check Support Form.
	function check_support_form() {
		//Haal de waarden van de velden op
		get_company = document.getElementById("frm_company").value;
		get_email = document.getElementById("frm_email").value;
		get_application = document.getElementById("frm_application").value;
		get_spamcode = document.getElementById("frm_spamcode").value;
		get_bug = document.getElementById("frm_bug").value;
	
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = outputCheck_support_form;
		xmlHttp.open("GET","ajax/ajax_check_support_form.php?company=" + get_company + "&application=" + get_application + "&bug=" + encodeURI(get_bug) + "&email=" + get_email + "&spamcode=" + get_spamcode, true);
		xmlHttp.send(null);
	}
	
	function outputCheck_support_form() {
		if ( xmlHttp.readyState == 4 ) {
			if ( xmlHttp.status == 200 ) {
				if ( xmlHttp.responseText == 'mail_sent' ) {
					document.getElementById("frm_support").action = "support-bedankt.php";
					document.getElementById("frm_support").submit();
				} else {
					document.getElementById("frm_button_div").innerHTML = xmlHttp.responseText;
				}
			}
		}
	}
	
	//Check Support Form.
	function check_demo_label() {
		//Haal de waarden van de velden op
		get_name = document.getElementById("frm_name").value;
		get_company = document.getElementById("frm_company").value;
		get_address = document.getElementById("frm_address").value;
		get_email = document.getElementById("frm_email").value;
		get_phone = document.getElementById("frm_phone").value;
		get_module_formvit = document.getElementById("frm_module_formvit").value;
		get_module_correctvit = document.getElementById("frm_module_correctvit").value;
		get_module_transvit = document.getElementById("frm_module_transvit").value;
		get_module_photovit = document.getElementById("frm_module_photovit").value;
		get_module_puzzlevit = document.getElementById("frm_module_puzzlevit").value;
	
		get_message = document.getElementById("frm_message").value;
		get_spamcode = document.getElementById("frm_spamcode").value;
	
		var params = "?name=" + get_name + "&company=" + get_company + "&address=" + get_address + "&email=" + get_email + "&phone=" + get_phone + "&module_formvit=" + get_module_formvit + "&module_correctvit=" + get_module_correctvit + "&module_transvit=" + get_module_transvit + "&module_photovit=" + get_module_photovit +	"&module_puzzlevit=" + get_module_puzzlevit + "&spamcode=" + get_spamcode + "&message=" + encodeURI(get_message);
	
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = outputCheck_demo_label;
		xmlHttp.open("GET","ajax/ajax_check_demo_label.php" + params, true);
		xmlHttp.send(null);
	}
	
	function outputCheck_demo_label() {
		if ( xmlHttp.readyState == 4 ) {
			if ( xmlHttp.status == 200 ) {
				if ( xmlHttp.responseText == 'mail_sent' ) {
					document.getElementById("frm_support").action = "demo-bedankt.php";
					document.getElementById("frm_support").submit();
				} else {
					document.getElementById("frm_button_div").innerHTML = xmlHttp.responseText;
				}
			}
		}
	}
	
	//Check Support Form.
	function submit_newsletter_values() {
	
		//Haal de waarden van de velden op
		get_naam = document.getElementById("frm_naam").value;
		get_industry = document.getElementById("frm_industry").value;
		get_function = document.getElementById("frm_function").value;
		get_spamcode = document.getElementById("frm_spamcode").value;
	
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = outputCheck_submit_newsletter_values;
		xmlHttp.open("GET","ajax/ajax_submit_newsletter_values.php?spamcode=" + get_spamcode + "&name=" + get_naam + "&industry=" + get_industry + "&function=" + get_function, true);
		xmlHttp.send(null);
	}
	
	function outputCheck_submit_newsletter_values() {
		if ( xmlHttp.readyState == 4 ) {
			if ( xmlHttp.status == 200 ) {
				document.getElementById("frm_button_div").innerHTML = xmlHttp.responseText;
			}
		}
	}

	function check_demo_form() {
		get_company = document.getElementById("frm_company").value;
		get_email = document.getElementById("frm_email").value;
		get_name = document.getElementById("frm_name").value;
		get_spamcode = document.getElementById("frm_spamcode").value;

		params = "company=" + get_company + "&email=" + get_email + "&name=" + get_name + "&spamcode=" + get_spamcode; 

		createXMLHttpRequest();

		xmlHttp.open("POST","ajax/ajax_check_demo_form.php", true);
		xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

		xmlHttp.onreadystatechange = function() {
			if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
				document.getElementById("frm_button_div").innerHTML = xmlHttp.responseText;
			}
		}
		xmlHttp.send(params);
	}