function changeln() {
  document.formulier_login.loginnaam.style.backgroundImage='url(http://www.wisz.nl/diabeteslog/html/images/bg_input_wit.jpg)';
}
function changeww() {
  document.formulier_login.wachtwoord.style.backgroundImage='url(http://www.wisz.nl/diabeteslog/html/images/bg_input_wit.jpg)';
}

function getStyle( layer ) {
	if( document.getElementById ) {
		return document.getElementById( layer ).style
	} else if( document.all ) {
		return document.all[layer].style
	} else {
		return document[layer]
	}
}

function validate_email(field,alerttxt){
  with (field){
    apos=value.indexOf("@");
    dotpos=value.lastIndexOf(".");
    if (apos<1||dotpos-apos<2){
      alert(alerttxt);
      return false;
    } else {
     return true;
    }
  }
}

function focus_idww(obj){
  if ( obj.value == 'loginnaam' || obj.value == 'wachtwoord' ){ obj.value=''; } 
}

function blur_idww(obj,idww){
  if ( obj.value == '' ){
    if ( idww == 'id' ){  
      obj.value='loginnaam';
    } else {
      obj.value='wachtwoord';
    }
  } 
}

function doormailen(soort){
  if ( soort == 1 ){
    if ( document.f_stats_periode.mailaan[1].checked ){
      if ( validate_email(document.f_stats_periode.ander,"Geef een juist e-mailadres op...") ){
        document.f_stats_periode.doormailen.value=1;
        document.f_stats_periode.submit();
      }
    } else {
      document.f_stats_periode.doormailen.value=1;
      document.f_stats_periode.submit();
    }
  } else {
      if ( document.f_stats_periode.ander.value == "" ){
        alert("Geef een juist e-mailadres op...");
      } else {
        document.f_stats_periode.doormailen.value=1;
        document.f_stats_periode.submit();
      }
  }
}

function maildoor(){
  if ( document.f_stats_periode.ander.value != "" ){
    if ( validate_email(document.f_stats_periode.ander,"Geef een juist e-mailadres op...") ){
      document.f_stats_periode.doormailen.value=1;
      document.f_stats_periode.submit();
    }
  } else {
    document.f_stats_periode.doormailen.value=1;
    document.f_stats_periode.submit();
  }
}

function nav(vvv){
  document.f_stats_periode.vv.value=vvv;
  document.f_stats_periode.submit();
}

function switchview(){
  document.f_stats_periode.sv.value=1;
  document.f_stats_periode.submit();
}

function chg_periode(){
  rap_periode=document.getElementById('gt2').value;
  switch(rap_periode){
  case 'dag':
    document.getElementById('i_dag').style.visibility='visible';
    document.getElementById('i_dag').style.display='block';
    document.getElementById('totenmet').style.visibility='hidden';
    document.getElementById('totenmet').style.display='none';;
    break;    
  case 'week':
    document.getElementById('i_dag').style.visibility='visible';
    document.getElementById('i_dag').style.display='block';;
    document.getElementById('totenmet').style.visibility='hidden';
    document.getElementById('totenmet').style.display='none';;
    break;    
  case 'maand':
    document.getElementById('i_dag').style.visibility='hidden';
    document.getElementById('i_dag').style.display='none';
    document.getElementById('totenmet').style.visibility='hidden';
    document.getElementById('totenmet').style.display='none';
    break;    
  case 'periode':
    document.getElementById('i_dag').style.visibility='visible';
    document.getElementById('i_dag').style.display='block';
    document.getElementById('totenmet').style.visibility='visible';
    document.getElementById('totenmet').style.display='block';
    break;    
  }
}

function layer_aan(layer) {
	getStyle(layer).visibility = 'visible';
}

function layer_uit(layer) {
	getStyle(layer).visibility = 'hidden';
}

function select_aan(layer) {
	getStyle(layer).visibility = 'visible';
}

function select_aan2(layer){
	document.getElementById(layer).style.visibility = 'visible';	
}

function select_uit(layer) {
	getStyle(layer).visibility = 'hidden';
}

function selspec(status){
  switch(status){
    case 1:
      document.getElementById('formtype').value='1';
      break;    
    case 2:
      document.getElementById('formtype').value='2';
      break;    
    default:
      document.getElementById('formtype').value='';
  }
  document.registratie.submit();
}

function sendspec(){
  document.getElementById('versturen').value='1';
  document.registratie.submit();
}

function deletespec(scnr,spnaam){
  var yesno = confirm('Wilt de koppeling met specialist '+spnaam+' werkelijk verwijderen?\nOok alle onderlinge berichten worden verwijderd...','');
  if (yesno == true){
    document.getElementById('sc_id').value=scnr;
    document.getElementById('actie').value="deletespec";
    document.getElementById('versturen').value='1';
    document.registratie.submit();
  } else {
   return false;
  }
}

function delregspec(){
  var yesno = confirm('Weet u het zeker? Uw voorregistratie wordt dan verwijderd...','');
  if (yesno == true){
    document.getElementById('actie').value="delregspec";
    document.getElementById('versturen').value='1';
    document.registratie.submit();
  } else {
   return false;
  }
}

function chg_inzien(scnr,inzien){
  document.getElementById('chginzien').value=inzien;
  document.getElementById('sc_id').value=scnr;
  document.getElementById('actie').value='chg_inzien';
  document.getElementById('versturen').value='1';
  document.registratie.submit();
}

function askspec(scnr){
  var yesno = confirm('Wilt de koppeling met de specialist alsnog aanvragen?\nZo ja, dan wordt er een bevestigingsmail aan de specialist verstuurd...','');
  if (yesno == true){
    document.getElementById('sc_id').value=scnr;
    document.getElementById('actie').value='ask_spec';
    document.getElementById('versturen').value='1';
    document.registratie.submit();
  }
}

function delspec(){
  document.getElementById('gekozen_specialist').value='';
  document.getElementById('gekozen_specialist_txt').value='';
  selspec();
}

function chg_message_status(mid,st){
  document.getElementById('message_id').value=mid;
  document.getElementById('message_status').value=st;
  document.getElementById('actie').value="chg_message_status";
  document.getElementById('versturen').value="1";
  document.behandelaar.submit();
}

function send_new_message(){
  document.getElementById('actie').value="send_new_message";
  document.getElementById('versturen').value="1";
  document.behandelaar.submit();
}

function del_message(mid){
  document.getElementById('message_id').value=mid;
  document.getElementById('actie').value="del_message";
  document.getElementById('versturen').value="1";
  document.behandelaar.submit();
}

function new_message(){
  document.getElementById('nieuw_bericht').style.display='';
  document.getElementById('f_titel').focus();
	scroll(0,0);
}

function new_message_annuleer(){
  document.getElementById('f_titel').value="";
  document.getElementById('f_bericht').value="";
  document.getElementById('nieuw_bericht').style.display='none';
}

function send_new_item(){
  document.getElementById('actie').value="send_new_item";
  document.getElementById('versturen').value="1";
  document.behandelaar.submit();
}

function del_item(mid){
  document.getElementById('item_id').value=mid;
  document.getElementById('actie').value="del_item";
  document.getElementById('versturen').value="1";
  document.behandelaar.submit();
}

function new_item(){
  document.getElementById('nieuw_item').style.display='';
  document.getElementById('f_titel').focus();
	scroll(0,0);
}

function new_item_annuleer(){
  document.getElementById('f_titel').value="";
  document.getElementById('f_item').value="";
  document.getElementById('nieuw_item').style.display='none';
}

function toon_sp_overzicht(){
  document.getElementById('sp_overzicht').style.display='';
	scroll(0,0);
}

function annuleer_sp_overzicht(){
  document.getElementById('sp_overzicht').style.display='none';
}

function toon_delete_client(scnr,clientnaam){
  document.getElementById('id2_cnaam').innerHTML=clientnaam;
  document.getElementById('sc_id').value=scnr;
  document.getElementById('client_delete').style.display='';
	scroll(0,0);
}

function annuleer_delete_client(){
  document.getElementById('id2_cnaam').innerHTML='';
  document.getElementById('sc_id').value='';
  document.getElementById('f_bericht').value='';
  document.getElementById('client_delete').style.display='none';
}

function send_delete_client(){
  document.getElementById('client_delete').style.display='';
  //document.getElementById('f_opmerking').value=opmerking;
  document.getElementById('actie').value="deleteclient";
  document.getElementById('versturen').value="1";
  document.clienten.submit();
}

function sel_client(client,scnr){
  document.getElementById('gekozen_client').value=client;
  document.getElementById('gekozen_sc_id').value=scnr;
  document.clienten.action='behandelschema.php';
  document.clienten.submit();
}

function toon_client(client){
  document.getElementById('sc_id').value=client;
  document.clienten.action='client.php';
  document.clienten.submit();
}

function toon_dossier(){
  document.behandelaar.action='client_dossier.php';
  document.behandelaar.submit();
}

function toon_mijndossier(){
  document.registratie.action='dossier.php';
  document.registratie.submit();
}

function koppel_client(){
  if ( !document.getElementById('f_toestaan_ja').checked && !document.getElementById('f_toestaan_nee').checked ){
    alert("U moet wel een keuze maken...");
    return false;
  } else {
    document.getElementById('actie').value="koppelclient";
    document.clienten.submit();
  }
}

function toon_accept_client(scnr,clientnaam){
  document.getElementById('id_cnaam').innerHTML=clientnaam;
  document.getElementById('sc_id').value=scnr;
  document.getElementById('client_ok').style.display='';
	scroll(0,0);
}

