// open popup voor myapura
function Venster(URL)
{
	venster = window.open(URL, 'popupvenster', 'width=720,height=730,resizable=no,menubar=no,scrollbars=1,status=no,toolbar=no');
}

// open popup voor profiel
function Venster2(URL)
{
	venster = window.open(URL, 'popupvenster2', 'width=720,height=730,resizable=no,menubar=no,scrollbars=1,status=no,toolbar=no');
}


//
function ExplorerFix() 
{ 
	for (a in document.links) document.links[a].onfocus = document.links[a].blur; 
} 
	if (document.all) document.onmousedown = ExplorerFix;


function clearText(thefield)
{
	var bla = thefield.value;
	var bla2 = bla.substr(0,7);
	if(bla2 == "Schrijf")
	{
		thefield.value = "";
	}
}


var url5 = "ajax_zoekindex.php";
var what5 = "SetFunctie5(req.responseText)";

function GetFunctiegebied5(Functie5)
{
	DoCallback5("zoekberoep="+Functie5);
}

function SetFunctie5(Functiegeb5)
{
	var functieBox5 = document.getElementById("zoekbranche");
	
	functieBox5.options.length = 0;

if(Functiegeb5 != "")
{
	var arrFunctie5 = Functiegeb5.split("_");
					
	for(i = 0; i < arrFunctie5.length; i++)
	{
		if(arrFunctie5[i] != "")
		{
			var arrFunctie6 = arrFunctie5[i].split("|");
			functieBox5.options[functieBox5.options.length] = new Option(arrFunctie6[1], arrFunctie6[0]);
		}
	}
}
}

var url6 = "ajax_zoekindex2.php";
var what6 = "SetFunctie6(req.responseText)";

function GetFunctiegebied6(Functie6)
{
	DoCallback6("zoekbranche="+Functie6);
}

function SetFunctie6(Functiegeb6)
{
	var functieBox6 = document.getElementById("zoekdiscipline");
	
	functieBox6.options.length = 0;

if(Functiegeb6 != "")
{
	var arrFunctie6 = Functiegeb6.split("_");

	for(i = 0; i < arrFunctie6.length; i++)
	{
		if(arrFunctie6[i] != "")
		{
			var arrFunctie7 = arrFunctie6[i].split("|");
			functieBox6.options[functieBox6.options.length] = new Option(arrFunctie7[1], arrFunctie7[0]);
		}
	}
}
}


var url7 = "ajax_zoekindex3.php";
var what7 = "SetFunctie7(req.responseText)";

function GetFunctiegebied7(Functie7)
{
	DoCallback7("zoekdiscipline="+Functie7);
}

function SetFunctie7(Functiegeb7)
{
	var functieBox7 = document.getElementById("list1");
	
	functieBox7.options.length = 0;

if(Functiegeb7 != "")
{
	var arrFunctie7 = Functiegeb7.split("_");

	for(i = 0; i < arrFunctie7.length; i++)
	{
		if(arrFunctie7[i] != "")
		{
			var arrFunctie8 = arrFunctie7[i].split("|");
			functieBox7.options[functieBox7.options.length] = new Option(arrFunctie8[1], arrFunctie8[0]);
		}
	}
}
}

function DoCallback5(data)
{
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange5;
		req.open('POST', url5, true);
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		req.send(data);
	} else if (window.ActiveXObject) {
		req = new ActiveXObject('Microsoft.XMLHTTP')
		if (req) {
			req.onreadystatechange = processReqChange5;
			req.open('POST', url5, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function processReqChange5() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			eval(what5);
		} else {
			alert('There was a problem retrieving the XML data:\n' +
				req.responseText);
		}
	}
}


function DoCallback6(data)
{
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange6;
		req.open('POST', url6, true);
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		req.send(data);
	} else if (window.ActiveXObject) {
		req = new ActiveXObject('Microsoft.XMLHTTP')
		if (req) {
			req.onreadystatechange = processReqChange6;
			req.open('POST', url6, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function processReqChange6() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			eval(what6);
		} else {
			alert('There was a problem retrieving the XML data:\n' +
				req.responseText);
		}
	}
}


function DoCallback7(data)
{
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange7;
		req.open('POST', url7, true);
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		req.send(data);
	} else if (window.ActiveXObject) {
		req = new ActiveXObject('Microsoft.XMLHTTP')
		if (req) {
			req.onreadystatechange = processReqChange7;
			req.open('POST', url7, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function processReqChange7() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			eval(what7);
		} else {
			alert('There was a problem retrieving the XML data:\n' +
				req.responseText);
		}
	}
}


function createQCObject() { 
   var req; 
   if(window.XMLHttpRequest){ 
      // Firefox, Safari, Opera... 
      req = new XMLHttpRequest(); 
   } else if(window.ActiveXObject) { 
      // Internet Explorer 5+ 
      req = new ActiveXObject("Microsoft.XMLHTTP"); 
   } else { 
      alert('Problem creating the XMLHttpRequest object'); 
   } 
   return req; 
} 

// Make the XMLHttpRequest object 
var http = createQCObject(); 

function displayQCalendar(m) {
	var ran_no=(Math.round((Math.random()*9999)));
	var mofy = m.split(",");
	http.open('get', 'mskalender.php?m='+mofy[0]+'&y='+mofy[1]+'&sector='+mofy[2]+'&topic='+mofy[3]+'&ran='+ran_no);
   	http.onreadystatechange = function() {
		if(http.readyState == 4 && http.status == 200) { 
      		var response = http.responseText;
      		if(response) { 
				document.getElementById("quickCalender").innerHTML = http.responseText; 
      		} 
   		} 
	} 
   	http.send(null); 
}