var documentRoot="overzichten/puntenSporters/";
var standType=2;
var id=0
var menWomen_id=0;

window.onload=bijladen;

function bijladen() {
	voegToeBuffer("neemBody", "body.php");
}

function neemBody() {
	if (xmlHttp.readyState!=4 && xmlHttp.readyState!="complete") return false;
	document.getElementById("inhoudBody").innerHTML=xmlHttp.responseText;
	verwijderBuffer("neemBody");
	laadStand();
}

function selGeslacht() {
	for (var i=0; i<document.frm.geslachtsel.length; i++) {
		if (document.frm.geslachtsel.options[i].selected) break;
	}
	menWomen_id=document.frm.geslachtsel.options[i].value;
	laadStand();
}

function selAfstand() {
	for (var i=0; i<document.frm.afstandsel.length; i++) {
		if (document.frm.afstandsel.options[i].selected) break;
	}
	id=document.frm.afstandsel.options[i].value;
	standType=2;
	document.frm.wedstrijdsel.options[0].selected=true;
	laadStand();
}

function selWedstrijd() {
	for (var i=0; i<document.frm.wedstrijdsel.length; i++) {
		if (document.frm.wedstrijdsel.options[i].selected) break;
	}
	id=document.frm.wedstrijdsel.options[i].value;
	if ( document.frm.wedstrijdsel.options[i].value != 0 ) {
		standType=3;
	}
	document.frm.afstandsel.options[0].selected=true;
	laadStand();
}

function laadStand() {
	var parameters=new Array("standType="+standType, "id="+id, "menWomen_id="+menWomen_id);
	//alert("standType="+standType+" id="+id+" menWomen_id="+menWomen_id)
	document.getElementById("overzichtHeren").innerHTML="gegevens worden geladen...";
	voegToeBuffer("neemStand","stand.php", parameters);
}

function neemStand() {
	if (xmlHttp.readyState!=4 && xmlHttp.readyState!="complete") return false;
	var stand=xmlHttp.responseText;
	document.getElementById("overzichtHeren").innerHTML=stand;
	verwijderBuffer("neemStand");
}


function schrijfOverzicht(melding) {
	document.getElementById("overzichtHeren").innerHTML=melding;
}


function toonBuffer() {
}

function geefFeedbackFunction(feedback, xmlHttp) {
	if (bufferToDo[0]['feedback']=="neemBody") xmlHttp.onreadystatechange=neemBody;
	if (bufferToDo[0]['feedback']=="neemStand") xmlHttp.onreadystatechange=neemStand;
}
	