// 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=700,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;


// ga naar juiste zoekpagina
function herlaadZoek(loc)
{
	window.location.href=loc;
}


// check of het emailadres wel juist is opgebouwd
function echeck(str)
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1)
	{
		alert("Vul alsjeblieft een GELDIG emailadres in.")
		return false
	}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Vul alstublieft een GELDIG emailadres in.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Vul alstublieft een GELDIG emailadres in.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Vul alstublieft een GELDIG emailadres in.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Vul alstublieft een GELDIG emailadres in.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Vul alstublieft een GELDIG emailadres in.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Vul alstublieft een GELDIG emailadres in.")
		    return false
		 }

	return true					
}


// registreren check
function registratie(form)
{
	if (form.emailadres.value == "E-mail adres") 
  	{
    	alert( "Vul alsjeblieft je emailadres in." );
    	form.emailadres.focus();
    	return false ;
  	}
	if (echeck(form.emailadres.value)==false)
	{
		form.emailadres.focus()
		return false ;
	}
	
	if (form.wachtwoord1.value == "Wachtwoord") 
  	{
    	alert( "Vul alsjeblieft je wachtwoord in." );
    	form.wachtwoord1.focus();
    	return false ;
  	}
	
	if (form.wachtwoord2.value == "Herhaal wachtwoord") 
  	{
    	alert( "Vul alsjeblieft je wachtwoord in." );
    	form.wachtwoord2.focus();
    	return false ;
  	}
	
	if (form.voornaam.value == "") 
  	{
    	alert( "Vul alsjeblieft je voornaam in." );
    	form.voornaam.focus();
    	return false ;
  	}
	
	if (form.achternaam.value == "") 
  	{
    	alert( "Vul alsjeblieft je achternaam in." );
    	form.achternaam.focus();
    	return false ;
  	}
	
	if (form.maand.value == "00") 
  	{
    	alert( "Vul alsjeblieft je geboortemaand in." );
    	form.maand.focus();
    	return false ;
  	}
	
	if (form.jaar.value == "0000") 
  	{
    	alert( "Vul alsjeblieft je geboortejaar in." );
    	form.jaar.focus();
    	return false ;
  	}
	
	if (form.land.value == "") 
  	{
    	alert( "Vul alsjeblieft je land in." );
    	form.land.focus();
    	return false ;
  	}
	
		if (form.intern[0].checked || form.intern[1].checked) 
		{
			if (form.internyear.value == "") 
			{
				alert( "Vul alsjeblieft je stage jaar in." );
				form.internyear.focus();
				return false ;
			}
			
			if (form.interncountry.value == "") 
			{
				alert( "Vul alsjeblieft je stage land in." );
				form.interncountry.focus();
				return false ;
			}
			
			if (form.interncompany.value == "") 
			{
				alert( "Vul alsjeblieft je stage bedrijf in." );
				form.interncompany.focus();
				return false ;
			}
			
			if (form.internwebsite.value == "") 
			{
				alert( "Vul alsjeblieft je stage website in." );
				form.internwebsite.focus();
				return false ;
			}
		}
		
		if (form.ondernemer.checked) 
		{
			if (form.branche_on.value == "") 
			{
				alert( "Vul alsjeblieft je branche in." );
				form.branche_on.focus();
				return false ;
			}
			
			if (form.functiegeb_on.value == "") 
			{
				alert( "Vul alsjeblieft je branche in." );
				form.functiegeb_on.focus();
				return false ;
			}
			
			if (form.functiegroep_on.value == "") 
			{
				alert( "Vul alsjeblieft je functie groep in." );
				form.functiegroep_on.focus();
				return false ;
			}
			
			if (form.organisatie_on.value == "") 
			{
				alert( "Vul alsjeblieft je organisatie in." );
				form.organisatie_on.focus();
				return false ;
			}
			
			if (form.functie_on.value == "") 
			{
				alert( "Vul alsjeblieft je functie in." );
				form.functie_on.focus();
				return false ;
			}
		}
		
		if (form.professional.checked) 
		{
			if (form.branche_pro.value == "") 
			{
				alert( "Vul alsjeblieft je branche in." );
				form.branche_pro.focus();
				return false ;
			}
			
			if (form.functiegeb_pro.value == "") 
			{
				alert( "Vul alsjeblieft je branche in." );
				form.functiegeb_pro.focus();
				return false ;
			}
			
			if (form.functiegroep_pro.value == "") 
			{
				alert( "Vul alsjeblieft je functie groep in." );
				form.functiegroep_pro.focus();
				return false ;
			}
			
			if (form.organisatie_pro.value == "") 
			{
				alert( "Vul alsjeblieft je organisatie in." );
				form.organisatie_pro.focus();
				return false ;
			}
			
			if (form.functie_pro.value == "") 
			{
				alert( "Vul alsjeblieft je functie in." );
				form.functie_pro.focus();
				return false ;
			}
		}
		
		if (form.freelancer.checked) 
		{
			if (form.branche_free.value == "") 
			{
				alert( "Vul alsjeblieft je branche in." );
				form.branche_pro.focus();
				return false ;
			}
			
			if (form.functiegeb_free.value == "") 
			{
				alert( "Vul alsjeblieft je branche in." );
				form.functiegeb_pro.focus();
				return false ;
			}
			
			if (form.functiegroep_free.value == "") 
			{
				alert( "Vul alsjeblieft je functie groep in." );
				form.functiegroep_free.focus();
				return false ;
			}
			
			if (form.organisatie_free.value == "") 
			{
				alert( "Vul alsjeblieft je organisatie in." );
				form.organisatie_pro.focus();
				return false ;
			}
			
			if (form.functie_free.value == "") 
			{
				alert( "Vul alsjeblieft je functie in." );
				form.functie_pro.focus();
				return false ;
			}
		}
		
		if (form.student.checked) 
		{
			if (form.studiegroep_stu.value == "") 
			{
				alert( "Vul alsjeblieft je studie groep in." );
				form.studiegroep_stu.focus();
				return false ;
			}
			
			if (form.studierichting_stu.value == "") 
			{
				alert( "Vul alsjeblieft je studie richting in." );
				form.studierichting_stu.focus();
				return false ;
			}
			
			if (form.studietype_stu.value == "") 
			{
				alert( "Vul alsjeblieft je studie type in." );
				form.studietype_stu.focus();
				return false ;
			}
			
			if (form.studiefase_prostu.value == "") 
			{
				alert( "Vul alsjeblieft je studie fase in." );
				form.studiefase_prostu.focus();
				return false ;
			}
			
			if (form.instituut_stu.value == "") 
			{
				alert( "Vul alsjeblieft je school/instituut in." );
				form.instituut_stu.focus();
				return false ;
			}
			
			if (form.studienaam_stu.value == "") 
			{
				alert( "Vul alsjeblieft je studienaam in." );
				form.studienaam_stu.focus();
				return false ;
			}
		}
		
		if (form.prostudent.checked) 
		{
			if (form.studiegroep_prostu.value == "") 
			{
				alert( "Vul alsjeblieft je studie groep in." );
				form.studiegroep_prostu.focus();
				return false ;
			}
			
			if (form.studierichting_prostu.value == "") 
			{
				alert( "Vul alsjeblieft je studie richting in." );
				form.studierichting_prostu.focus();
				return false ;
			}
			
			if (form.studietype_prostu.value == "") 
			{
				alert( "Vul alsjeblieft je studie type in." );
				form.studietype_prostu.focus();
				return false ;
			}
			
			if (form.studiefase_prostu.value == "") 
			{
				alert( "Vul alsjeblieft je studie fase in." );
				form.studiefase_prostu.focus();
				return false ;
			}
			
			if (form.instituut_prostu.value == "") 
			{
				alert( "Vul alsjeblieft je school/instituut in." );
				form.instituut_prostu.focus();
				return false ;
			}
			
			if (form.studienaam_prostu.value == "") 
			{
				alert( "Vul alsjeblieft je studienaam in." );
				form.studienaam_prostu.focus();
				return false ;
			}
			
			if (form.eerstestudie_prostu.value == "") 
			{
				alert( "Vul alsjeblieft je eerste studie in." );
				form.eerstestudie_prostu.focus();
				return false ;
			}
		}
	
	if (form.ondernemer.checked == false && form.professional.checked == false && form.freelancer.checked == false && form.student.checked == false 
		&& form.prostudent.checked == false) 
	{
		alert ('Je kan je alleen aanmelden als je minimaal 1 profiel invult!');
		return false;
	}
	
	
	if (form.voorwaarden.checked == false) 
	{
		alert ('Je kan je alleen aanmelden als je onze voorwaarden hebt gelezen en met de voorwaarden instemt!');
		return false;
	}
	
  	return true ;
}


