var xmlHttp;
var xmlHttp1;

function preloadImages(){
	if( document.images ){
		if( !document.imageArray )
			document.imageArray = new Array();
		var i;
		var j = document.imageArray.length;
		var args = preloadImages.arguments;
		for( i=0; i < args.length; i++){
			if( args[i].indexOf("#") != 0 ){
				document.imageArray[j] = new Image;
				document.imageArray[j++].src = args[i];
			}
		}
	}
}

function changeImg( img ){
	var image = document.getElementById("news_img");
	image.src = img;
}

//function showPage( page ){
//	
//	xmlHttp = GetXmlHttpObject();
//	xmlHttp1 = GetXmlHttpObject();
//	
//	if( xmlHttp == null ){
//		alert( "Your browser does not support AJAX!" );
//		return;
//	}
//	
//	if( page == null ){
//		page = "home";
//	}else if( page == "admin" ){
//		page = "mod/admin";
//	}
//	
//	bread( page );
//	
//	var url = page.split("?",2)[0] + ".php";
//	url += "?";
//	url += page.split("?",2)[1];
//	xmlHttp.onreadystatechange = stateChangedcontent;
//	xmlHttp.open( "GET", url, true );
//	xmlHttp.send( null );
//	var url1 = "submenu.php";
//	url1 += "?pagina=" + page.split("?",2)[0];
//	if( getSubSection( page.split("?",2)[0] ) != null )
//		url1 += "&ss=" + getSubSection( page.split("?",2)[0] );
//	if( getSubSubSection( page.split("?",2)[0] ) != null )
//		url1 += "&sss=" + getSubSubSection( page.split("?",2)[0] );
//	if( getSubSubSubSection( page.split("?",2)[0] ) != null )
//		url1 += "&ssss=" + getSubSubSubSection( page.split("?",2)[0] );
//	xmlHttp1.onreadystatechange = stateChangedcontent1;
//	xmlHttp1.open( "GET", url1, true );
//	xmlHttp1.send( null );
//}
//
//function stateChangedcontent(){
//	if( xmlHttp.readyState == 4 ){
//		document.getElementById( "content" ).innerHTML = xmlHttp.responseText;
//	}
//}
//
//function stateChangedcontent1(){
//	if( xmlHttp1.readyState == 4 ){
//		document.getElementById( "submenu" ).innerHTML = xmlHttp1.responseText;
//	}
//}
//
//function processForm(){
//	xmlHttp = GetXmlHttpObject();
//	
//	if( xmlHttp == null ){
//		alert( "Your browser does not support AJAX!" );
//		return;
//	}
//	
//	var naam = document.getElementById("naam");
//	var voornaam = document.getElementById("voornaam");
//	var email = document.getElementById("mail");
//	var bericht = document.getElementById("bericht");
//	var actie = document.getElementById("actie");
//	
//	xmlHttp.open("POST","contact.php",true);
//	xmlHttp.onreadystatechange = handleServerResponse;
//	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
//	xmlHttp.send("naam=" + naam.value + "&voornaam=" + voornaam.value + "&email=" + email.value + "&bericht=" + bericht.value + "&actie=" + actie.value);
//}
//
//function handleServerResponse(){
//	if( xmlHttp.readyState == 4 ){
//		if( xmlHttp.status == 200 ){
//			document.getElementById("contactform").innerHTML = xmlHttp.responseText;
//			document.getElementById("contactform").className = "msg";
//		}else{
//			document.getElementById("contactform").innerHTML = "Error";
//			document.getElementById("contactform").className = "alert";
//		}
//	}
//}
//
//function gb_new(){
//	xmlHttp = GetXmlHttpObject();
//	
//	if( xmlHttp == null ){
//		alert( "Your browser does not support AJAX!" );
//		return;
//	}
//	
//	var naam = document.getElementById("naam");
//	var email = document.getElementById("email");
//	var bericht = document.getElementById("bericht");
//	var code = document.getElementById("code");
//	var adres = document.getElementById("adres");
//	
//	xmlHttp.open("POST","gastenboek.php",true);
//	xmlHttp.onreadystatechange = handleServerResponse2;
//	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
//	xmlHttp.send("naam=" + naam.value + "&email=" + email.value + "&bericht=" + bericht.value + "&code=" + code.value + "&adres=" + adres.value);
//}
//
//function handleServerResponse2(){
//	if( xmlHttp.readyState == 4 ){
//		if( xmlHttp.status == 200 ){
//			document.getElementById("gb_nieuw_bericht").innerHTML = xmlHttp.responseText;
//			document.getElementById("gb_nieuw_bericht").className = "";
//		}else{
//			document.getElementById("gb_nieuw_bericht").innerHTML = "Error";
//			document.getElementById("gb_nieuw_bericht").className = "alert";
//		}
//	}
//}
//
//function log_in(){
//	xmlHttp = GetXmlHttpObject();
//	
//	if( xmlHttp == null ){
//		alert( "Your browser does not support AJAX!" );
//		return;
//	}
//	
//	var gebruiker = document.getElementById("gebruiker");
//	var wachtwoord = document.getElementById("wachtwoord");
//	
//	xmlHttp.open("POST","mod/admin.php",true);
//	xmlHttp.onreadystatechange = handleServerResponseLogin;
//	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
//	xmlHttp.send("gebruiker=" + gebruiker.value + "&wachtwoord=" + wachtwoord.value);
//}
//
//function handleServerResponseLogin(){
//	if( xmlHttp.readyState == 4 ){
//		if( xmlHttp.status == 200 ){
//			document.getElementById("adminlogin").innerHTML = xmlHttp.responseText;
//			document.getElementById("adminlogin").className = "";
//			showPage("mod/adminhome");
//		}else{
//			document.getElementById("adminlogin").innerHTML = "Error";
//			document.getElementById("adminlogin").className = "alert";
//		}
//	}
//}
//
//function breadcumbs( page ){
//	page = page.split( "?", 1 );
//
//	var breadcumb;
//	if( secties[page][0] != null ){
//		breadcumb = secties[page][0];
//	}
//	if( secties[page][1] != null ){
//		breadcumb += " &#8250; ";
//		breadcumb += secties[page][1];
//	}
//	if( secties[page][2] != null ){
//		breadcumb += " &#8250; ";
//		breadcumb += secties[page][2];
//	}
//	if( secties[page][3] != null ){
//		breadcumb += " &#8250; ";
//		breadcumb += secties[page][3];
//	}
//	
//	return breadcumb;
//}
//
//function bread( page ){
//	document.getElementById( "bread" ).innerHTML = breadcumbs( page );
//}
//
//function addtext(textcode){
//	document.getElementById("bericht").value += textcode;
//	document.getElementById("bericht").focus();
//}	
//
//function GetXmlHttpObject(){
//	var xmlHttp = null;
//	try{
//		// Firefox, Opera 8.0+, Safari
//		xmlHttp = new XMLHttpRequest();
//	}catch( e ){
//		// Internet Explorer
//		try{
//			xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP" );
//		}catch( e ){
//			xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
//		}
//	}
//	return xmlHttp;
//}
