
/* Techgua */

/* showClock() function extracts the current time hours, minutes and seconds and then displays them in the div with showText id from the BODY section */
function showClock()
{
    var clock=new Date();
    var day = clock.getDay();
    var date = clock.getDate()
    var month = clock.getMonth();
    var year = clock.getFullYear();
    var hours=clock.getHours();
    var minutes=clock.getMinutes();
    var seconds=clock.getSeconds();
    var days=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
    var months=new Array("January","February","March","April","May","June","July","August","September","Octomber","November","December")
    // for a nice disply we'll add a zero before the numbers between 0 and 9
    if (hours<10){
    hours="0" + hours;
    }
     if (minutes<10){
        minutes="0" + minutes;
    }
    if (seconds<10){
        seconds="0" + seconds;
    }
    if (hours>12)
   {
        hours = hours - 12;
    }
    document.getElementById('showDate').innerHTML=days[day]+", "+months[month]+" "+date+" "+year+" - "+hours+":"+minutes+":"+seconds;
    t=setTimeout('showClock()',500);
    /* setTimeout() JavaScript method is used to call showClock() every 1000 milliseconds (that means exactly 1 second) */
}