function dayofweek (day) {

  switch (day){
    case 0:
      return("Zondag");
    case 1:
      return("Maandag");
    case 2:
      return("Dinsdag");
    case 3:
      return("Woensdag");
    case 4:
      return("Donderdag");
    case 5:
      return("Vrijdag");
    case 6:
      return("Zaterdag");
    default:
      return("Error");
  }

}



function monthofyear (month) {

  switch (month){
    case 0:
      return("januari");
    case 1:
      return("februari");
    case 2:
      return("maart");
    case 3:
      return("april");
    case 4:
      return("mei");
    case 5:
      return("juni");
    case 6:
      return("juli");
    case 7:
      return("augustus");
    case 8:
      return("september");
    case 9:
      return("oktober");
    case 10:
      return("november");
    case 11:
      return("december");
    default:
      return("Error");
  }

}



function clock() {

  // Retrieve local time.
  var now = new Date();

  // Convert local time to proper format for output:
  LocalTime =(now.getHours() < 10 ? "0" : "") + now.getHours() + ":" + (now.getMinutes() < 10 ? "0" : "") + now.getMinutes();
  
  // Convert day to proper format for output:
  LocalDay = dayofweek(now.getDay());
  
  // Replace the contents of the html element which matches the "id" value:
  document.getElementById("local").firstChild.nodeValue = LocalDay + ", " + now.getDate() + " " + monthofyear(now.getMonth()) +
							  " " + now.getFullYear() + ", " + LocalTime;
}
