var xmlHttp;
var inhoudverzoek="";
var welkomverzoek="";
var welkomsubverzoek="";
var contactverzoek="";
var xmlHttp4;

function startlabel(){
	wijzigdiv()
	startverzoek1('Labelen.xml','Labelen','','Labelmaandag.xml')
	}	

function startlidworden(){
	wijzigdiv()
	startverzoek1('Lidworden.xml','Lidworden','','Contributie.xml')
	}

function startvrijwilliger(){
	wijzigdiv()
	startverzoek1('vrijwilliger.xml','','','vrijwilliger2.xml')
	}

function startefair(){
	wijzigdiv()
	startverzoek1('efair.xml','','','efair2.xml')
	}

function startopen(){
	wijzigdiv()
	startverzoek1('opentoernooi.xml','Open Toernooi','','Openleiding.xml')
	}

function startplus(){
	wijzigdiv()
	startverzoek1('50plustoernooi.xml','','','niets.xml')
	}

function startclub(){
	wijzigdiv()	
	startverzoek1('clubkampioenschappen.xml','Clubkampioenschappen','','clubkampioenschappen2.xml')
	}

function startouderkind(){
	wijzigdiv()
	startverzoek1('ouderkind.xml','','','niets.xml')
	}

function startladies(){
	wijzigdiv()
	startverzoek1('ladiesdaygewoon.xml','','','niets.xml')
	}

function startechtpaar(){
	wijzigdiv()
	startverzoek1('echtparen.xml','','','niets.xml')
	}

function startnajaar(){
	wijzigdiv()
	startverzoek1('Najaarscompetitie.xml','','','niets.xml')
	}

function createXMLHttpRequest() {
    if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
}
    
function startverzoek1(inhoudxml,inhoudwelkom,inhoudwelkomsub,inhoudcontact) {
	inhoudverzoek=inhoudxml
	welkomverzoek=inhoudwelkom
	contactverzoek=inhoudcontact
	welkomsubverzoek=inhoudwelkomsub
	createXMLHttpRequest();
    xmlHttp.onreadystatechange = handleStateChange3;
    xmlHttp.open("GET", inhoudverzoek , true);
    xmlHttp.send(null);
        
}

function handleStateChange3() {
    if(xmlHttp.readyState == 4) {
        if(xmlHttp.status == 200) {
            document.getElementById("Inhoud1").innerHTML = xmlHttp.responseText;
            document.getElementById("Inhoud2").innerHTML = "<h3>"+welkomverzoek+"</h3>"+welkomsubverzoek;
			startRequest4();
        }
    }
}



function createXMLHttpRequest4() {
    if (window.ActiveXObject) {
        xmlHttp4 = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp4 = new XMLHttpRequest();
    }
}
    
function startRequest4() {
	createXMLHttpRequest4();
    xmlHttp4.onreadystatechange = handleStateChange4;
    xmlHttp4.open("GET", contactverzoek , true);
    xmlHttp4.send(null);
       
}
function handleStateChange4() {
    if(xmlHttp4.readyState == 4) {
        if(xmlHttp4.status == 200) {
            document.getElementById("Inhoud2").innerHTML = xmlHttp4.responseText;
         }
    }
}
function createXMLHttpRequest4() {
    if (window.ActiveXObject) {
        xmlHttp4 = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp4 = new XMLHttpRequest();
    }
}
    
function Loadjiba(bron){ 
		var objFrame=document.getElementById("iafhangbord"); 
		//objFrame.src="http://tv77107.afhangbord.nl/content/html/513.asp?ov_id=112";
		objFrame.src=bron
		//document.getElementById("Link").style.display = "";
		//document.getElementById("Cam").style.display = "none";
		wijzig('Link','Visible')
		wijzig('pagina','Hidden')
		wijzig('Inhoud2','Hidden')
		wijzig('Cam','Hidden')
		}
	function Loadcam(bron){ 
		var objFrame=document.getElementById("icam"); 
		//objFrame.src="http://tv77107.afhangbord.nl/content/html/513.asp?ov_id=112";
		objFrame.src=bron
		//document.getElementById("Cam").style.display = "";
		//document.getElementById("Link").style.display = "none";
		wijzig('Cam','Visible')
		wijzig('pagina','Hidden');
		wijzig('Inhoud2','Hidden');
		} 

function wijzigdiv()  {
		wijzig('pagina','Visible')
		wijzig('Link','Hidden')
		wijzig('Cam','Hidden')
		wijzig('contact','Hidden')
		wijzig('inschrijventitel','Hidden')
		wijzig('Inschrijven','Hidden')
		wijzig('Uitslagentitel','Hidden')
		wijzig('Inhoud1','Visible')
		wijzig('Inhoud2','Visible')
		wijzig('Nieuws','Hidden')
		document.getElementById("inieuws").style.display = "none";

		}