// slide in/uit registreren
var heightnow;
var targetheight;
var block;
var slideinterval;
var divheights = new Array();

var inertiabase = 1;
var inertiainc = 1;
var slideintervalinc = 50;
var inertiabaseoriginal = inertiabase;

window.onload = function()
{
	var useragent = navigator.userAgent.toLowerCase();
	var ie = ((useragent.indexOf('msie') != -1) && (useragent.indexOf('opera') == -1) && (useragent.indexOf('webtv') == -1));
	var divs = getElementsByClassName(document, "div", "uitklapblok");

	for(var i=0; i<divs.length; i++)
	{
		var baseheight = (ie) ? divs[i].offsetHeight + "px" : document.defaultView.getComputedStyle(divs[i], null).getPropertyValue('height', null);

		divs[i].style.display = "none";

		var d = new div();
		d.el = divs[i];
		d.ht = baseheight.substring(0, baseheight.indexOf("p"));

		divheights[i] = d;		
	}
}

function div(_el, _ht)
{
	this.el = _el;
	this.ht = _ht;
}

function toggle(t)
{
	inertiabase = inertiabaseoriginal;
	clearInterval(slideinterval);

	block = t.parentNode.nextSibling;
	if(block.className == undefined)
		block = t.parentNode.nextSibling.nextSibling;

	if(block.style.display == "none")
	{
		t.innerHTML = "Ondernemer";
		block.style.display = "block";
		block.style.height = "10px";
		targetheight = divheight(block);
		heightnow = 1;
		slideinterval = setInterval(slideout, slideintervalinc);
	}
	else
	{
		t.innerHTML = "";
		targetheight = 1;
		heightnow = divheight(block);
		slideinterval = setInterval(slidein, slideintervalinc);
	}
}