function annuleer_accept_client(){
  document.getElementById('id_cnaam').innerHTML='';
  document.getElementById('sc_id').value='';
  document.getElementById('f_toestaan').value='';
  document.getElementById('f_opmerking').value='';
  document.getElementById('client_ok').style.display='none';
}

function send_accept_client(){
  document.getElementById('client_ok').style.display='';
  //document.getElementById('f_toestaan').value=toestaan;
  //document.getElementById('f_opmerking').value=opmerking;
  document.getElementById('actie').value="chg_message_status";
  document.getElementById('versturen').value="1";
  document.clienten.submit();
}

function bijzonder_aan(nr,ttl){
  verberg_select2();
	getStyle('invoer_bijzonder').visibility = 'visible';
  getStyle('i_ketonen').visibility = 'visible';
  document.getElementById('i_bijzonderheden_titel').innerHTML=ttl;
  document.getElementById('i_bijzonder').value=document.getElementById('i_bijzonder_'+nr).value;
  ketonenList=document.getElementById('i_ketonen');
  ketset=document.getElementById('ketwaarde_'+document.getElementById('i_ketonen_'+nr).value);
  ketset.selected = true;
  document.getElementById('bijznr').value=nr;
}

function bijzonder_uit(){
  toon_select();
  bnr=document.getElementById('bijznr').value;
  document.getElementById('i_bijzonder_'+bnr).value=document.getElementById('i_bijzonder').value;
  selIdx = document.getElementById('i_ketonen').selectedIndex;
  document.getElementById('i_ketonen_'+bnr).value=document.getElementById('i_ketonen').options[selIdx].text;
  var n=document.getElementById('btn_bijzonderheden_'+bnr);
  if( n ){ 
    if ( document.getElementById('i_bijzonder_'+bnr).value != "" || document.getElementById('i_ketonen_'+bnr).value != 0 ){
      n.className='groovy2';
    } else {
      n.className='groovy1'; 
    }
  }
  getStyle('i_ketonen').visibility = 'hidden';
	getStyle('invoer_bijzonder').visibility = 'hidden';
}

function bijzonder_annuleer(){
  toon_select();
  getStyle('i_ketonen').visibility = 'hidden';
	getStyle('invoer_bijzonder').visibility = 'hidden';
}

function bijzonder_aan2(nr,ttl){
  verberg_select2();
	getStyle('invoer_bijzonder').visibility = 'visible';
  getStyle('i_ketonen').visibility = 'visible';
  getStyle('i_bijzlijst').visibility = 'visible';
  document.getElementById('i_bijzonderheden_titel').innerHTML=ttl;
  document.getElementById('i_bijzonder').value=document.getElementById('i_bijzonder_'+nr).value;
  document.getElementById('i_bijzlijst').value=document.getElementById('i_bijzlijst_'+nr).value;
  document.getElementById('i_bijzduur').value=document.getElementById('i_bijzduur_'+nr).value;
  ketonenList=document.getElementById('i_ketonen');
  ketset=document.getElementById('ketwaarde_'+document.getElementById('i_ketonen_'+nr).value);
  ketset.selected = true;
  document.getElementById('bijznr').value=nr;
}

function bijzonder_uit2(){
  toon_select();
  bnr=document.getElementById('bijznr').value;
  document.getElementById('i_bijzonder_'+bnr).value=document.getElementById('i_bijzonder').value;
  document.getElementById('i_bijzlijst_'+bnr).value=document.getElementById('i_bijzlijst').value;
  document.getElementById('i_bijzduur_'+bnr).value=document.getElementById('i_bijzduur').value;
  selIdx = document.getElementById('i_ketonen').selectedIndex;
  document.getElementById('i_ketonen_'+bnr).value=document.getElementById('i_ketonen').options[selIdx].text;
  var n=document.getElementById('btn_bijzonderheden_'+bnr);
  if( n ){ 
    if ( document.getElementById('i_bijzonder_'+bnr).value != "" || document.getElementById('i_bijzlijst_'+bnr).value != "" || document.getElementById('i_bijzduur_'+bnr).value != "" || document.getElementById('i_ketonen_'+bnr).value != 0 ){
      n.className='groovy2';
    } else {
      n.className='groovy1'; 
    }
  }
  getStyle('i_ketonen').visibility = 'hidden';
  getStyle('i_bijzlijst').visibility = 'hidden';
  getStyle('i_actlijst').visibility = 'hidden';
	getStyle('invoer_bijzonder').visibility = 'hidden';
}

function bijzonder_annuleer2(){
  toon_select();
  getStyle('i_ketonen').visibility = 'hidden';
  getStyle('i_bijzlijst').visibility = 'hidden';
  getStyle('i_actlijst').visibility = 'hidden';
	getStyle('invoer_bijzonder').visibility = 'hidden';
}

function act_aan(nr,ttl){
  verberg_select2();
	getStyle('invoer_activiteiten').visibility = 'visible';
  document.getElementById('i_activiteiten_titel').innerHTML=ttl;
  document.getElementById('i_activiteiten').value=document.getElementById('i_activiteiten_'+nr).value;
  document.getElementById('actnr').value=nr;
}

function act_uit(){
  toon_select();
  bnr=document.getElementById('actnr').value;
  document.getElementById('i_activiteiten_'+bnr).value=document.getElementById('i_activiteiten').value;
  var n=document.getElementById('btn_activiteiten_'+bnr);
  if( n ){ 
    if ( document.getElementById('i_activiteiten_'+bnr).value != "" ){
      n.className='groovy2';
    } else {
      n.className='groovy1'; 
    }
  }
  getStyle('i_ketonen').visibility = 'hidden';
	getStyle('invoer_activiteiten').visibility = 'hidden';
}

function act_annuleer(){
  toon_select();
  getStyle('i_ketonen').visibility = 'hidden';
	getStyle('invoer_activiteiten').visibility = 'hidden';
}

function act_aan2(nr,ttl){
  verberg_select2();
	getStyle('invoer_activiteiten').visibility = 'visible';
  getStyle('i_actlijst').visibility = 'visible';
  document.getElementById('i_activiteiten_titel').innerHTML=ttl;
  document.getElementById('i_activiteiten').value=document.getElementById('i_activiteiten_'+nr).value;
  document.getElementById('i_actlijst').value=document.getElementById('i_actlijst_'+nr).value;
  document.getElementById('i_actduur').value=document.getElementById('i_actduur_'+nr).value;
  document.getElementById('actnr').value=nr;
}

function act_uit2(){
  toon_select();
  bnr=document.getElementById('actnr').value;
  document.getElementById('i_activiteiten_'+bnr).value=document.getElementById('i_activiteiten').value;
  document.getElementById('i_actlijst_'+bnr).value=document.getElementById('i_actlijst').value;
  document.getElementById('i_actduur_'+bnr).value=document.getElementById('i_actduur').value;
  var n=document.getElementById('btn_activiteiten_'+bnr);
  if( n ){ 
    if ( document.getElementById('i_activiteiten_'+bnr).value != "" || document.getElementById('i_actlijst_'+bnr).value != "" || document.getElementById('i_actduur_'+bnr).value != ""){
      n.className='groovy2';
    } else {
      n.className='groovy1'; 
    }
  }
  getStyle('i_ketonen').visibility = 'hidden';
  getStyle('i_bijzlijst').visibility = 'hidden';
  getStyle('i_actlijst').visibility = 'hidden';
	getStyle('invoer_activiteiten').visibility = 'hidden';
}

function act_annuleer2(){
  toon_select();
  getStyle('i_ketonen').visibility = 'hidden';
  getStyle('i_actlijst').visibility = 'hidden';
  getStyle('i_bijzlijst').visibility = 'hidden';
	getStyle('invoer_activiteiten').visibility = 'hidden';
}

