// Check whether IE4 or later.
         var MS = navigator.appVersion.indexOf("MSIE");
         window.isIE4 = (MS > 0) &&
            (parseInt(navigator.appVersion.substring(MS + 5, MS + 6)) 
               >= 4);

        function lead0(val) {
            // Add leading 0s when necessary.
            return (val < 10) ? "0" + val.toString() : val;
         }

        function buildTime()
	{
	    var h_gmt = "";
	    var time = new Date();
            var h = time.getHours();
	    var TZ = time.getTimezoneOffset() / 60;

 	if (TZ <= 0) 
	{
	    if (h <= Math.abs(TZ))
	    {
	    h_gmt = h + TZ + 24;
	    }
	    else
	    {
	    h_gmt = h + TZ;
            }	
	return "Время местное: " + lead0(h) + ":" + lead0(time.getMinutes()) + ":" + lead0(time.getSeconds()) + " ( GMT+" + (-1*TZ) + ".00" + " )" + "   Время GMT: " + lead0(h_gmt) + ":" + lead0(time.getMinutes()) + ":" + lead0(time.getSeconds());	
	}
	else
	{
	    if (h >= Math.abs(TZ))
	    {
	    h_gmt = h + Math.abs(TZ) - 24;
	    }
	    else
	    {
	    h_gmt = h + Math.abs(TZ);
	    }
	return "Время местное: " + lead0(h) + ":" + lead0(time.getMinutes()) + ":" + lead0(time.getSeconds()) + " ( GMT-" + TZ + ".00" + " )" +  "   Время GMT: " + lead0(h_gmt) + ":" + lead0(time.getMinutes()) + ":" + lead0(time.getSeconds());	
	}	
	}

         function tick() {
            // Replace the clock's time with the current time.
            document.all.clock.innerText = buildTime();
         }