function showmore(w,b){
	document.getElementById(w).style.display = 'block';
	document.getElementById(b).innerHTML = '<a href="#games" onclick="javascript:showless(\''+w+'\',\''+b+'\');"><img src="images/site/-.png" /></a>' ;
}
function showless(w,b){
	document.getElementById(w).style.display = 'none';
	document.getElementById(b).innerHTML = '<a href="#games" onclick="javascript:showmore(\''+w+'\',\''+b+'\');"><img src="images/site/+.png" /></a>' ;
}

//AJAX controler
function ajaxConnect(){
	var ajaxRequest;
	try{
		ajaxRequest = new XMLHttpRequest();		// Firefox
	} catch (e){
	 try{
		ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");		// Internet Explorer Browsers
	 } catch (e) {
	  try{
		ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (e){
		alert("Geen AJAX support op jouw webbrowser!");         // Tis verkeerd
		return false;
	  }
	 }
	}
	return ajaxRequest;
}
function foto(el){
	var ajaxRequest = ajaxConnect();
	ajaxRequest.open('get',+el,true);
	ajaxRequest.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2005 00:00:00 GMT");
	ajaxRequest.onreadystatechange=function() {
		if (ajaxRequest.readyState==4) {
	   		document.getElementById('img').innerHTML = ajaxRequest.responseText;
	  	}
	}
	ajaxRequest.send(null);
}
function popitup(url) {window.open(url,'name','scrollbars=yes, resizable=yes, location=0');}
function popimg(url) {window.open(url,'name','scrollbars=yes, resizable=yes');}
function link(url) {window.open(url);}
function TimStatus(message){window.status=message;}
function SetStatus(message){window.status=message;setTimeout('TimStatus("'+message+'")',1);}

//KLOKJE
function nulleke(a){
	if(a<10)
		return "0"+a;
	return a;
}
function klok(){
	var time = new Date();
	var d = nulleke(time.getDate());
	var m = nulleke(time.getMonth()+1);
	var y = nulleke(time.getFullYear());
	var h = nulleke(time.getHours());
	var i = nulleke(time.getMinutes());
	var s = nulleke(time.getSeconds());
	var string = d+"/"+m+"/"+y+" "+h+":"+i+":"+s ;
	document.getElementById('uur').innerHTML = string ;
	setTimeout("klok()",1000);
}

/*function mailIt(){
	var subject = "BCO-contact";
	var voornaam = document.getElementById('voornaam').value;
	var naam = document.getElementById('naam').value;
	var mail = document.getElementById('mail').value;
	var bericht = document.getElementById('bericht').value;
	var evaluatie = document.getElementById('evaluatie').value;
	var body ="Voornaam: "+voornaam+" <br/>
 	            Naam: "+naam+"<br/> 
 	            E-mail: "+email+" <br/>
 	            Bericht: "+bericht+" <br/>
 	            Evaluatie: "+evaluatie;
 	            
           window.location = "mailto:heughebaert_ts@hotmail.com?subject="+subject+"&body="+body;
	return true;
}*/

//REGISTRATIE controle
function check(){
	var username = document.getElementById('username').value;
	var pass1 = document.getElementById('pass2').value;
	var pass2 = document.getElementById('pass3').value;
	var mail = document.getElementById('mail').value;
	var naam = document.getElementById('naam').value;
	var vnaam = document.getElementById('vnaam').value;
	var adres = document.getElementById('adres').value;
	var plaats = document.getElementById('plaats').value;
	var gbdatum = document.getElementById('gbdatum').value;
	var output = "";
	if(username.length <= 3)
		output += "Gelieve een Usernaam in te vullen die langer is dan 3 tekens!\n";
	if(pass1.length <=5)
		output += "Gelieve een Wachtwoord te geven langer dan 5 tekens!\n";
	if(pass1 != pass2)
		output += "Wachtwoorden zijn niet gelijk, probeer opnieuw!\n";
	if(mail.length < 1)
		output += "Gelieve een E-mailadres in te vullen!\n";
	else if(!isgeldigemail(mail))
		output += "Gelieve een geldig E-mailadres in te vullen!\n";
	if(naam.length <= 2)
		output += "Gelieve een Naam in te vullen!\n";
	if(vnaam.length <= 2)
		output += "Gelieve een Voornaam in te vullen!\n";
	if(adres.length <= 5)
		output += "Gelieve een Adres in te vullen!\n";
	if(plaats.length <= 3)
		output += "Gelieve een Stad in te vullen!\n";
	if(gbdatum.length <= 7)
		output += "Gelieve een Geboorte Datum in te vullen!\n";
	if(output.length > 0){
		window.alert(output);
		return false;
	}
	return true;
}
function isgeldigemail(str){
	var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if(str.match(emailRegEx))
		return true;
	return false;
}
//SETTINGS Pagina
function settings_change(oChk){
	var disable = !oChk.checked;
	var arglen = arguments.length;
	var obj, startIndex = 1;
	var frm = oChk.form;
	for (var i=startIndex;i<arglen;i++){
	obj = frm.elements[arguments[i]];
	if (typeof obj=="object"){
		if (document.layers) {
			if (disable){
				obj.onfocus=new Function("this.blur()");
				if (obj.type=="text") obj.onchange=new Function("this.value=this.defaultValue");
			}else {
				obj.onfocus=new Function("return");
				if (obj.type=="text") obj.onchange=new Function("return");
			}
		}
		else obj.disabled=disable;
		}
	}
}
function golive(game){
	window.open("http://195.56.77.56/1024eng/enter.phtml?szkod=bel_"+game,"merka","width=1015,height=718,left=0,top=0");
}
function gostats(stats){
	window.open("http://www.basketleague.be/game/index.phtml?code="+stats+"&year=x0910&lea=bel","name","scrollbars=yes, resizable=yes");
}
function showhideMenu(id){
	var item = document.getElementByName(id);
	var button = 'l'+id;
	if (item.className=='hidden') {
		item.className='unhidden';
		afbeelding = eval ('expand' + "over.src");
		document[button].src = afbeelding;
	}else{
		item.className='hidden';
		afbeelding = eval ('expand' + ".src");
		document[button].src = afbeelding;
	}
}
function showhide(id){
	var item = document.getElementById(id);
	var button = 'l'+id;
	if (item.className=='hidden') {
		item.className='unhidden';
		afbeelding = eval ('expand' + "over.src");
		document[button].src = afbeelding;
	}else{
		item.className='hidden';
		afbeelding = eval ('expand' + ".src");
		document[button].src = afbeelding;
	}
}
function exitaffiche(){
	document.getElementById('reclameBox').innerHTML = "";
	document.getElementById('reclameBox').style.display = 'none';
//	window.open('affiche.jpg');
}
function zoomaffiche(pic){
alert(pic);
	var pic = get_affiche(pic);
	alert(pic);

	var el = document.getElementById('reclameBox');
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		var maxwidth = document.body.offsetWidth*0.75;
		var browserwidth = document.body.offsetWidth;
		var maxheight = document.body.offsetHeight;
	}else{
		var maxwidth = window.innerWidth*0.75;
		var browserwidth = window.innerWidth;
		var maxheight = window.innerHeight*1;
	}
	var img = new Image();
	img.src = pic ;
	var width=0,height=0;
	var tezetten="";
	if(img.width >= maxwidth){
		width = maxwidth ;
		tezetten = "width="+width;
	}else{
		width = img.width;
	}
	height = img.height ;
	var verhouding = (height / img.height);
	el.innerHTML = "<center style='color:white;'>Klik op de foto om te sluiten ...</center>";
	el.innerHTML += "<img src='"+pic+"' border='0' onClick='exitaffiche()' width="+maxwidth+" alt="+pic+">";
	
	el.style.width = (maxwidth+20)+'px';
	
	el.style.left = ((browserwidth-(maxwidth+20))/2)+'px';

	el.style.display = 'block';
}