function addMeting() {
  var ni = document.getElementById('extraDiv');
  var numi = document.getElementById('max_meetnr');
  var tmpnum = numi.value;
  var num = (tmpnum -1)+ 2;
  numi.value = num;
  var num2 = num - 8;
  var newdiv = document.createElement('div');
  var divIdName = 'extraDiv'+num;
  newdiv.setAttribute('id',divIdName);
  var h="<table cellspacing='1' cellpadding='0' width='780'>\r\n";
  h=h + "  <tr class='lichtblauw3' height='30'>\r\n";
  h=h + "    <td class='subkop' align='right' width='120'>Extra " + num2 + ":&nbsp;</td>\r\n";
  h=h + "    <td><input type='text' size='5' name='i_mw_" + num + "' id='i_mw_" + num + "' value=''>&nbsp;mmol/l&nbsp;&nbsp;</td>\r\n";
  h=h + "    <td><nobr>\r\n";
  h=h + "      <select name='i_uren_" + num + "' id='i_uren_" + num + "'>\r\n";
  h=h + "        <option value=''>-uren-</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='01'>01</option>\r\n";
  h=h + "        <option value='02'>02</option>\r\n";
  h=h + "        <option value='03'>03</option>\r\n";
  h=h + "        <option value='04'>04</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='06'>06</option>\r\n";
  h=h + "        <option value='07'>07</option>\r\n";
  h=h + "        <option value='08'>08</option>\r\n";
  h=h + "        <option value='09'>09</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='11'>11</option>\r\n";
  h=h + "        <option value='12'>12</option>\r\n";
  h=h + "        <option value='13'>13</option>\r\n";
  h=h + "        <option value='14'>14</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='16'>16</option>\r\n";
  h=h + "        <option value='17'>17</option>\r\n";
  h=h + "        <option value='18'>18</option>\r\n";
  h=h + "        <option value='19'>19</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='21'>21</option>\r\n";
  h=h + "        <option value='22'>22</option>\r\n";
  h=h + "        <option value='23'>23</option>\r\n";
  h=h + "      </select>:<select name='i_minuten_" + num + "' id='i_minuten_" + num + "'>\r\n";
  h=h + "        <option value=''>-min-</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='25'>25</option>\r\n";
  h=h + "        <option value='30'>30</option>\r\n";
  h=h + "        <option value='35'>35</option>\r\n";
  h=h + "        <option value='40'>40</option>\r\n";
  h=h + "        <option value='45'>45</option>\r\n";
  h=h + "        <option value='50'>50</option>\r\n";
  h=h + "        <option value='55'>55</option>\r\n";
  h=h + "      </select>&nbsp;</nobr>\r\n";
  h=h + "    </td>\r\n";
  h=h + "    <td><nobr>";
  h=h + "      &nbsp;&nbsp;<input type='text' size='5' value='' name='i_koolh_" + num + "' id='i_koolh_" + num + "'>";
  h=h + "      &nbsp;&nbsp;<input type='button' class='groovy1' onClick=\"javascript:win_invoer2('i_koolh_" + num + "',i_jaar.value,i_maand.value,i_dag.value,i_uren_" + num + ".value,i_minuten_" + num + ".value);\" value='Koolhydraten'>";
  h=h + "      &nbsp;<input type='button' id='btn_bijzonderheden_" + num + "' class='groovy1' onClick=\"javascript:bijzonder_aan(" + num + ",'Extra " + num2 + "');\" value='Bijzonderheden'>";
  h=h + "      &nbsp;<input type='button' id='btn_activiteiten_" + num + "' class='groovy1' onClick=\"javascript:act_aan(" + num + ",'Extra " + num2 + "');\" value='Activiteiten'>";
  h=h + "      <input type='hidden' name='i_bijzonder_" + num + "' id='i_bijzonder_" + num + "' value=''>";
  h=h + "      <input type='hidden' name='i_ketonen_" + num + "' id='i_ketonen_" + num + "' value='0'>";
  h=h + "      <input type='hidden' name='i_activiteiten_" + num + "' id='i_activiteiten_" + num + "' value=''></nobr>";
  h=h + "      </td>\r\n";
  h=h + "      <td>&nbsp;<img src='images/leeg.gif' border='0' width='10' heigth='10'>&nbsp;</td>\r\n";
  h=h + "  </tr>\r\n";
  h=h + "</table>";
  newdiv.innerHTML = h;
  ni.appendChild(newdiv);
}

function addMeting2() {
  var ni = document.getElementById('extraDiv');
  var numi = document.getElementById('max_meetnr');
  var tmpnum = numi.value;
  var num = (tmpnum -1)+ 2;
  numi.value = num;
  var num2 = num - 8;
  var newdiv = document.createElement('div');
  var divIdName = 'extraDiv'+num;
  newdiv.setAttribute('id',divIdName);
  var h="<table cellspacing='1' cellpadding='0' width='780'>\r\n";
  h=h + "  <tr class='lichtblauw3' height='30'>\r\n";
  h=h + "    <td class='subkop' align='right' width='120'>Extra " + num2 + ":&nbsp;</td>\r\n";
  h=h + "    <td><input type='text' size='5' name='i_mw_" + num + "' id='i_mw_" + num + "' value=''>&nbsp;mmol/l&nbsp;&nbsp;</td>\r\n";
  h=h + "    <td><nobr>\r\n";
  h=h + "      <select name='i_uren_" + num + "' id='i_uren_" + num + "'>\r\n";
  h=h + "        <option value=''>-uren-</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='01'>01</option>\r\n";
  h=h + "        <option value='02'>02</option>\r\n";
  h=h + "        <option value='03'>03</option>\r\n";
  h=h + "        <option value='04'>04</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='06'>06</option>\r\n";
  h=h + "        <option value='07'>07</option>\r\n";
  h=h + "        <option value='08'>08</option>\r\n";
  h=h + "        <option value='09'>09</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='11'>11</option>\r\n";
  h=h + "        <option value='12'>12</option>\r\n";
  h=h + "        <option value='13'>13</option>\r\n";
  h=h + "        <option value='14'>14</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='16'>16</option>\r\n";
  h=h + "        <option value='17'>17</option>\r\n";
  h=h + "        <option value='18'>18</option>\r\n";
  h=h + "        <option value='19'>19</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='21'>21</option>\r\n";
  h=h + "        <option value='22'>22</option>\r\n";
  h=h + "        <option value='23'>23</option>\r\n";
  h=h + "      </select>:<select name='i_minuten_" + num + "' id='i_minuten_" + num + "'>\r\n";
  h=h + "        <option value=''>-min-</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='25'>25</option>\r\n";
  h=h + "        <option value='30'>30</option>\r\n";
  h=h + "        <option value='35'>35</option>\r\n";
  h=h + "        <option value='40'>40</option>\r\n";
  h=h + "        <option value='45'>45</option>\r\n";
  h=h + "        <option value='50'>50</option>\r\n";
  h=h + "        <option value='55'>55</option>\r\n";
  h=h + "      </select>&nbsp;</nobr>\r\n";
  h=h + "    </td>\r\n";
  h=h + "    <td><nobr>";
  h=h + "      &nbsp;&nbsp;<input type='text' size='5' value='' name='i_koolh_" + num + "' id='i_koolh_" + num + "'>";
  h=h + "      &nbsp;&nbsp;<input type='button' class='groovy1' onClick=\"javascript:win_invoer2('i_koolh_" + num + "',i_jaar.value,i_maand.value,i_dag.value,i_uren_" + num + ".value,i_minuten_" + num + ".value);\" value='Koolhydraten'>";
  h=h + "      &nbsp;<input type='button' id='btn_bijzonderheden_" + num + "' class='groovy1' onClick=\"javascript:bijzonder_aan2(" + num + ",'Extra " + num2 + "');\" value='Bijzonderheden'>";
  h=h + "      &nbsp;<input type='button' id='btn_activiteiten_" + num + "' class='groovy1' onClick=\"javascript:act_aan2(" + num + ",'Extra " + num2 + "');\" value='Activiteiten'>";
  h=h + "      <input type='hidden' name='i_bijzonder_" + num + "' id='i_bijzonder_" + num + "' value=''>";
  h=h + "      <input type='hidden' name='i_bijzlijst_" + num + "' id='i_bijzlijst_" + num + "' value=''>\r\n";
  h=h + "      <input type='hidden' name='i_bijzduur_" + num + "' id='i_bijzduur_" + num + "' value=''>\r\n";
  h=h + "      <input type='hidden' name='i_ketonen_" + num + "' id='i_ketonen_" + num + "' value='0'>";
  h=h + "      <input type='hidden' name='i_activiteiten_" + num + "' id='i_activiteiten_" + num + "' value=''></nobr>";
  h=h + "      <input type='hidden' name='i_actlijst_" + num + "' id='i_actlijst_" + num + "' value=''></nobr>\r\n";
  h=h + "      <input type='hidden' name='i_actduur_" + num + "' id='i_actduur_" + num + "' value=''></nobr>\r\n";
  h=h + "      </td>\r\n";
  h=h + "      <td>&nbsp;<img src='images/leeg.gif' border='0' width='10' heigth='10'>&nbsp;</td>\r\n";
  h=h + "  </tr>\r\n";
  h=h + "</table>";
  newdiv.innerHTML = h;
  ni.appendChild(newdiv);
}

