// NUMBER - returns a string in place of a number
function number(x) {
        if (x==1) return "1:00"; if (x==2) return "2:00"; if (x==3) return "3:00";
        if (x==4) return "4:00"; if (x==5) return "5:00"; if (x==6) return "6:00";
        if (x==7) return "7:00"; if (x==8) return "8:00"; if (x==9) return "9:00";
        if (x==10) return "10:00"; if (x==11) return "11:00"; if (x==12) return "12:00";
        return x; //default
}
function ishtime(h,m)
{
        h = number(h)
        if (m<=3 || m>57) return h+" Uhr";
    if (m<=7)  return "5 Minuten nach "+h;
    if (m<=12) return "10 Minuten nach "+h;
    if (m<=17) return "15 Minuten nach "+h;
    if (m<=23) return "20 Minuten nach "+h;
    if (m<=28) return "25 Minuten nach "+h;
    if (m<=33) return "30 Minuten nach "+h;
    if (m<=38) return "25 Minuten vor "+h;
    if (m<=43) return "20 Minuten vor "+h;
    if (m<=48) return "15 Minuten vor "+h;
    if (m<=53) return "10 Minuten vor "+h;
    if (m<=58) return "5 Minuten vor "+h;
        return "h:m"; // nie erreichte?
}
function daytime(h) {
        if (!h || h>21) return " in der Nacht"
        if (h<12) return "";
        if (h<=17) return " am Nachmittag";
        return " am Abend"; // default
}
function ish(h,m) {
        if (!h && !m) { // if no time supplied, use the system time
                time = new Date()
                h = time.getHours()
                m = time.getMinutes()
}
        z = daytime(h);
        h = h % 12 // fix to 12 hour clock
        if (m>57 && time.getSeconds()>30) m++; // round seconds
        if (m>60) m=0 // round up minutes
        if (m>33) h++ // round up hours
    if (h>12)  h = 1 // the clock turns round..
    if (h==0) h = 12
return "<FONT SIZE=-1><font face=Arial, Helvetica, sans-serif>Es ist jetzt nach meiner Sanduhr, "+ishtime(h,m)+z+".</font></font>"
}
