function build_agenda(theURL) { //v2.0
  // bepaal nu het centrum
  var twin;
  
 
  features='scrollbars=yes,toolbars=no,status=no';
  
  w = 700;
  h = 400;

  mleft = (screen.width - w) / 2;
 	 mtop = (screen.height - h) / 2;

    features = features + ',top=' + mtop + ',left=' + mleft + ',width=' + w + ',height=' + h ;

 
 
  twin = window.open(theURL,"build_news",features);
  twin.focus();
}

function read_agenda(theURL) { //v2.0
  // bepaal nu het centrum
  var twin;
  
 
  features='scrollbars=yes,toolbars=no,status=no';
  
  w = 700;
  h = 400;

  mleft = (screen.width - w) / 2;
 	 mtop = (screen.height - h) / 2;

    features = features + ',top=' + mtop + ',left=' + mleft + ',width=' + w + ',height=' + h ;

 
 
  twin = window.open(theURL,"read_agenda",features);
  twin.focus();
}

function opnemen_in_agenda(theURL) { //v2.0
  // bepaal nu het centrum
  var twin;
  
 
  features='scrollbars=yes,toolbars=no,status=no';
  
  w = 400;
  h = 200;

  mleft = (screen.width - w) / 2;
 	 mtop = (screen.height - h) / 2;

    features = features + ',top=' + mtop + ',left=' + mleft + ',width=' + w + ',height=' + h ;

 
 
  twin = window.open(theURL,"opnemen_in_agenda",features);
  twin.focus();
}

function valAgenda()
{
	error = "";
	if ( document.forms["frmAgenda"].title.value == "")
	{
		error = error + "- de naam is nog niet ingevoerd\r";
		
	}
	
	if ( document.forms["frmAgenda"].description.value == "")
	{
		error = error + "- de beschrijving is nog niet ingevoerd\r";
		
	}
	
	var day, month, year;
	day = document.forms["frmAgenda"].startday.value
	month = document.forms["frmAgenda"].startmonth.value
	year = document.forms["frmAgenda"].startyear.value
	
	var today = new Date();
	
	var fillDate=new Date();
	fillDate.setFullYear(year,month-1,day) ;
	
	if (fillDate < today)
	{
		error = error + "- de datum ligt in het verleden";
	}

	
	if (error == "")
	{
		document.forms["frmAgenda"].submit();
	}
	else
	{
		error = "Het agendapunt is niet opgeslagen:\r" + error;
		alert(error);
	}
}