function addMeting3(nr) {
  var ni = document.getElementById('extraDiv');
  var numi = document.getElementById('max_meetnr');
  var tmpnum = numi.value;
  var num = (tmpnum -1)+ 2;
  numi.value = num;
  var num2 = num - 8;
  var newdiv = document.createElement('div');
  var divIdName = 'extraDiv'+num;
  newdiv.setAttribute('id',divIdName);
  var h="<table cellspacing='1' cellpadding='0' width='780'>\r\n";
  h=h + "  <tr class='lichtblauw3' height='30'>\r\n";
  h=h + "    <td width='105' class='subkop' align='right'><nobr>Extra:&nbsp;</nobr></td>\r\n";
  h=h + "    <td width='90' align='center'><input type='text' size='4' name='i_mw_" + num + "' id='i_mw_" + num + "' value=''>mmol/l</td>\r\n";
  h=h + "    <td width='100' align='center'><nobr><select name='i_uren_" + num + "' id='i_uren_" + num + "'>\r\n";
  h=h + "        <option value=''>UU</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='01'>01</option>\r\n";
  h=h + "        <option value='02'>02</option>\r\n";
  h=h + "        <option value='03'>03</option>\r\n";
  h=h + "        <option value='04'>04</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='06'>06</option>\r\n";
  h=h + "        <option value='07'>07</option>\r\n";
  h=h + "        <option value='08'>08</option>\r\n";
  h=h + "        <option value='09'>09</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='11'>11</option>\r\n";
  h=h + "        <option value='12'>12</option>\r\n";
  h=h + "        <option value='13'>13</option>\r\n";
  h=h + "        <option value='14'>14</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='16'>16</option>\r\n";
  h=h + "        <option value='17'>17</option>\r\n";
  h=h + "        <option value='18'>18</option>\r\n";
  h=h + "        <option value='19'>19</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='21'>21</option>\r\n";
  h=h + "        <option value='22'>22</option>\r\n";
  h=h + "        <option value='23'>23</option>\r\n";
  h=h + "      </select>:<select name='i_minuten_" + num + "' id='i_minuten_" + num + "'>\r\n";
  h=h + "        <option value=''>MM</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='25'>25</option>\r\n";
  h=h + "        <option value='30'>30</option>\r\n";
  h=h + "        <option value='35'>35</option>\r\n";
  h=h + "        <option value='40'>40</option>\r\n";
  h=h + "        <option value='45'>45</option>\r\n";
  h=h + "        <option value='50'>50</option>\r\n";
  h=h + "        <option value='55'>55</option>\r\n";
  h=h + "      </select></nobr>\r\n";
  h=h + "    </td>\r\n";
  h=h + "    <td width='129' align='center'><nobr><input type='text' size='5' value='' name='i_koolh_" + num + "' id='i_koolh_" + num + "'>&nbsp;<input type='button' class='groovy1a' onClick=\"javascript:win_invoer2('" + nr + "','i_koolh_" + num + "',i_jaar.value,i_maand.value,i_dag.value,i_uren_" + num + ".value,i_minuten_" + num + ".value);\" value='Bepaal'></nobr></td>\r\n";
  h=h + "    <td width='70' align='center'><input type='text' size='5' value='' name='i_eenheden_" + num + "' id='i_eenheden_" + num + "'></td>";
  h=h + "    <td width='260' align='center'><nobr>";
  h=h + "<input type='text' size='38' value='' name='i_opmerkingen_" + num + "' id='i_opmerkingen_" + num + "'>";
  h=h + "<input type='hidden' name='i_bijzonderheden_" + num + "' id='i_bijzonderheden_" + num + "' value=''>";
  h=h + "<input type='hidden' name='i_bijzlijst_" + num + "' id='i_bijzlijst_" + num + "' value=''>";
  h=h + "<input type='hidden' name='i_bijzduur_" + num + "' id='i_bijzduur_" + num + "' value=''>";
  h=h + "<input type='hidden' name='i_ketonen_" + num + "' id='i_ketonen_" + num + "' value='0'>";
  h=h + "<input type='hidden' name='i_activiteiten_" + num + "' id='i_activiteiten_" + num + "' value=''>";
  h=h + "<input type='hidden' name='i_actlijst_" + num + "' id='i_actlijst_" + num + "' value=''>";
  h=h + "<input type='hidden' name='i_actduur_" + num + "' id='i_actduur_" + num + "' value=''></nobr>";
  h=h + "</td>\r\n";
  h=h + "      <td width='18' align='center'><img src='images/min.gif' border='0' width='10' heigth='10' onclick=\"delExtra('" + divIdName + "');\" title='windowlock=[on] header=[Informatie] body=[Verwijder deze extra meting]' style='cursor: hand;' /></a></td>\r\n";
  h=h + "  </tr>\r\n";
  h=h + "</table>";
  newdiv.innerHTML = h;
  ni.appendChild(newdiv);
}

function addBijzonderheid(){
  var ni = document.getElementById('bijzDiv');
  var numi = document.getElementById('max_bijznr');
  var tmpnum = numi.value;
  var num = (tmpnum -1)+ 2;
  numi.value = num;
  getStyle('kbijzDiv').visibility = 'visible';
  /*
  if ( num == 1 ){
    var nj = document.getElementById('kbijzDiv');
    var newdiv2 = document.createElement('div');
    newdiv2.setAttribute('id','bijzdivkop');
    var k="<table cellspacing='1' cellpadding='0' width='780'>\r\n";
    k=k + "  <tr class='bijzrow' keight='15'>\r\n";
    k=k + "    <td width='105'></td>\r\n";
    k=k + "    <td width='90'></td>\r\n";
    k=k + "    <td width='100' align='center'><b>Van</b></td>\r\n";
    k=k + "    <td width='100' align='center'><b>Tot</b></td>\r\n";
    k=k + "    <td width='28' align='center'><b>Dag</b></td>\r\n";
    k=k + "    <td width='70' align='center'><b>Ketonen</b></td>\r\n";
    k=k + "    <td width='260'></td>\r\n";
    k=k + "    <td width='18'></td>\r\n";
    k=k + "  </tr>\r\n";
    k=k + "</table>";
    newdiv2.innerHTML = k;
    nj.appendChild(newdiv2);
  }
  */
  var newdiv = document.createElement('div');
  var divIdName = 'bijzDiv'+num;
  newdiv.setAttribute('id',divIdName);
  var h="<table cellspacing='1' cellpadding='0' width='780'>\r\n";
  h=h + "  <tr class='bijzrow' height='30'>\r\n";
  h=h + "    <td width='105' class='subkop' align='right'><nobr>Bijzonderheid:&nbsp;</nobr></td>\r\n";
  h=h + "    <td width='90' align='center'><nobr>\r\n";
  h=h + "<input type='hidden' value='" + num + "' name='i_bijznumber_" + num + "'>\r\n";
  h=h + "    <select name='i_bijzlijst_" + num + "' id='id_bijzlijst_" + num + "'>\r\n";
  h=h + "      <option value=''>Selecteer</option>\r\n";
  h=h + "      <option value='Ziekte'>Ziekte</option>\r\n";
  h=h + "      <option value='Stress'>Stress</option>\r\n";
  h=h + "      <option value='Anders'>Anders</option>\r\n";
  h=h + "    </select\r\n";
  h=h + "    </nobr></td>\r\n";
  h=h + "    <td width='100' align='center'><nobr><select name='i_uren_bijz_" + num + "' id='i_uren_bijz_" + num + "'>\r\n";
  h=h + "        <option value=''>UU</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='01'>01</option>\r\n";
  h=h + "        <option value='02'>02</option>\r\n";
  h=h + "        <option value='03'>03</option>\r\n";
  h=h + "        <option value='04'>04</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='06'>06</option>\r\n";
  h=h + "        <option value='07'>07</option>\r\n";
  h=h + "        <option value='08'>08</option>\r\n";
  h=h + "        <option value='09'>09</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='11'>11</option>\r\n";
  h=h + "        <option value='12'>12</option>\r\n";
  h=h + "        <option value='13'>13</option>\r\n";
  h=h + "        <option value='14'>14</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='16'>16</option>\r\n";
  h=h + "        <option value='17'>17</option>\r\n";
  h=h + "        <option value='18'>18</option>\r\n";
  h=h + "        <option value='19'>19</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='21'>21</option>\r\n";
  h=h + "        <option value='22'>22</option>\r\n";
  h=h + "        <option value='23'>23</option>\r\n";
  h=h + "      </select>:<select name='i_minuten_bijz_" + num + "' id='i_minuten_bijz_" + num + "'>\r\n";
  h=h + "        <option value=''>MM</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='25'>25</option>\r\n";
  h=h + "        <option value='30'>30</option>\r\n";
  h=h + "        <option value='35'>35</option>\r\n";
  h=h + "        <option value='40'>40</option>\r\n";
  h=h + "        <option value='45'>45</option>\r\n";
  h=h + "        <option value='50'>50</option>\r\n";
  h=h + "        <option value='55'>55</option>\r\n";
  h=h + "      </select></nobr>\r\n";
  h=h + "    </td>\r\n";
  h=h + "    <td width='100' align='center'><nobr><select name='i_urentot_bijz_" + num + "' id='i_urentot_bijz_" + num + "'>\r\n";
  h=h + "        <option value=''>UU</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='01'>01</option>\r\n";
  h=h + "        <option value='02'>02</option>\r\n";
  h=h + "        <option value='03'>03</option>\r\n";
  h=h + "        <option value='04'>04</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='06'>06</option>\r\n";
  h=h + "        <option value='07'>07</option>\r\n";
  h=h + "        <option value='08'>08</option>\r\n";
  h=h + "        <option value='09'>09</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='11'>11</option>\r\n";
  h=h + "        <option value='12'>12</option>\r\n";
  h=h + "        <option value='13'>13</option>\r\n";
  h=h + "        <option value='14'>14</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='16'>16</option>\r\n";
  h=h + "        <option value='17'>17</option>\r\n";
  h=h + "        <option value='18'>18</option>\r\n";
  h=h + "        <option value='19'>19</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='21'>21</option>\r\n";
  h=h + "        <option value='22'>22</option>\r\n";
  h=h + "        <option value='23'>23</option>\r\n";
  h=h + "      </select>:<select name='i_minutentot_bijz_" + num + "' id='i_minutentot_bijz_" + num + "'>\r\n";
  h=h + "        <option value=''>MM</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='25'>25</option>\r\n";
  h=h + "        <option value='30'>30</option>\r\n";
  h=h + "        <option value='35'>35</option>\r\n";
  h=h + "        <option value='40'>40</option>\r\n";
  h=h + "        <option value='45'>45</option>\r\n";
  h=h + "        <option value='50'>50</option>\r\n";
  h=h + "        <option value='55'>55</option>\r\n";
  h=h + "      </select></nobr>\r\n";
  h=h + "    </td>\r\n";
  h=h + "    <td width='28' align='center'><input type='checkbox' name='i_bijzdag_" + num + "' id='i_bijzdag_" + num + "' value='1' /></td>\r\n";
  h=h + "    <td width='70' align='center'>\r\n";
  h=h + "      <select name='i_bijzketonen_" + num + "' id='i_bijzketonen_" + num + "'>\r\n";
  tmp_ketonen=0;
  for ( ti=1; ti<=41; ti++ ){
    h=h + "        <option value='" + tmp_ketonen + "'>" + tmp_ketonen + "</option>\r\n";
    tmp_ketonen=tmp_ketonen+5;		
  }  h=h + "      </select>\r\n";
  h=h + "    </td>\r\n";
  h=h + "    <td width='260' align='center'>\r\n";
  h=h + "      <input type='text' size='38' value='' name='i_bijzonderheden_" + num + "' id='i_bijzonderheden_" + num + "'>";
  h=h + "    </td>\r\n";
  h=h + "    <td width='18' align='center'><img src='images/min.gif' border='0' width='10' heigth='10' onclick=\"delBijz('" + divIdName + "');\" title='windowlock=[on] header=[Informatie] body=[Verwijder deze bijzonderheid]' style='cursor: hand;' /></a></td>\r\n";
  h=h + "  </tr>\r\n";
  h=h + "</table>";
  newdiv.innerHTML = h;
  ni.appendChild(newdiv);
}

