var s = "Θρρλεδσι!";
var cp = 0;


if (navigator.appName != "Microsoft Internet Explorer") {
    document.captureEvents(Event.KEYDOWN);
}
document.onkeydown = keyDown;

$(function () {
    $("#info").text(s);
    $('div > a > img').each(function (index) {

        $(this).mouseover(function () {
            $(this).attr("src", $(this).parent().parent().attr("id") + ".gif");
            $("#info").text($(this).attr("rel"));
        });

        $(this).mouseout(function () {
            $(this).attr("src", "o.gif");
            $("#info").text(s);
        });
    });
}
);

function keyDown(ev) {

    var key = (navigator.appName != "Microsoft Internet Explorer") ? ev.keyCode : window.event.keyCode;

    if ((key == 38 && (cp == 0 || cp == 1)) ||
       (key == 40 && (cp == 2 || cp == 3)) ||
	   (key == 37 && (cp == 4 || cp == 6)) ||
	   (key == 39 && (cp == 5 || cp == 7)) ||
	   (key == 66 && cp == 8)) {
        cp++;
    }
    else if (key == 65 && cp == 9) {
        cp = 0;

        $('div > a > img').each(function (index) {
            $(this).attr("src", $(this).parent().parent().attr("id") + ".gif");
        });

        t = setTimeout("ololo_hide()", 8000);
    } else cp = 0;
}

function ololo_hide() {
    $('div > a > img').each(function (index) {
        $(this).attr("src", "o.gif");
    });
}

