function checkInlog(){
	if(!document.inlog.debnr.value){
		alert('Vul een geldige gebruikersnaam in...');
		document.inlog.debnr.focus();
		}
	else if(!document.inlog.wachtwoord.value){
		alert('Vul een geldig wachtwoord in...');
		document.inlog.wachtwoord.focus();
	}
	else{
		if(document.getElementById("onthouden").checked==true){
			createCookie("mijnleesmapplaza","1",365);
			createCookie("mijnleesmapplaza1",document.inlog.debnr.value,365);
			createCookie("mijnleesmapplaza2",document.inlog.wachtwoord.value,365);
		}else{
			eraseCookie("mijnleesmapplaza");
			eraseCookie("mijnleesmapplaza1");
			eraseCookie("mijnleesmapplaza2");
		}
		document.getElementById('bgwait').style.display = 'block';
		document.inlog.submit();
	}
}

function logOut(){
	if(confirm('Wilt u uitloggen?')){
		location.href="/default.asp?act=out";	
	}
}
var activeSub;

function showSub(num){
	document.getElementById('sub_'+num).style.display = 'block';
	if(!isNaN(activeSub)){
		document.getElementById('sub_'+activeSub).style.display = 'none';
	}
	activeSub = num;
}

function createCookie(name,value,days){
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function getGegevens(){
	var onth = ""+readCookie("mijnleesmapplaza");
	var un = ""+readCookie("mijnleesmapplaza1");
	var uw = ""+readCookie("mijnleesmapplaza2");
	if(onth=='1'){
		document.getElementById("onthouden").checked = "true";
	}
	if(un!='null'){
		document.getElementById("debnr").value = un;
	}
	if(uw!='null'){
		document.getElementById("wachtwoord").value = uw;
	}
}
