function Zegar(){
var T,G,M,S,s;
T=new Date();
G=T.getHours();
M=T.getMinutes();
S=T.getSeconds();
s=" "+G;
s+=(M<10?":0":":")+M;
s+=(S<10?":0":":")+S;
Pisz(s);
 function Pisz(co){
 co="<span class="+ZegStyl+">"+co+" </span>";
 var d=document;
 if(d.layers)with(d.layers["zegar"]){
 document.write(co);document.close();return}
 if(d.getElementById){d.getElementById("zegar").innerHTML=co;return}
 if(d.all)d.all["zegar"].innerHTML=co;
}}

// Tutaj wybierasz rodzaj zegarka, czyli jak ma wyglądać...
// Wybierasz i wpisujesz od z1 do z4, domyślna to z1

ZegStyl="z1";

startday = new Date();
clockStart = startday.getTime();
function initStopwatch()
{
 var myTime = new Date();
        var timeNow = myTime.getTime();
        var timeDiff = timeNow - clockStart;
        this.diffSecs = timeDiff/1000;
        return(this.diffSecs);
}
function getSecs()
{
        var mySecs = initStopwatch();
        var mySecs1 = ""+mySecs;
        mySecs1= mySecs1.substring(0,mySecs1.indexOf("."));
//        document.stoper.czas.value=mySecs1;
//        window.setTimeout('getSecs()',1000);
       sek=mySecs1%60;
       mySecs2=(mySecs1-sek)/60;
       if (mySecs1>=60) {min=mySecs2%60 } else {min=0}
       mySecs3=(mySecs2-min)/60;
       if (mySecs2>=60) {godz=mySecs3} else {godz=0}
    var timeValue = " ";
    timeValue  += ((godz < 10) ? "0" : "") + godz;
    timeValue  += ((min < 10) ? ":0" : ":") + min;
    timeValue  += ((sek < 10) ? ":0" : ":") + sek;

    document.form.czas_testu.value = timeValue;
        window.setTimeout('getSecs()',1000);

//       if (mySecs1==60) {alert("jesteś tutaj już 60 sekund ...") }
//       if (mySecs1==333) {alert("jesteś tutaj już 333 sekundy...") }
//        if (mySecs1==666) {alert("jesteś tutaj już 666 sekund ...") }
//        if (mySecs1==999) {alert("Ciągle jesteś zainteresowany tą stroną; to już 999 sekund...") }
}






var timerID = null;
var timerRunning = false;
function stopclock()
{
    if(timerRunning)
    clearTimeout(timerID)
    timerRunning = false;
}

function startclock()
{
    stopclock();
    showtime();
}

function showtime()
{
    var now = new Date();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    var timeValue = "" + hours;
    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes;
    timeValue  += ((seconds < 10) ? ":0" : ":") + seconds;
//    timeValue  += (hours >= 12) ? " P.M." : " A.M.";
    document.form.face.value = timeValue;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true;
}