function addActiviteit(){
  var ni = document.getElementById('actDiv');
  var numi = document.getElementById('max_actnr');
  var tmpnum = numi.value;
  var num = (tmpnum -1)+ 2;
  numi.value = num;
  getStyle('kactDiv').visibility = 'visible';
  /*
  if ( num == 1 ){
    var nj = document.getElementById('kactDiv');
    var newdiv2 = document.createElement('div');
    newdiv2.setAttribute('id','actdivkop');
    var k="<table cellspacing='1' cellpadding='0' width='780'>\r\n";
    k=k + "  <tr class='actrow' keight='15'>\r\n";
    k=k + "    <td width='105'></td>\r\n";
    k=k + "    <td width='90'></td>\r\n";
    k=k + "    <td width='100' align='center'><b>Van</b></td>\r\n";
    k=k + "    <td width='100' align='center'><b>Tot</b></td>\r\n";
    k=k + "    <td width='28' align='center'><b>Dag</b></td>\r\n";
    k=k + "    <td width='70' align='center'></td>\r\n";
    k=k + "    <td width='260'></td>\r\n";
    k=k + "    <td width='18'></td>\r\n";
    k=k + "  </tr>\r\n";
    k=k + "</table>";
    newdiv2.innerHTML = k;
    nj.appendChild(newdiv2);
  }
  */
  var newdiv = document.createElement('div');
  var divIdName = 'actDiv'+num;
  newdiv.setAttribute('id',divIdName);
  var h="<table cellspacing='1' cellpadding='0' width='780'>\r\n";
  h=h + "  <tr class='actrow' height='30'>\r\n";
  h=h + "    <td width='105' class='subkop' align='right'><nobr>Activiteit:&nbsp;</nobr></td>\r\n";
  h=h + "    <td width='90' align='center'><nobr>\r\n";
  h=h + "<input type='hidden' value='" + num + "' name='i_actnumber_" + num + "'>\r\n";
  h=h + "    <select name='i_actlijst_" + num + "' id='actlijst_" + num + "'>\r\n";
  h=h + "      <option value=''>Selecteer</option>\r\n";
  h=h + "      <option value='Fietsen'>Fietsen</option>\r\n";
  h=h + "      <option value='Hardlopen'>Hardlopen</option>\r\n";
  h=h + "      <option value='Wandelen'>Wandelen</option>\r\n";
  h=h + "      <option value='Anders'>Anders</option>\r\n";
  h=h + "    </select\r\n";
  h=h + "    </nobr></td>\r\n";
  h=h + "    <td width='100' align='center'><nobr><select name='i_uren_act_" + num + "' id='i_uren_act_" + num + "'>\r\n";
  h=h + "        <option value=''>UU</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='01'>01</option>\r\n";
  h=h + "        <option value='02'>02</option>\r\n";
  h=h + "        <option value='03'>03</option>\r\n";
  h=h + "        <option value='04'>04</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='06'>06</option>\r\n";
  h=h + "        <option value='07'>07</option>\r\n";
  h=h + "        <option value='08'>08</option>\r\n";
  h=h + "        <option value='09'>09</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='11'>11</option>\r\n";
  h=h + "        <option value='12'>12</option>\r\n";
  h=h + "        <option value='13'>13</option>\r\n";
  h=h + "        <option value='14'>14</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='16'>16</option>\r\n";
  h=h + "        <option value='17'>17</option>\r\n";
  h=h + "        <option value='18'>18</option>\r\n";
  h=h + "        <option value='19'>19</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='21'>21</option>\r\n";
  h=h + "        <option value='22'>22</option>\r\n";
  h=h + "        <option value='23'>23</option>\r\n";
  h=h + "      </select>:<select name='i_minuten_act_" + num + "' id='i_minuten_act_" + num + "'>\r\n";
  h=h + "        <option value=''>MM</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='25'>25</option>\r\n";
  h=h + "        <option value='30'>30</option>\r\n";
  h=h + "        <option value='35'>35</option>\r\n";
  h=h + "        <option value='40'>40</option>\r\n";
  h=h + "        <option value='45'>45</option>\r\n";
  h=h + "        <option value='50'>50</option>\r\n";
  h=h + "        <option value='55'>55</option>\r\n";
  h=h + "      </select></nobr>\r\n";
  h=h + "    </td>\r\n";
  h=h + "    <td width='100' align='center'><nobr><select name='i_urentot_act_" + num + "' id='i_urentot_act_" + num + "'>\r\n";
  h=h + "        <option value=''>UU</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='01'>01</option>\r\n";
  h=h + "        <option value='02'>02</option>\r\n";
  h=h + "        <option value='03'>03</option>\r\n";
  h=h + "        <option value='04'>04</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='06'>06</option>\r\n";
  h=h + "        <option value='07'>07</option>\r\n";
  h=h + "        <option value='08'>08</option>\r\n";
  h=h + "        <option value='09'>09</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='11'>11</option>\r\n";
  h=h + "        <option value='12'>12</option>\r\n";
  h=h + "        <option value='13'>13</option>\r\n";
  h=h + "        <option value='14'>14</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='16'>16</option>\r\n";
  h=h + "        <option value='17'>17</option>\r\n";
  h=h + "        <option value='18'>18</option>\r\n";
  h=h + "        <option value='19'>19</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='21'>21</option>\r\n";
  h=h + "        <option value='22'>22</option>\r\n";
  h=h + "        <option value='23'>23</option>\r\n";
  h=h + "      </select>:<select name='i_minutentot_act_" + num + "' id='i_minutentot_act_" + num + "'>\r\n";
  h=h + "        <option value=''>MM</option>\r\n";
  h=h + "        <option value='00'>00</option>\r\n";
  h=h + "        <option value='05'>05</option>\r\n";
  h=h + "        <option value='10'>10</option>\r\n";
  h=h + "        <option value='15'>15</option>\r\n";
  h=h + "        <option value='20'>20</option>\r\n";
  h=h + "        <option value='25'>25</option>\r\n";
  h=h + "        <option value='30'>30</option>\r\n";
  h=h + "        <option value='35'>35</option>\r\n";
  h=h + "        <option value='40'>40</option>\r\n";
  h=h + "        <option value='45'>45</option>\r\n";
  h=h + "        <option value='50'>50</option>\r\n";
  h=h + "        <option value='55'>55</option>\r\n";
  h=h + "      </select></nobr>\r\n";
  h=h + "    </td>\r\n";
  h=h + "    <td width='28' align='center'><input type='checkbox' name='i_actdag_" + num + "' id='i_actdag_" + num + "' value='1' /></td>\r\n";
  h=h + "    <td width='70' align='center'>&nbsp;</td>\r\n";
  h=h + "    <td width='260' align='center'>\r\n";
  h=h + "      <input type='text' size='38' value='' name='i_activiteiten_" + num + "' id='i_i_activiteiten_" + num + "'>";
  h=h + "    </td>\r\n";
  h=h + "    <td width='18' align='center'><img src='images/min.gif' border='0' width='10' heigth='10' onclick=\"delAct('" + divIdName + "');\" title='windowlock=[on] header=[Informatie] body=[Verwijder deze activiteit]' style='cursor: hand;' /></a></td>\r\n";
  h=h + "  </tr>\r\n";
  h=h + "</table>";
  newdiv.innerHTML = h;
  ni.appendChild(newdiv);
}

function delExtra(extradivnum){
  var ni = document.getElementById('extraDiv');
  var olddiv = document.getElementById(extradivnum);
  ni.removeChild(olddiv);
}

function delBijz(bijzdivnum){
  var ni = document.getElementById('bijzDiv');
  var olddiv = document.getElementById(bijzdivnum);
  ni.removeChild(olddiv);
  if ( ni.getElementsByTagName('div').length == 0 ){
    getStyle('kbijzDiv').visibility = 'hidden';
    //var nj = document.getElementById('kbijzDiv');
    //var kolddiv = document.getElementById('bijzdivkop');
    //nj.removeChild(kolddiv);
  }
  ;
}

function delAct(actdivnum){
  var ni = document.getElementById('actDiv');
  var olddiv = document.getElementById(actdivnum);
  ni.removeChild(olddiv);
  if ( ni.getElementsByTagName('div').length == 0 ){
    getStyle('kactDiv').visibility = 'hidden';
    //var nj = document.getElementById('kactDiv');
    //var kolddiv = document.getElementById('actdivkop');
    //nj.removeChild(kolddiv);
  }
}

function verberg_lijsten() {
  
if (document.getElementById('i_ketonen_nacht')) {  getStyle('i_ketonen_nacht').visibility = 'hidden';}
if (document.getElementById('i_ketonen_nuchter')) {	getStyle('i_ketonen_nuchter').visibility = 'hidden';}
if (document.getElementById('i_ketonen_na_ontbijt')) {	getStyle('i_ketonen_na_ontbijt').visibility = 'hidden';}
if (document.getElementById('i_ketonen_voor_lunch')) {	getStyle('i_ketonen_voor_lunch').visibility = 'hidden';}
if (document.getElementById('i_ketonen_na_lunch')) {	getStyle('i_ketonen_na_lunch').visibility = 'hidden';}
if (document.getElementById('i_ketonen_voor_diner')) {	getStyle('i_ketonen_voor_diner').visibility = 'hidden';}
if (document.getElementById('i_ketonen_na_diner')) {	getStyle('i_ketonen_na_diner').visibility = 'hidden';}
if (document.getElementById('i_ketonen_slapen')) {	getStyle('i_ketonen_slapen').visibility = 'hidden';}

}

