function updateClock ( )
{
  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  // Choose either "AM" or "PM" as appropriate
  //var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  // Convert the hours component to 12-hour format if needed
  //currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  // Convert an hours component of "0" to "12"
  //currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  // Compose the string for display
  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds;

  // Update the time display
  document.getElementById("clock").innerHTML = currentTimeString;
  
  var month=new Array(12);
  
  switch (language) {
      case "en":
         month[0]="January";
         month[1]="February";
         month[2]="March";
         month[3]="April";
         month[4]="May";
         month[5]="June";
         month[6]="July";
         month[7]="August";
         month[8]="September";
         month[9]="October";
         month[10]="November";
         month[11]="December";
         break;
      case "fr":
         month[0]="janvier";
         month[1]="février";
         month[2]="mars";
         month[3]="avril";
         month[4]="mai";
         month[5]="juin";
         month[6]="juillet";
         month[7]="août";
         month[8]="septembre";
         month[9]="octobre";
         month[10]="novembre";
         month[11]="décembre";
         break;
      case "de":
         month[0]="Januar";
         month[1]="Febraur";
         month[2]="März";
         month[3]="April";
         month[4]="Mai";
         month[5]="Juni";
         month[6]="Juli";
         month[7]="August";
         month[8]="September";
         month[9]="Oktober";
         month[10]="November";
         month[11]="Dezember";
         break;
      case "ru":
         month[0]="Январь";
         month[1]="Февраль";
         month[2]="Март";
         month[3]="Апрель";
         month[4]="Май";
         month[5]="Июнь";
         month[6]="Июль";
         month[7]="Август";
         month[8]="Сентябрь";
         month[9]="Октябрь";
         month[10]="Ноябрь";
         month[11]="Декабрь";
         break;
      default:
         month[0]="stycznia";
         month[1]="lutego";
         month[2]="marca";
         month[3]="kwietnia";
         month[4]="maja";
         month[5]="czerwca";
         month[6]="lipca";
         month[7]="sierpnia";
         month[8]="września";
         month[9]="października";
         month[10]="listopada";
         month[11]="grudnia";
         break;
  }
  


var currentDateString = currentTime.getDate() + " "+ month[currentTime.getMonth()] + " " + currentTime.getFullYear();

document.getElementById("calendar").innerHTML = currentDateString;
}
