// JavaScript Document
var xmlHttp;

// standaard maken van Instance van de  XMLHttpRequest Object
function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} 
	else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}

// GET BLOKKEN #1
function getBlok(str) {
	var ran_number = Math.random()*5; 
	var url="include/get_data.php?blokid=" + str
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = getBlokInvoeren;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
// GET BLOKKEN #2
function getBlokInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("blokken").innerHTML = "<div class=blok2>Bezig met laden...</div>";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("blokken").innerHTML = xmlHttp.responseText;
		}
	}
}

// GET INHOUD #1
function getInhoud(str) {
	var ran_number = Math.random()*5; 
	var url="include/get_data.php?inhoudid=" + str
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = getInhoudInvoeren;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
// GET INHOUD #2
function getInhoudInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("inhoudcontainer").innerHTML = "<div class=middenInhoud>Bezig met laden...</div>";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("inhoudcontainer").innerHTML = xmlHttp.responseText;
		}
	}
}

// GET ZOEKWOORDEN #1
function getZoekwoorden(str) {
	var ran_number = Math.random()*5; 
	var url="include/get_data.php?zoekwoord=" + str
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = getZoekwoordenInvoeren;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
// GET ZOEKWOORDEN #2
function getZoekwoordenInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("zoekresultaat").innerHTML = "";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("zoekresultaat").innerHTML = xmlHttp.responseText;
		}
	}
}

// GET ZOEKUITLEG #1
function getZoekuitleg(str) {
	var ran_number = Math.random()*5; 
	var url="include/get_data.php?zoekid=" + str 
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = getZoekuitlegInvoeren;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
// GET ZOEKUITLEG #2
function getZoekuitlegInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("zoekresultaat").innerHTML = "Bezig met laden...";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("zoekresultaat").innerHTML = xmlHttp.responseText;
		}
	}
}
// GET PORTFOLIO #1
function getPortfolio(str) {

		var ran_number = Math.random()*5; 
		var url="include/get_data.php?portfolioid=" + str
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = getPortfolioInvoeren;
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);

}
// GET PORTFOLIO #2
function getPortfolioInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("portfolioplaatje").innerHTML = "Bezig met laden...";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("portfolioplaatje").innerHTML = xmlHttp.responseText;
		}
	}
}

// GET PORTFOLIOTEKST #1
function getPortfolioTekst(str) {
	var ran_number = Math.random()*5; 
	var url="include/get_data.php?portfoliotekstid=" + str
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = getPortfolioTekstInvoeren;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
// GET PORTFOLIOTEKST #2
function getPortfolioTekstInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("portfoliotekst").innerHTML = "Bezig met laden...";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("portfoliotekst").innerHTML = xmlHttp.responseText;
		}
	}
}

// POPUP laten zien bij portfolio

function ShowPop(id) {
	document.getElementById(id).style.visibility = "visible";
	}
	function HidePop(id)
	{
	document.getElementById(id).style.visibility = "hidden";
}

// GET ALLEEN INHOUD #1
function getAlleenInhoud(str) {
	var ran_number = Math.random()*5; 
	var url="include/get_data.php?getAlleenInhoudid=" + str 
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = getAlleenInhoudInvoeren;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
// GET ALLEEN INHOUD #2
function getAlleenInhoudInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("inhoudcontainer").innerHTML = "<div class=middenInhoud>Bezig met laden...</div>";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("inhoudcontainer").innerHTML = xmlHttp.responseText;
		}
	}
}


// GET CIJFERLIJST #1
function getCijferlijst(str) {
	var ran_number = Math.random()*5; 
	var url="include/get_data.php?getCijferlijstid=" + str + "&noCache=" + ran_number
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = getCijferlijstInvoeren;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
// GET CIJFERLIJST #2
function getCijferlijstInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("cijferlijst").innerHTML = "Bezig met laden..";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("cijferlijst").innerHTML = xmlHttp.responseText;
		}
	}
}

// getBerichten #1
function getBerichten(str) {
	var ran_number = Math.random()*5; 
	var url="include/get_data.php?getBerichten=" + str + "&noCache=" + ran_number
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = getBerichtenInvoeren;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}
// getBerichten #2
function getBerichtenInvoeren() {
	if(xmlHttp.readyState < 4) {
	document.getElementById("toonBerichten").innerHTML = "Bezig met laden..";
	} 
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200) {
			document.getElementById("toonBerichten").innerHTML = xmlHttp.responseText;
		}
	}
}