function toon_lijsten() {

if (document.getElementById('i_ketonen_nacht')) {	getStyle('i_ketonen_nacht').visibility = 'visible';}
if (document.getElementById('i_ketonen_nuchter')) {	getStyle('i_ketonen_nuchter').visibility = 'visible';}
if (document.getElementById('i_ketonen_na_ontbijt')) {	getStyle('i_ketonen_na_ontbijt').visibility = 'visible';}
if (document.getElementById('i_ketonen_voor_lunch')) {	getStyle('i_ketonen_voor_lunch').visibility = 'visible';}
if (document.getElementById('i_ketonen_na_lunch')) { getStyle('i_ketonen_na_lunch').visibility = 'visible';}
if (document.getElementById('i_ketonen_voor_diner')) {	getStyle('i_ketonen_voor_diner').visibility = 'visible';}
if (document.getElementById('i_ketonen_na_diner')) {	getStyle('i_ketonen_na_diner').visibility = 'visible';}
if (document.getElementById('i_ketonen_slapen')) {	getStyle('i_ketonen_slapen').visibility = 'visible';}
getStyle('i_dag').visibility = 'visible';
getStyle('i_maand').visibility = 'visible';
getStyle('i_jaar').visibility = 'visible';	
}


var winss = null;
function win_invoer(pag,jaar,maand,dag,uren,minuten){
  if ( winss == null || winss.closed ){
    winss = window.open('koolhydraten.php?aanvr=' + pag + '&jj=' + jaar + '&mm=' + maand + '&dd=' + dag + '&uu=' + uren + '&mi=' + minuten, 'Rondleiding', 'width=982,height=800,status=yes,scrollbars=yes,resizable=no');
  } else {
    winss.focus();
  }
}

var winss2 = null;
function win_invoer2(nr,pag,jaar,maand,dag,uren,minuten){
  if ( winss2 == null || winss2.closed ){
    winss2 = window.open('koolhydraten2.php?nummer=' + nr + '&aanvr=' + pag + '&jj=' + jaar + '&mm=' + maand + '&dd=' + dag + '&uu=' + uren + '&mi=' + minuten, 'Rondleiding', 'width=995,height=800,scrollbars=yes,location=no', false);
  } else {
    winss2.focus();
  }
}

function vw_dieet(product,koolh,eenheid_nr,nr,eenheid_txt){
 
 document.form_dieet.f_herbereken.value=1; 
 
 if (document.form_dieet.product_dieet_1.value == ""){
   document.form_dieet.product_dieet_1.value = product;
   document.form_dieet.koolh_dieet_1.value = koolh;	 
   document.form_dieet.id_dieet_1.value = nr;
   document.form_dieet.eenheid_nr_dieet_1.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_1.value = eenheid_nr + " " + eenheid_txt;	 
	 return;	 
 }

 if (document.form_dieet.product_dieet_2.value == ""){
   document.form_dieet.product_dieet_2.value = product;
   document.form_dieet.koolh_dieet_2.value = koolh;	 
   document.form_dieet.id_dieet_2.value = nr;
   document.form_dieet.eenheid_nr_dieet_2.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_2.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 } 
 
 if (document.form_dieet.product_dieet_3.value == ""){
   document.form_dieet.product_dieet_3.value = product;
   document.form_dieet.koolh_dieet_3.value = koolh;	 
   document.form_dieet.id_dieet_3.value = nr;
   document.form_dieet.eenheid_nr_dieet_3.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_3.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 } 
 
 if (document.form_dieet.product_dieet_4.value == ""){
   document.form_dieet.product_dieet_4.value = product;
   document.form_dieet.koolh_dieet_4.value = koolh;	 
   document.form_dieet.id_dieet_4.value = nr;
   document.form_dieet.eenheid_nr_dieet_4.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_4.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 } 
 
 if (document.form_dieet.product_dieet_5.value == ""){
   document.form_dieet.product_dieet_5.value = product;
   document.form_dieet.koolh_dieet_5.value = koolh;	 
   document.form_dieet.id_dieet_5.value = nr;
   document.form_dieet.eenheid_nr_dieet_5.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_5.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 }
 
 if (document.form_dieet.product_dieet_6.value == ""){
   document.form_dieet.product_dieet_6.value = product;
   document.form_dieet.koolh_dieet_6.value = koolh;	 
   document.form_dieet.id_dieet_6.value = nr;
   document.form_dieet.eenheid_nr_dieet_6.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_6.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 } 

 if (document.form_dieet.product_dieet_7.value == ""){
   document.form_dieet.product_dieet_7.value = product;
   document.form_dieet.koolh_dieet_7.value = koolh;	 
   document.form_dieet.id_dieet_7.value = nr;
   document.form_dieet.eenheid_nr_dieet_7.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_7.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 } 
 
 if (document.form_dieet.product_dieet_8.value == ""){
   document.form_dieet.product_dieet_8.value = product;
   document.form_dieet.koolh_dieet_8.value = koolh;	 
   document.form_dieet.id_dieet_8.value = nr;
   document.form_dieet.eenheid_nr_dieet_8.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_8.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 } 
 
 if (document.form_dieet.product_dieet_9.value == ""){
   document.form_dieet.product_dieet_9.value = product;
   document.form_dieet.koolh_dieet_9.value = koolh;	 
   document.form_dieet.id_dieet_9.value = nr;
   document.form_dieet.eenheid_nr_dieet_9.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_9.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 } 
 
 if (document.form_dieet.product_dieet_10.value == ""){
   document.form_dieet.product_dieet_10.value = product;
   document.form_dieet.koolh_dieet_10.value = koolh;	 
   document.form_dieet.id_dieet_10.value = nr;
   document.form_dieet.eenheid_nr_dieet_10.value = eenheid_nr;	 
   document.form_dieet.eenheid_compleet_dieet_10.value = eenheid_nr + " " + eenheid_txt;
	 return;	 	 	 
 } 

}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}


function ber_koolh(totaal){
 
 if (totaal == 'totaal_1'){
 
   var chknr = document.form_dieet.gr_ml_stuks_1.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_1.value = chknr;
       if (document.form_dieet.gr_ml_stuks_1.value != "" && document.form_dieet.eenheid_nr_dieet_1.value != "" && document.form_dieet.koolh_dieet_1.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_1.value/document.form_dieet.eenheid_nr_dieet_1.value) * document.form_dieet.koolh_dieet_1.value);
           document.form_dieet.totaal_1.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }

 
 if (totaal == 'totaal_2'){
 
   var chknr = document.form_dieet.gr_ml_stuks_2.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_2.value = chknr;
       if (document.form_dieet.gr_ml_stuks_2.value != "" && document.form_dieet.eenheid_nr_dieet_2.value != "" && document.form_dieet.koolh_dieet_2.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_2.value/document.form_dieet.eenheid_nr_dieet_2.value) * document.form_dieet.koolh_dieet_2.value);
           document.form_dieet.totaal_2.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 } 
 
 
 if (totaal == 'totaal_3'){
 
   var chknr = document.form_dieet.gr_ml_stuks_3.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_3.value = chknr;
       if (document.form_dieet.gr_ml_stuks_3.value != "" && document.form_dieet.eenheid_nr_dieet_3.value != "" && document.form_dieet.koolh_dieet_3.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_3.value/document.form_dieet.eenheid_nr_dieet_3.value) * document.form_dieet.koolh_dieet_3.value);
           document.form_dieet.totaal_3.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }
 
 
 if (totaal == 'totaal_4'){
 
   var chknr = document.form_dieet.gr_ml_stuks_4.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_4.value = chknr;
       if (document.form_dieet.gr_ml_stuks_4.value != "" && document.form_dieet.eenheid_nr_dieet_4.value != "" && document.form_dieet.koolh_dieet_4.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_4.value/document.form_dieet.eenheid_nr_dieet_4.value) * document.form_dieet.koolh_dieet_4.value);
           document.form_dieet.totaal_4.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }
 
 if (totaal == 'totaal_5'){
 
   var chknr = document.form_dieet.gr_ml_stuks_5.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_5.value = chknr;
       if (document.form_dieet.gr_ml_stuks_5.value != "" && document.form_dieet.eenheid_nr_dieet_5.value != "" && document.form_dieet.koolh_dieet_5.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_5.value/document.form_dieet.eenheid_nr_dieet_5.value) * document.form_dieet.koolh_dieet_5.value);
           document.form_dieet.totaal_5.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }
 
 if (totaal == 'totaal_6'){
 
   var chknr = document.form_dieet.gr_ml_stuks_6.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_6.value = chknr;
       if (document.form_dieet.gr_ml_stuks_6.value != "" && document.form_dieet.eenheid_nr_dieet_6.value != "" && document.form_dieet.koolh_dieet_6.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_6.value/document.form_dieet.eenheid_nr_dieet_6.value) * document.form_dieet.koolh_dieet_6.value);
           document.form_dieet.totaal_6.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }
   
 if (totaal == 'totaal_7'){
 
   var chknr = document.form_dieet.gr_ml_stuks_7.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_7.value = chknr;
       if (document.form_dieet.gr_ml_stuks_7.value != "" && document.form_dieet.eenheid_nr_dieet_7.value != "" && document.form_dieet.koolh_dieet_7.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_7.value/document.form_dieet.eenheid_nr_dieet_7.value) * document.form_dieet.koolh_dieet_7.value);
           document.form_dieet.totaal_7.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }
 
 if (totaal == 'totaal_8'){
 
   var chknr = document.form_dieet.gr_ml_stuks_8.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_8.value = chknr;
       if (document.form_dieet.gr_ml_stuks_8.value != "" && document.form_dieet.eenheid_nr_dieet_8.value != "" && document.form_dieet.koolh_dieet_8.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_8.value/document.form_dieet.eenheid_nr_dieet_8.value) * document.form_dieet.koolh_dieet_8.value);
           document.form_dieet.totaal_8.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }
 
 if (totaal == 'totaal_9'){
 
   var chknr = document.form_dieet.gr_ml_stuks_9.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_9.value = chknr;
       if (document.form_dieet.gr_ml_stuks_9.value != "" && document.form_dieet.eenheid_nr_dieet_9.value != "" && document.form_dieet.koolh_dieet_9.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_9.value/document.form_dieet.eenheid_nr_dieet_9.value) * document.form_dieet.koolh_dieet_9.value);
           document.form_dieet.totaal_9.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }
 
 if (totaal == 'totaal_10'){
 
   var chknr = document.form_dieet.gr_ml_stuks_10.value;
   chknr = chknr.replace(",", ".");
	 if (IsNumeric(chknr)){
	     document.form_dieet.gr_ml_stuks_10.value = chknr;
       if (document.form_dieet.gr_ml_stuks_10.value != "" && document.form_dieet.eenheid_nr_dieet_10.value != "" && document.form_dieet.koolh_dieet_10.value != ""){
           var result= ((document.form_dieet.gr_ml_stuks_10.value/document.form_dieet.eenheid_nr_dieet_10.value) * document.form_dieet.koolh_dieet_10.value);
           document.form_dieet.totaal_10.value = Math.round(result*100)/100;
    	 }
	 }		 		 
 }    
 
}