function toggle2(t)
{
	inertiabase = inertiabaseoriginal;
	clearInterval(slideinterval);

	block = t.parentNode.nextSibling;
	if(block.className == undefined)
		block = t.parentNode.nextSibling.nextSibling;

	if(block.style.display == "none")
	{
		t.innerHTML = "Employee";
		block.style.display = "block";
		block.style.height = "10px";
		targetheight = divheight(block);
		heightnow = 1;
		slideinterval = setInterval(slideout, slideintervalinc);
	}
	else
	{
		t.innerHTML = "";
		targetheight = 1;
		heightnow = divheight(block);
		slideinterval = setInterval(slidein, slideintervalinc);
	}
}

function toggle3(t)
{
	inertiabase = inertiabaseoriginal;
	clearInterval(slideinterval);

	block = t.parentNode.nextSibling;
	if(block.className == undefined)
		block = t.parentNode.nextSibling.nextSibling;

	if(block.style.display == "none")
	{
		t.innerHTML = "Student";
		block.style.display = "block";
		block.style.height = "10px";
		targetheight = divheight(block);
		heightnow = 1;
		slideinterval = setInterval(slideout, slideintervalinc);
	}
	else
	{
		t.innerHTML = "";
		targetheight = 1;
		heightnow = divheight(block);
		slideinterval = setInterval(slidein, slideintervalinc);
	}
}

function toggle4(t)
{
	inertiabase = inertiabaseoriginal;
	clearInterval(slideinterval);

	block = t.parentNode.nextSibling;
	if(block.className == undefined)
		block = t.parentNode.nextSibling.nextSibling;

	if(block.style.display == "none")
	{
		t.innerHTML = "Pro-student";
		block.style.display = "block";
		block.style.height = "10px";
		targetheight = divheight(block);
		heightnow = 1;
		slideinterval = setInterval(slideout, slideintervalinc);
	}
	else
	{
		t.innerHTML = "";
		targetheight = 1;
		heightnow = divheight(block);
		slideinterval = setInterval(slidein, slideintervalinc);
	}
}

function toggle5(t)
{
	inertiabase = inertiabaseoriginal;
	clearInterval(slideinterval);

	block = t.parentNode.nextSibling;
	if(block.className == undefined)
		block = t.parentNode.nextSibling.nextSibling;

	if(block.style.display == "none")
	{
		t.innerHTML = "Freelancer";
		block.style.display = "block";
		block.style.height = "10px";
		targetheight = divheight(block);
		heightnow = 1;
		slideinterval = setInterval(slideout, slideintervalinc);
	}
	else
	{
		t.innerHTML = "";
		targetheight = 1;
		heightnow = divheight(block);
		slideinterval = setInterval(slidein, slideintervalinc);
	}
}

