﻿var keyboard = new Class({
    _curKeyboard: false,
    initialize: function () {
        if (!$('prevArrow') || !$('nextArrow')) {
            return;
        }
        var nextUrl = $('nextArrow').get('href');
        var prevUrl = $('prevArrow').get('href');
        this._curKeyboard = new Keyboard({
            defaultEventType: 'keydown',
            events: {
                'right': function () { window.location = nextUrl; this._curKeyboard.deactivate(); } .bind(this),
                'left': function () { window.location = prevUrl; this._curKeyboard.deactivate(); } .bind(this)
            }
        });
        this._curKeyboard.addEvent('keydown', function (e) { this._logKey(e) } .bind(this));
        window.addEvent('load', function () { this._curKeyboard.activate() } .bind(this));
    }
});