function wissen(rij){

    if (rij == 1) {
      document.form_dieet.id_dieet_1.value = "";
      document.form_dieet.eenheid_nr_dieet_1.value = "";
      document.form_dieet.favoriet_dieet_1.checked = false;
      document.form_dieet.product_dieet_1.value = "";
      document.form_dieet.eenheid_compleet_dieet_1.value = "";
      document.form_dieet.koolh_dieet_1.value = "";
      document.form_dieet.gr_ml_stuks_1.value = "";
      document.form_dieet.totaal_1.value = "";
    }
    
    if (rij == 2) {
      document.form_dieet.id_dieet_2.value = "";
      document.form_dieet.eenheid_nr_dieet_2.value = "";
      document.form_dieet.favoriet_dieet_2.checked = false;
      document.form_dieet.product_dieet_2.value = "";
      document.form_dieet.eenheid_compleet_dieet_2.value = "";
      document.form_dieet.koolh_dieet_2.value = "";
      document.form_dieet.gr_ml_stuks_2.value = "";
      document.form_dieet.totaal_2.value = "";
    }

    if (rij == 3) {
      document.form_dieet.id_dieet_3.value = "";
      document.form_dieet.eenheid_nr_dieet_3.value = "";
      document.form_dieet.favoriet_dieet_3.checked = false;
      document.form_dieet.product_dieet_3.value = "";
      document.form_dieet.eenheid_compleet_dieet_3.value = "";
      document.form_dieet.koolh_dieet_3.value = "";
      document.form_dieet.gr_ml_stuks_3.value = "";
      document.form_dieet.totaal_3.value = "";
    }
		
    if (rij == 4) {
      document.form_dieet.id_dieet_4.value = "";
      document.form_dieet.eenheid_nr_dieet_4.value = "";
      document.form_dieet.favoriet_dieet_4.checked = false;
      document.form_dieet.product_dieet_4.value = "";
      document.form_dieet.eenheid_compleet_dieet_4.value = "";
      document.form_dieet.koolh_dieet_4.value = "";
      document.form_dieet.gr_ml_stuks_4.value = "";
      document.form_dieet.totaal_4.value = "";
    }
		
    if (rij == 5) {
      document.form_dieet.id_dieet_5.value = "";
      document.form_dieet.eenheid_nr_dieet_5.value = "";
      document.form_dieet.favoriet_dieet_5.checked = false;
      document.form_dieet.product_dieet_5.value = "";
      document.form_dieet.eenheid_compleet_dieet_5.value = "";
      document.form_dieet.koolh_dieet_5.value = "";
      document.form_dieet.gr_ml_stuks_5.value = "";
      document.form_dieet.totaal_5.value = "";
    }
		
    if (rij == 6) {
      document.form_dieet.id_dieet_6.value = "";
      document.form_dieet.eenheid_nr_dieet_6.value = "";
      document.form_dieet.favoriet_dieet_6.checked = false;
      document.form_dieet.product_dieet_6.value = "";
      document.form_dieet.eenheid_compleet_dieet_6.value = "";
      document.form_dieet.koolh_dieet_6.value = "";
      document.form_dieet.gr_ml_stuks_6.value = "";
      document.form_dieet.totaal_6.value = "";
    }
		
    if (rij == 7) {
      document.form_dieet.id_dieet_7.value = "";
      document.form_dieet.eenheid_nr_dieet_7.value = "";
      document.form_dieet.favoriet_dieet_7.checked = false;
      document.form_dieet.product_dieet_7.value = "";
      document.form_dieet.eenheid_compleet_dieet_7.value = "";
      document.form_dieet.koolh_dieet_7.value = "";
      document.form_dieet.gr_ml_stuks_7.value = "";
      document.form_dieet.totaal_7.value = "";
    }
		
    if (rij == 8) {
      document.form_dieet.id_dieet_8.value = "";
      document.form_dieet.eenheid_nr_dieet_8.value = "";
      document.form_dieet.favoriet_dieet_8.checked = false;
      document.form_dieet.product_dieet_8.value = "";
      document.form_dieet.eenheid_compleet_dieet_8.value = "";
      document.form_dieet.koolh_dieet_8.value = "";
      document.form_dieet.gr_ml_stuks_8.value = "";
      document.form_dieet.totaal_8.value = "";
    }
		
    if (rij == 9) {
      document.form_dieet.id_dieet_9.value = "";
      document.form_dieet.eenheid_nr_dieet_9.value = "";
      document.form_dieet.favoriet_dieet_9.checked = false;
      document.form_dieet.product_dieet_9.value = "";
      document.form_dieet.eenheid_compleet_dieet_9.value = "";
      document.form_dieet.koolh_dieet_9.value = "";
      document.form_dieet.gr_ml_stuks_9.value = "";
      document.form_dieet.totaal_9.value = "";
    }
		
    if (rij == 10) {
      document.form_dieet.id_dieet_10.value = "";
      document.form_dieet.eenheid_nr_dieet_10.value = "";
      document.form_dieet.favoriet_dieet_10.checked = false;
      document.form_dieet.product_dieet_10.value = "";
      document.form_dieet.eenheid_compleet_dieet_10.value = "";
      document.form_dieet.koolh_dieet_10.value = "";
      document.form_dieet.gr_ml_stuks_10.value = "";
      document.form_dieet.totaal_10.value = "";
    }														
    document.form_dieet.f_wissen.value = "1";
    document.form_dieet.submit();

}

