﻿
function ajax(str,inout)
{

		if (document.getElementById("username").value == "") {
		alert('U moet uw gebruikersnaam invoeren !');
		return;
	}
		if (document.getElementById("userpwd").value == "") {
		alert('U moet uw paswoord invoeren !');
		return;
	}

var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}

xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById('login').innerHTML=xmlHttp.responseText;
		}
	}
	var username = document.getElementById("username").value;
	var userpwd = document.getElementById("userpwd").value;
	var blijf = document.getElementById("blijf").checked;
	var log = inout;
	var url=str;
	url=url+"?nm="+username+"&pw="+userpwd+"&blijf="+blijf+"&log="+log;
	url=url+"&sid="+Math.random();
		xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function ajax3(str,where,pagnaam)
{
if (str == "leeg"){document.getElementById(where).innerHTML="&nbsp;";return;}
var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}

xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		//document.getElementById(where).innerHTML=xmlHttp.responseText;
		pageTracker._trackPageview(pagnaam);
		var out = document.getElementById(where);
		
if (out) {
  out.innerHTML = "";
 var HTMLFragment = document.createElement('div');
  HTMLFragment.id = 'dyn001';
  HTMLFragment.innerHTML = xmlHttp.responseText;
  $('#login').dialog('close');$('#begroeting').load('/head.asp #begroeting p');
  out.appendChild(HTMLFragment);
} 

		}
	}
	var url=str;
	url=url+"&sid="+Math.random();
		xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function ajaxNieuwLid(str,b)
{
var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}

xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById('test').innerHTML=xmlHttp.responseText;
		}
	}
	var url="VCL_nieuwlid.asp";
	url=url+"?b="+b+"&i="+str;
	url=url+"&sid="+Math.random();
		xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function ajaxToonCat(str,c)
{
var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}

xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById('cat').innerHTML=xmlHttp.responseText;
		}
	}
	var url="VCL_categorie.asp";
	url=url+"?c="+c+"&"+str;
	url=url+"&sid="+Math.random();
		xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function ajaxToonGeg(str,b)
{
var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}

xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById('test').innerHTML=xmlHttp.responseText;
		}
	}
	var url="VCL_bewerklid.asp";
	url=url+"?b="+b+"&i="+str;
	url=url+"&sid="+Math.random();
		xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function ajaxBewerkGeg(str,b,link)
{
if (b == "save") {

	if (document.getElementById("Licentienr").value == "") {
		alert('U moet het licentienummer invoeren !');
		return;
	}
	if (document.getElementById("Geboortedatum").value == "") {
		alert('U moet de geboortedatum invoeren !');
		return;
	}
	if (document.getElementById("Lidsinds").value == "") {
		alert('U moet Lid sinds invoeren !');
		return;
	}
}
if (str == "0"){str = document.getElementById("Licentienr").value;}

var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}

xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById('test').innerHTML=xmlHttp.responseText;
		}
	}
	var naam = document.getElementById("Naam").value;
	var voornaam = document.getElementById("Voornaam").value;
	var licentienr = document.getElementById("Licentienr").value;
	var adres = document.getElementById("Adres").value;
	var huisnr = document.getElementById("Huisnr").value;
	var postcode = document.getElementById("Postcode").value;
	var categorie = document.getElementById("Categorie").value;
	var rugnummer = document.getElementById("Rugnummer").value;
	var geboortedatum = document.getElementById("Geboortedatum").value;
	var lidsinds = document.getElementById("Lidsinds").value;
	var telefoon = document.getElementById("Telefoon").value;
	var gsm = document.getElementById("GSM").value;
	var email = document.getElementById("Email").value;
	var FBuid = document.getElementById("FBuid").value;
	var Fotourl = encodeURIComponent(document.getElementById("Fotourl").value);
	var url=link;
	url=url+"?b="+b+"&i="+str;
	url=url+"&naam="+naam+"&voornaam="+voornaam+"&licentienr="+licentienr+"&adres="+adres+"&postcode="+postcode;
	url=url+"&categorie="+categorie+"&rugnummer="+rugnummer+"&geboortedatum="+geboortedatum+"&lidsinds="+lidsinds+"&telefoon="+telefoon;
	url=url+"&gsm="+gsm+"&email="+email+"&huisnr="+huisnr+"&FBuid="+FBuid+"&Fotourl="+Fotourl;
	url=url+"&sid="+Math.random();

		xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function ajaxBewerkVers(str,where)
{

var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}
	xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById(where).innerHTML=xmlHttp.responseText;
		}
		
	}
	

	var titel = encodeURIComponent(document.getElementById("titel").value);
	var titelkort = encodeURIComponent(document.getElementById("titelkort").value);
	var auteur = document.getElementById("auteur").value;
	var verslag = encodeURIComponent(document.getElementById("verslag").value);
	var datum = document.getElementById("datum").value;
	var ID = document.getElementById("ID").value;
	var url = str;
	var params = "titel="+titel+"&titelkort="+titelkort+"&auteur="+auteur+"&verslag="+verslag+"&datum="+datum+"&ID="+ID;
	xmlHttp.open("POST", str, 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 ajaxVeranderpw(str,where)
{
	if (document.getElementById("nieuwpwd").value != document.getElementById("nieuwpwd2").value) {
		alert('U moet twee maal hetzelfde wachtwoord invoeren !');
		return;
	}


var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}

xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById(where).innerHTML=xmlHttp.responseText;
		}
	}
	var oudpwd = document.getElementById("oudpwd").value;
	var nieuwpwd = document.getElementById("nieuwpwd").value;
	var hiddenww = document.getElementById("hiddenww").value;
	var i = document.getElementById("i").value;
	var url=str;
	url=url+"?oudpwd="+oudpwd+"&i="+i;
	url=url+"&nieuwpwd="+nieuwpwd+"&hiddenww="+hiddenww;
	url=url+"&sid="+Math.random();
		xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function ajaxUpdateInfo(str,where)
{

var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}

xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById(where).innerHTML=xmlHttp.responseText;
		}
	}
	var voornaam = document.getElementById("voornaam").value;
	var omschrijving = encodeURIComponent(document.getElementById("omschrijving").value);
	var grootte = document.getElementById("grootte").value;
	var positie = document.getElementById("positie").value;
	var mail = encodeURIComponent(document.getElementById("mail").value);
	var naam = encodeURIComponent(document.getElementById("naam").value);
	var fotourl = encodeURIComponent(document.getElementById("fotourl").value);
	var Nick = document.getElementById("Nick").value;
	var url = str;
	var params = "voornaam="+voornaam+"&omschrijving="+omschrijving+"&grootte="+grootte+"&positie="+positie+"&mail="+mail+"&naam="+naam+"&fotourl="+fotourl+"&Nick="+Nick;
	xmlHttp.open("POST", str, 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 ajaxBewerkAct(str,where)
{

var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}
	xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById(where).innerHTML=xmlHttp.responseText;
		}
		
	}

	var naam = encodeURIComponent(document.getElementById("naam").value);
	var info = encodeURIComponent(document.getElementById("info").value);
	var datum = document.getElementById("datum").value;
	var ID = document.getElementById("ID").value;
	var url = str;
	var params = "naam="+naam+"&info="+info+"&datum="+datum+"&ID="+ID;
	xmlHttp.open("POST", str, 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 ajaxGB(str,where)
{
	if (document.getElementById("naam").value == "") {
		alert('U moet een naam invoeren ! Wanneer u inlogt, hoeft u uw naam niet in te typen.');
		return false;
	}


var xmlHttp;
try
	{
	//Firefox
	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	// IE
	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;
	}
	}
	}
	xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
		{
		document.getElementById(where).innerHTML=xmlHttp.responseText;
		}
		
	}

	var naam = encodeURIComponent(document.getElementById("naam").value);
	var bericht = encodeURIComponent(document.getElementById("bericht").value);
	var email = encodeURIComponent(document.getElementById("email").value);
	var datum = document.getElementById("datum").value;
	var licentienr = document.getElementById("licentienr").value;
	var url = str;
	var params = "naam="+naam+"&email="+email+"&bericht="+bericht+"&datum="+datum+"&licentienr="+licentienr;
	xmlHttp.open("POST", str, 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);
}
