Bimba.git

ref: v2.1

research/PDP


function draw_clock() {
    var n, r, t;
    for (canvas = Raphael("analog", 100, 100), n = canvas.circle(25, 25, 23), n.attr({
            fill: "#F9F9F9",
            stroke: "#003A7D",
            "stroke-width": "2"
        }), i = 0; i < 12; i++) {
        var u = 25 + Math.round(18 * Math.cos(30 * i * Math.PI / 180)),
            f = 25 + Math.round(18 * Math.sin(30 * i * Math.PI / 180)),
            e = 25 + Math.round(22 * Math.cos(30 * i * Math.PI / 180)),
            o = 25 + Math.round(22 * Math.sin(30 * i * Math.PI / 180));
        r = canvas.path("M" + u + " " + f + "L" + e + " " + o)
    }
    hour_hand = canvas.path("M 25 25 L 25 15");
    hour_hand.attr({
        stroke: "#003A7D",
        "stroke-width": 2
    });
    minute_hand = canvas.path("M 25 25 L 25 10");
    minute_hand.attr({
        stroke: "#444444",
        "stroke-width": 1
    });
    second_hand = canvas.path("M 25 30 L 25 8");
    second_hand.attr({
        stroke: "#003A7D",
        "stroke-width": .5
    });
    t = canvas.circle(25, 25, 1);
    t.attr("fill", "#003A7D");
    update_clock();
    setInterval("update_clock()", 1e3)
}

function update_clock() {
    var r = dateTimeFromServer - dateTimeFromClient,
        u = (new Date).getTime(),
        t = new Date;
    t.setTime(u + r);
    var n = t,
        f = n.getHours(),
        i = n.getMinutes(),
        e = n.getSeconds();
    hour_hand.rotate(30 * f + i / 2.5, 25, 25);
    minute_hand.rotate(6 * i, 25, 25);
    second_hand.rotate(6 * e, 25, 25)
}

function indirectStation() {
    var i = $(".route ").find(".subRow").length,
        n = $("#indirect"),
        r = $("#newIndirect"),
        u = '