
var ajax103 = new Array();
var i103 = 0;
var status103 = new Array();
var max103 = 4; 
function http103() {
	try { ajax103[i103]=new XMLHttpRequest(); }
	catch (e) {
		try { ajax103[i103]=new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) {
			try { ajax103[i103]=new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) { alert("Your browser does not support AJAX!"); }
		}
	}
}
function inhoudverwerken() {
	for (var i=0; i < status103.length; i++) {
		if (status103[i] == 0) {
			if (ajax103[i].readyState == 4) {
				status103[i] = 1;
				if(ajax103[i].status == 200) {
					scrollTo(0,0);
					for (p=0;p<ajax103[i].responseXML.getElementsByTagName("printplaats").length;p++) {
						printplaats = ajax103[i].responseXML.getElementsByTagName("printplaats")[p].attributes.getNamedItem("divid").value;
						if (document.getElementById(printplaats)) document.getElementById(printplaats).innerHTML = ajax103[i].responseXML.getElementsByTagName("printplaats")[p].childNodes[0].nodeValue;
					}
					for (j=0;j<ajax103[i].responseXML.getElementsByTagName("javascript").length;j++) {
						eval(ajax103[i].responseXML.getElementsByTagName("javascript")[j].childNodes[0].nodeValue);
					}
				}
				else {
					alert(ajax103[i].status);
				}
			}
			else {//laden
			}
		}
	}
}
function str_replace(tekst, zoek, vervang) {
    var temp = tekst.split(zoek);
    return temp.join(vervang);
}
var onthoudlocatie = '';
function inhoudladen(url,variabelen) {
	status103[i103] = 0;
	if (url != 'inhoud/inschrijven.php' && url != 'inhoud/bevestigen.php' && url != 'inhoud/volgendefoto.php' && url != 'inhoud/volgendefotokader.php' && url != 'inhoud/taalkeuze.php') {
		onthoudlocatie = str_replace(str_replace(url,'inhoud/',''),'.php','');
		if (variabelen.length > 0)  onthoudlocatie += "/" + str_replace(str_replace(variabelen,'&','/'),'=','/');
		if (lt) window.location.hash = "#" + onthoudlocatie;
	}
	http103();
	ajax103[i103].open("POST", url, true);
	ajax103[i103].setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	ajax103[i103].setRequestHeader("Content-length", variabelen.length);
	ajax103[i103].onreadystatechange = inhoudverwerken;
	ajax103[i103].send(variabelen);
	i103 = (i103+1)%max103;
}
lt = false;
function doorsturen() {
	if (lt) clearTimeout(lt);
	var url = window.location;
	if(url.hash.length > 0 && onthoudlocatie != url.hash.substring(1)) {
		url = url.hash.substring(1);
		parameters = url.split('/');
		variabelen = '';
		for (p=1; p < parameters.length-1; p++) {
			variabelen += parameters[p]+"=";
			p++;
			variabelen += parameters[p];
		}
		inhoudladen('inhoud/'+parameters[0]+'.php',variabelen);
	}
	lt = setTimeout(doorsturen,103);
}

function zoekx(object) {
	var xpos = ypos = 0;
	if (object.offsetParent) {
		do {
			xpos += object.offsetLeft;
		} while (object = object.offsetParent);
	}
	return xpos;
}

function cursorplaats(div) {
	if (div == 'actief') {
		document.getElementById("cursor").style.left = zoekx(document.getElementById("cursoractief"))+"px";
		//document.getElementById("cursor").style.display = "none";
	}
	else {
		var xpos = zoekx(div);
		schuiven('cursor',xpos);
		document.getElementById("cursor").style.display = "block";
	}
}

function knopactief(div) {
	var xpos = zoekx(div);
	schuiven('cursoractief',xpos);
	document.getElementById("cursor").style.display = "none";
	var menuplaats = document.getElementById("knoppen");
	var menuitems = menuplaats.getElementsByTagName('div');
	for (m = 0; m < menuitems.length; m++) {
		if (menuitems[m] == div) {
			if (div.childNodes[0].src.indexOf('aan') == -1) div.childNodes[0].src = div.childNodes[0].src+'aan';
		}
		else menuitems[m].childNodes[0].src = str_replace(menuitems[m].childNodes[0].src,'aan','');
	}
}

var easing = new Array(1,1.05,1.15,1.3,1.5,1.9,2.45,3.1,3.95,5.2,6.7,8.5,10.75,13.7,16.9,22.6,27.7,33.35,39.8,48,55.8,63.6,69.75,75.6,80.05,83.9,87.4,90.15,92.4,94.25,95.85,97.1,98.6,99.1,99.45,99.7,99.85,100);

var schuifteller = new Array();
function schuiven(id,eindpunt){
	if (document.getElementById(id)) {
		startpunt = zoekx(document.getElementById(id));
		if(schuifteller[id]==-1 || !schuifteller[id]) schuifteller[id] = 0;
		if(schuifteller[id]<easing.length && startpunt != eindpunt) {
			if (startpunt < eindpunt) y = startpunt+((eindpunt-startpunt)*(easing[schuifteller[id]]/100));
			else y = startpunt-((startpunt-eindpunt)*(easing[schuifteller[id]]/100));
			if (document.getElementById(id)) document.getElementById(id).style.left = Math.round(y)+"px";
			setTimeout("schuiven('"+id+"','"+eindpunt+"')");
			schuifteller[id]++;
		}
		else {
			if (document.getElementById(id)) document.getElementById(id).style.left = eindpunt+"px";
			schuifteller[id]=-1;
		}
	}
}

function email(adres) {
	emailadres = adres.replace(/#/,"@");
	window.open("mailto:"+emailadres, "_self");
}