function reset_invoer(){
 
if (document.getElementById('i_nacht')) { document.invoeren.i_nacht.value=""; }
if (document.getElementById('i_nuchter')) { document.invoeren.i_nuchter.value=""; }
if (document.getElementById('i_na_ontbijt')) { document.invoeren.i_na_ontbijt.value="";}
if (document.getElementById('i_voor_lunch')) { document.invoeren.i_voor_lunch.value=""; }
if (document.getElementById('i_na_lunch')) { document.invoeren.i_na_lunch.value=""; }
if (document.getElementById('i_voor_diner')) { document.invoeren.i_voor_diner.value=""; }
if (document.getElementById('i_na_diner')) { document.invoeren.i_na_diner.value=""; }
if (document.getElementById('i_slapen')) { document.invoeren.i_slapen.value=""; }
        
if (document.getElementById('i_uren_nacht')) { document.invoeren.i_uren_nacht.value=""; }
if (document.getElementById('i_uren_nuchter')) { document.invoeren.i_uren_nuchter.value=""; }
if (document.getElementById('i_uren_na_ontbijt')){ document.invoeren.i_uren_na_ontbijt.value="";}
if (document.getElementById('i_uren_voor_lunch')) { document.invoeren.i_uren_voor_lunch.value=""; }
if (document.getElementById('i_uren_na_lunch')) { document.invoeren.i_uren_na_lunch.value=""; }
if (document.getElementById('i_uren_voor_diner')) { document.invoeren.i_uren_voor_diner.value=""; }
if (document.getElementById('i_uren_na_diner')) { document.invoeren.i_uren_na_diner.value=""; }
if (document.getElementById('i_uren_slapen')) { document.invoeren.i_uren_slapen.value=""; }				
				
if (document.getElementById('i_minuten_nacht')) { document.invoeren.i_minuten_nacht.value=""; }
if (document.getElementById('i_minuten_nuchter')) { document.invoeren.i_minuten_nuchter.value=""; }
if (document.getElementById('i_minuten_na_ontbijt')) {document.invoeren.i_minuten_na_ontbijt.value="";}
if (document.getElementById('i_minuten_voor_lunch')) { document.invoeren.i_minuten_voor_lunch.value=""; }
if (document.getElementById('i_minuten_na_lunch')) { document.invoeren.i_minuten_na_lunch.value=""; }
if (document.getElementById('i_minuten_voor_diner')) { document.invoeren.i_minuten_voor_diner.value=""; }
if (document.getElementById('i_minuten_na_diner')) { document.invoeren.i_minuten_na_diner.value=""; }
if (document.getElementById('i_minuten_slapen')) { document.invoeren.i_minuten_slapen.value=""; }				

if (document.getElementById('i_bijzonder_nacht')) { document.invoeren.i_bijzonder_nacht.value=""; }
if (document.getElementById('i_bijzonder_nuchter')) { document.invoeren.i_bijzonder_nuchter.value=""; }
if (document.getElementById('i_bijzonder_na_ontbijt')) { document.invoeren.i_bijzonder_na_ontbijt.value="";}
if (document.getElementById('i_bijzonder_voor_lunch')) { document.invoeren.i_bijzonder_voor_lunch.value=""; }
if (document.getElementById('i_bijzonder_na_lunch')) { document.invoeren.i_bijzonder_na_lunch.value=""; }
if (document.getElementById('i_bijzonder_voor_diner')) { document.invoeren.i_bijzonder_voor_diner.value=""; }
if (document.getElementById('i_bijzonder_na_diner')) { document.invoeren.i_bijzonder_na_diner.value=""; }
if (document.getElementById('i_bijzonder_slapen')) { document.invoeren.i_bijzonder_slapen.value=""; }				

if (document.getElementById('i_ketonen_nacht')) { document.invoeren.i_ketonen_nacht.value=""; }
if (document.getElementById('i_ketonen_nuchter')) { document.invoeren.i_ketonen_nuchter.value=""; }
if (document.getElementById('i_ketonen_na_ontbijt')) { document.invoeren.i_ketonen_na_ontbijt.value="";}
if (document.getElementById('i_ketonen_voor_lunch')) { document.invoeren.i_ketonen_voor_lunch.value=""; }
if (document.getElementById('i_ketonen_na_lunch')) { document.invoeren.i_ketonen_na_lunch.value=""; }
if (document.getElementById('i_ketonen_voor_diner')) { document.invoeren.i_ketonen_voor_diner.value=""; }
if (document.getElementById('i_ketonen_na_diner')) { document.invoeren.i_ketonen_na_diner.value=""; }
if (document.getElementById('i_ketonen_slapen')) { document.invoeren.i_ketonen_slapen.value=""; }				

if (document.getElementById('i_koolh_nacht')) { document.invoeren.i_koolh_nacht.value=""; }
if (document.getElementById('i_koolh_nuchter')) { document.invoeren.i_koolh_nuchter.value=""; }
if (document.getElementById('i_koolh_na_ontbijt')) { document.invoeren.i_koolh_na_ontbijt.value=""; }
if (document.getElementById('i_koolh_voor_lunch')) { document.invoeren.i_koolh_voor_lunch.value=""; }
if (document.getElementById('i_koolh_na_lunch')) { document.invoeren.i_koolh_na_lunch.value=""; }
if (document.getElementById('i_koolh_voor_diner')) { document.invoeren.i_koolh_voor_diner.value=""; }
if (document.getElementById('i_koolh_na_diner')) { document.invoeren.i_koolh_na_diner.value=""; }
if (document.getElementById('i_koolh_slapen')) { document.invoeren.i_koolh_slapen.value=""; }			 	


}


function totaal_koolh(){

var tot_koolh = 0;

if (IsNumeric(document.form_dieet.totaal_1.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_1.value/1);}
if (IsNumeric(document.form_dieet.totaal_2.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_2.value/1);}
if (IsNumeric(document.form_dieet.totaal_3.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_3.value/1);}
if (IsNumeric(document.form_dieet.totaal_4.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_4.value/1);}
if (IsNumeric(document.form_dieet.totaal_5.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_5.value/1);}
if (IsNumeric(document.form_dieet.totaal_6.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_6.value/1);}
if (IsNumeric(document.form_dieet.totaal_7.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_7.value/1);}
if (IsNumeric(document.form_dieet.totaal_8.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_8.value/1);}
if (IsNumeric(document.form_dieet.totaal_9.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_9.value/1);}
if (IsNumeric(document.form_dieet.totaal_10.value)){ tot_koolh = tot_koolh + (document.form_dieet.totaal_10.value/1);}

document.form_dieet.eind_totaal.value = Math.round(tot_koolh*100)/100;

}


function kh_terug(aanvrager){

if (aanvrager == "i_koolh_nacht") {opener.document.invoeren.i_koolh_nacht.value = document.form_dieet.eind_totaal.value; window.close();}
if (aanvrager == "i_koolh_nuchter") {opener.document.invoeren.i_koolh_nuchter.value = document.form_dieet.eind_totaal.value; window.close();}
if (aanvrager == "i_koolh_na_ontbijt") {opener.document.invoeren.i_koolh_na_ontbijt.value = document.form_dieet.eind_totaal.value; window.close();}
if (aanvrager == "i_koolh_voor_lunch") {opener.document.invoeren.i_koolh_voor_lunch.value = document.form_dieet.eind_totaal.value; window.close();}
if (aanvrager == "i_koolh_na_lunch") {opener.document.invoeren.i_koolh_na_lunch.value = document.form_dieet.eind_totaal.value; window.close();}
if (aanvrager == "i_koolh_voor_diner") {opener.document.invoeren.i_koolh_voor_diner.value = document.form_dieet.eind_totaal.value; window.close();}
if (aanvrager == "i_koolh_na_diner") {opener.document.invoeren.i_koolh_na_diner.value = document.form_dieet.eind_totaal.value; window.close();}
if (aanvrager == "i_koolh_slapen") {opener.document.invoeren.i_koolh_slapen.value = document.form_dieet.eind_totaal.value; window.close();}
}


function kh_terug2(aanvrager,kh){

window.close();
if (aanvrager == "i_koolh_nacht") {opener.document.invoeren.i_koolh_nacht.value = kh; window.close();}
if (aanvrager == "i_koolh_nuchter") {opener.document.invoeren.i_koolh_nuchter.value = kh; window.close();}
if (aanvrager == "i_koolh_na_ontbijt") {opener.document.invoeren.i_koolh_na_ontbijt.value = kh; window.close();}
if (aanvrager == "i_koolh_voor_lunch") {opener.document.invoeren.i_koolh_voor_lunch.value = kh; window.close();}
if (aanvrager == "i_koolh_na_lunch") {opener.document.invoeren.i_koolh_na_lunch.value = kh; window.close();}
if (aanvrager == "i_koolh_voor_diner") {opener.document.invoeren.i_koolh_voor_diner.value = kh; window.close();}
if (aanvrager == "i_koolh_na_diner") {opener.document.invoeren.i_koolh_na_diner.value = kh; window.close();}
if (aanvrager == "i_koolh_slapen") {opener.document.invoeren.i_koolh_slapen.value = kh; window.close();}
}

function kh_terug3(aanvrager,kh){

window.close();
if (aanvrager == "i_koolh_nacht") {opener.document.invoeren.i_koolh_nacht.value = kh; window.close();}
if (aanvrager == "i_koolh_nuchter") {opener.document.invoeren.i_koolh_nuchter.value = kh; window.close();}
if (aanvrager == "i_koolh_na_ontbijt") {opener.document.invoeren.i_koolh_na_ontbijt.value = kh; window.close();}
if (aanvrager == "i_koolh_voor_lunch") {opener.document.invoeren.i_koolh_voor_lunch.value = kh; window.close();}
if (aanvrager == "i_koolh_na_lunch") {opener.document.invoeren.i_koolh_na_lunch.value = kh; window.close();}
if (aanvrager == "i_koolh_voor_diner") {opener.document.invoeren.i_koolh_voor_diner.value = kh; window.close();}
if (aanvrager == "i_koolh_na_diner") {opener.document.invoeren.i_koolh_na_diner.value = kh; window.close();}
if (aanvrager == "i_koolh_slapen") {opener.document.invoeren.i_koolh_slapen.value = kh; window.close();}
}

function verberg_select(layer){
    var veld = layer;
    if(document.all){
      allSelects = document.getElementsByTagName('select');
      for(var a=0; a<allSelects.length; a++){
			    allSelects[a].style.visibility = 'hidden';
			    document.getElementById(layer).style.visibility = 'visible';		
			}
    }
}

function verberg_select2(){
    if(document.all){
      allSelects = document.getElementsByTagName('select');
      for(var a=0; a<allSelects.length; a++){
			    allSelects[a].style.visibility = 'hidden';
			}
    }
}

function toon_select(){
     if(document.all){
       allSelects = document.getElementsByTagName('select');
       for(var a=0; a<allSelects.length; a++){allSelects[a].style.visibility = 'visible'}
     }
}		 

function win(klnr,dag){
    var winss = null;
    if (winss == null || winss.closed) 
    {
    winss = window.open('stats_dag.php?nr=' + klnr + '&dag=' + dag, 'Rondleiding', 'width=480,height=480,scrollbars=yes,resizable=no');
    }
    else
    {
    winss.focus();
    }
}


function stats_dag(datum){
     document.f_stats_periode.datum_dag.value = datum;
     document.f_stats_periode.submit();		  
}

function stats_on_off(){
     elem=document.getElementById("stats");
     elem2=document.getElementById("statsknop");
     if ( elem.style.display == "block" ){
       elem.style.display="none";
       elem2.value="Statistieken aan";
     } else {
       elem.style.display="block";
       elem2.value="Statistieken uit";
     }
}
