var xmlHttp

function get(id)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="get.php";
	url=url+"?id="+id;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getnieuws(id, from)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="get.php";
	url=url+"?id="+id+"&from="+from;
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function logIn()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="login.php";
	var params = 'loginnaam='+document.getElementById("login").value+'&passwd='+document.getElementById("passwd").value;
	params=params+'&code='+document.getElementById("code").value;
	xmlHttp.onreadystatechange=stateChanged;
	content.innerHTML='<img src="pleasewait.gif">';
	xmlHttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	xmlHttp.send(params);
}

function meldAan()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="aanmeld.php";
	var params = 'naam='+document.getElementById("naam").value+'&pseudoniem='+document.getElementById("pseudoniem").value;
	params=params+'&login='+document.getElementById("login").value;
	params=params+'&email='+document.getElementById("email").value+'&code='+document.getElementById("code").value;
	xmlHttp.onreadystatechange=stateChanged;
	content.innerHTML='<img src="pleasewait.gif">';
	xmlHttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	xmlHttp.send(params);
}

function forgotpwd()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="send_pwd.php";
	var params = 'email='+document.getElementById("email").value+'&code='+document.getElementById("code").value;
	xmlHttp.onreadystatechange=stateChanged;
	content.innerHTML='<img src="pleasewait.gif">';
	xmlHttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	xmlHttp.send(params);
}


function showFotos()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="fotos.php";
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function showFotos60()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="fotoos.php";
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function showThumbs(id)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="getthumbs.php";
	url=url+"?id="+id;
	xmlHttp.onreadystatechange=stateThumbsChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function showAgenda(y,m,d)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="getagenda.php";
	url=url+"?jaar="+y+"&maand="+m+"&dag="+d;
	//alert(url);
	xmlHttp.onreadystatechange=stateAgendaChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function showNieuws()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="getnieuws.php";
	xmlHttp.onreadystatechange=stateAgendaChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function showContent(id)
{ 
	//alert(id);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="getcontent.php";
	url=url+"?id="+id;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	//xmlHttp.setRequestHeader("Content-Type", "text/html; charset=windows-1252");
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(null);
}

function showGastenboek()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="gastenboek.php";
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	//xmlHttp.setRequestHeader("Content-Type", "text/html; charset=windows-1252");
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(null);
}

function postGastenboek()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="gastenboek.php";
	var params = 'naam='+document.getElementById("naam").value+'&email='+document.getElementById("email").value;
	params=params+'&code='+document.getElementById("code").value+'&dwpmsg='+document.getElementById("dwpmsg").value;
	xmlHttp.onreadystatechange=stateChanged;
	content.innerHTML='<img src="pleasewait.gif">';
	xmlHttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	xmlHttp.send(params);
}


function showStuurlui()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	alert ("Your browser does not support AJAX!");
	return;
	}
	document.getElementById('content').innerHTML='<img src="pleasewait.gif">'; 
	var url="stuurlui.php";
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	//xmlHttp.setRequestHeader("Content-Type", "text/html; charset=windows-1252");
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(null);
}

function postStuurlui()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="stuurlui.php";
	var params = 'naam='+document.getElementById("naam").value+'&email='+document.getElementById("email").value;
	params=params+'&code='+document.getElementById("code").value+'&title='+document.getElementById("title").value+'&dwpmsg='+document.getElementById("dwpmsg").value;
	xmlHttp.onreadystatechange=stateChanged;
	content.innerHTML='<img src="pleasewait.gif">';
	xmlHttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	xmlHttp.send(params);
}

function postOliebol()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="oliebollen.php";
	var params = 'naam='+document.getElementById("naam").value;
	params=params+'&adres='+document.getElementById("adres").value;
	params=params+'&plaats='+document.getElementById("plaats").value;
	params=params+'&telefoon='+document.getElementById("telefoon").value;
	params=params+'&email='+document.getElementById("email").value;
	params=params+'&oliebol='+document.getElementById("oliebol").value;
	params=params+'&krentenbol='+document.getElementById("krentenbol").value;
	if (document.getElementById("ochtend").value=='on') {
		params=params+'&wanneer=ochtend';
	}
	else {
			params=params+'&wanneer=middag';
	}

	params=params+'&code='+document.getElementById("code").value;
	params=params+'&bestel='+document.getElementById("bestel").value;
	
	xmlHttp.onreadystatechange=stateChanged;
	content.innerHTML='<img src="pleasewait.gif">';
	xmlHttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	xmlHttp.send(params);
}

function showVoetbalnoord(id)
{ 
	content.innerHTML='<iframe src="voetbalnoord.php?id='+id+'" frameborder="0" marginheight="0" marginwidth="0" style="width: 800px; height: 400px"></iframe>';
}
function stateThumbsChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		//alert(xmlHttp.responseText);
		document.getElementById('content').innerHTML=xmlHttp.responseText;
	}
}


function stateAgendaChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		//alert(xmlHttp.responseText);
		document.getElementById('content').innerHTML=xmlHttp.responseText;
	}
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		//alert(xmlHttp.responseText);
		document.getElementById('content').innerHTML=xmlHttp.responseText;
	}
}

function stateUpdated()
{
	if (xmlHttp.readyState==4)
	{ 
		alert(xmlHttp.responseText);
	}
}

function getAlbum(albumid)
{
  xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
	return;
	} 
	var url="fotoalbum.php";
	var params="albumid="+albumid;
	xmlHttp.onreadystatechange=stateAlbumChanged;
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(params);			  
}

function getlaatsteAlbum(albumid)
{
  xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
	return;
	} 
	var url="laatste_fotoalbum.php";
	var params="albumid="+albumid;
	xmlHttp.onreadystatechange=stateAlbumChanged;
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(params);			  
}
function stateAlbumChanged()
{
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById('div_album').innerHTML=xmlHttp.responseText;
	}
}

function offLine()
{
  xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
	return;
	} 
	var url="offline.php";
	xmlHttp.open("GET",url,false); //niet asynchroon voor FireFox
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(null);	  
}


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;
}

