var xmlHttp

window.onload = function () 
{
	form();
}

function form()
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="form.php"
	xmlHttp.onreadystatechange=getstatechange 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function sendinfo(){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="form.php"
	
	url += "?naam=" + document.contact.naam.value;
	url += "&code=" + document.contact.code.value;
	url += "&email=" + document.contact.email.value;
	url += "&telefoon=" + document.contact.telefoon.value;
	url += "&opmerkingen=" + document.contact.opmerkingen.value;
	url += "&action=" + document.contact.action.value;
	xmlHttp.onreadystatechange=getstatechange 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function getstatechange() 
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById('daform').innerHTML = xmlHttp.responseText;
		document.getElementById('daform').style.display = 'block';
 	}
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
	 	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function klik (did) 
{
	if (document.getElementById(did).style.display == 'none')
		toggle (did,'display','show');
	else
		toggle (did,'display','hide');
}


function toggle (layer,kind,task) 
{
    if (kind == "visibility")
    {
    	if (task == "hide")
			vis_to = "hidden";
		else if (task == "show")
			vis_to = "visible";
		else 
		{
			if (document.layers)
				vis_to = (document.layers[layer].visibility == "hide") ? "show" : "hide";
			else if (document.all)
				vis_to = (document.all[layer].style.visibility == "hidden") ? "visible" : "hidden";
			else if (document.getElementById)
				vis_to = (document.getElementById(layer).style.visibility == "hidden") ? "visible" : "hidden";
		}
    } 
    else if (kind == "display")
    {
		if (task == "hide")
			dis_to = "none";
		else if (task == "show")
			dis_to = "block";
		else 
		{
			if (document.layers)
				dis_to = (document.layers[layer].display == "none") ? "block" : "none";
            else if (document.all)
				dis_to = (document.all[layer].style.display == "none") ? "block" : "none";
			else if (document.getElementById)
				dis_to = (document.getElementById(layer).style.display == "none") ? "block" : "none";
        }
    }
    if (document.layers)
		(kind == "display") ? document.layers[layer].display = dis_to : document.layers[layer].visibility = vis_to;
	else if (document.all)
		(kind == "display") ? document.all[layer].style.display = dis_to : document.all[layer].style.visibility = vis_to;
	else if (document.getElementById)
		(kind == "display") ? document.getElementById(layer).style.display = dis_to : document.getElementById(layer).style.visibility = vis_to;
}