function getXMLHttp() {
	var xmlHttp

	try {
		//Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
		//Internet Explorer
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!")
				return false;
			}
		}
	}
	return xmlHttp;
}

function inloggen() {
	var xmlHttp = getXMLHttp();
	var naam = document.getElementById('inlognaam').value;
	var password = document.getElementById('password').value;
	HandleResponse('');
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
			HandleResponse(xmlHttp.responseText);
			document.location = document.location;
		}
	}
	xmlHttp.open("GET", "/local/inloggen.php?inlognaam="+naam+"&password="+password, true);
	xmlHttp.send(null);
}

function uitloggen() {
	var xmlHttp = getXMLHttp();

	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
			HandleResponse(xmlHttp.responseText);
			document.location = document.location;
		}
	}
	xmlHttp.open("GET", "/local/inloggen.php?actie=uitloggen", true);
	xmlHttp.send(null);
}

function inlog() {
//	var xmlHttp = getXMLHttp();
//
//	xmlHttp.onreadystatechange = function() {
//		if (xmlHttp.readyState == 4) {
//			HandleResponse(xmlHttp.responseText);
//		}
//	}
//	xmlHttp.open("GET", "/local/inloggen.php", true);
//	xmlHttp.send(null);
}

function HandleResponse(response) {
	document.getElementById('inloggen').innerHTML = response;
}
function faqshowHide(id,image){
	if(document.getElementById(id)){
		
		if(document.getElementById(id).style.display=='none'){
			document.getElementById(id).style.display='block';
			if(document.getElementById(image)){
				document.getElementById(image).src='images/uitklappijl2up.jpg';
			}
		} else {
			document.getElementById(id).style.display='none';
			if(document.getElementById(image)){
				document.getElementById(image).src='images/uitklappijl2.jpg';
			}
		}
	}
}

function UnCheckAll (check_form,boxId) {	
	var form = document.getElementById(check_form);
	for (var i =0; i < form.elements.length; i++) 
	{
		form.elements[i].checked = false;
	}
	
	var box = document.getElementById(boxId);
	box.checked = true;
}

function UnCheckBox(boxId){
	var box = document.getElementById(boxId);
	box.checked = false;
}
