function check_online() {
    $(".comp_img").each(function(index, value) {
        var obj = $(this);
        id = $(this).attr('alt');
        $.get('/navigator/computer/online/small/'+id+'/', {},
              function(data) {
                  if (data.image != obj.attr('src')) {
                    obj.attr("src", data.image);
                  }
                  obj.parent().find(".computer-os").html(data.computer_os);
                  obj.parent().find(".status").html(data.status);
              }, "json");
    });

    $(".comp_img_big").each(function(index, value) {
        var obj = $(this);
        id = $(this).attr('alt');
        $.get('/navigator/computer/online/big/'+id+'/', {},
              function(data) {
                  if (data.image != obj.attr('src')) {
                    obj.attr("src", data.image);
                  }
                  obj.parent().parent().find(".computer-os").html(data.computer_os);
                  obj.parent().parent().find(".status").html(data.status);
              }, "json");
    });
    setTimeout("check_online()", 3000);
}

$(window).load(function(){
    var size = 0;
    objs = $(".organizativeunit a, .computer a");
    $.each(objs, function(index, value) {
          s = $(this).css("height");
          s = parseFloat(s);
          if (s > size)
              size = s;
    });

    $.each(objs, function(index, value) {
          $(this).css("height", size);
    });

    check_online();
});