function toggle6(t)
{
	inertiabase = inertiabaseoriginal;
	clearInterval(slideinterval);

	block = t.parentNode.nextSibling;
	if(block.className == undefined)
		block = t.parentNode.nextSibling.nextSibling;

	if(block.style.display == "none")
	{
		t.innerHTML = "View Apura World Map";
		block.style.display = "block";
		block.style.height = "10px";
		targetheight = divheight(block);
		heightnow = 1;
		slideinterval = setInterval(slideout, slideintervalinc);
	}
	else
	{
		t.innerHTML = "";
		targetheight = 1;
		heightnow = divheight(block);
		slideinterval = setInterval(slidein, slideintervalinc);
	}
}


function toggle7(t)
{
	inertiabase = inertiabaseoriginal;
	clearInterval(slideinterval);

	block = t.parentNode.nextSibling;
	if(block.className == undefined)
		block = t.parentNode.nextSibling.nextSibling;

	if(block.style.display == "none")
	{
		t.innerHTML = "Stage profiel invullen";
		block.style.display = "block";
		block.style.height = "10px";
		targetheight = divheight(block);
		heightnow = 1;
		slideinterval = setInterval(slideout, slideintervalinc);
	}
	else
	{
		t.innerHTML = "";
		targetheight = 1;
		heightnow = divheight(block);
		slideinterval = setInterval(slidein, slideintervalinc);
	}
}


function slidein()
{
		clearInterval(slideinterval);
		block.style.display = "none";		
}

function slideout()
{
	if(heightnow < targetheight)
	{
		heightnow += inertiabase;
		inertiabase += inertiainc;
		block.style.height = (heightnow < targetheight) ? heightnow + "px" : targetheight + "px";
	}
	else
	{
		clearInterval(slideinterval);
		block.style.height = targetheight + "px";
	}
}

function divheight(d)
{
	for(var i=0; i<divheights.length; i++)
	{
		if(divheights[i].el == d)
		{
			return divheights[i].ht;
		}
	}
}

function getElementsByClassName(oElm, strTagName, strClassName)
{
    var arrElements = (strTagName == "*" && document.all) ? document.all : oElm.getElementsByTagName(strTagName);
    
	var arrReturnElements = new Array();

    strClassName = strClassName.replace(/\-/g, "\\-");

    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;

    for(var i=0; i<arrElements.length; i++)
	{
        oElement = arrElements[i];
		
        if(oRegExp.test(oElement.className))
		{
            arrReturnElements.push(oElement);
        }   
    }
	
    return (arrReturnElements)
}


function sack(file) {
	this.xmlhttp = null;

	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};

	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};

	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		// prevents caching of URLString
		this.setVar("rndval", new Date().getTime());

		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}

			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}

				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;
						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}

							self.URLString = "";
							break;
					}
				};

				this.xmlhttp.send(this.URLString);
			}
		}
	};

	this.reset();
	this.createAJAX();
}


/* dropdown menu's registreren */
function DoCallback(data)
{
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange;
		req.open('POST', url, 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 = processReqChange;
			req.open('POST', url, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function processReqChange() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			eval(what);
		} else {
			alert('There was a problem retrieving the XML data:\n' +
				req.responseText);
		}
	}
}



function DoCallback2(data)
{
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange2;
		req.open('POST', url, 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 = processReqChange2;
			req.open('POST', url, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function processReqChange2() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			eval(what2);
		} else {
			alert('There was a problem retrieving the XML data:\n' +
				req.responseText);
		}
	}
}


function DoCallback3(data)
{
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange3;
		req.open('POST', url2, 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 = processReqChange3;
			req.open('POST', url2, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function processReqChange3() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			eval(what3);
		} else {
			alert('There was a problem retrieving the XML data:\n' +
				req.responseText);
		}
	}
}

function DoCallback4(data)
{
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange4;
		req.open('POST', url2, 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 = processReqChange4;
			req.open('POST', url2, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function processReqChange4() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			eval(what4);
		} else {
			alert('There was a problem retrieving the XML data:\n' +
				req.responseText);
		}
	}
}

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 DoCallback9(data)
{
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange9;
		req.open('POST', url, 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 = processReqChange9;
			req.open('POST', url, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
	}
}

function processReqChange9() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			eval(what9);
		} else {
			alert('There was a problem retrieving the XML data:\n' +
				req.responseText);
		}
	}
}