var Paginator = new function() {
    this.prev_id = 'prev_page';
    this.next_id = 'next_page';
    
    this.register = function(e) {
        var code;
        if (!e) var e = window.event;
        if (e.keyCode) code = e.keyCode;
        else if (e.which) code = e.which;
    
        if ((code == 37) && (e.ctrlKey == true)) {
            var destination = document.getElementById(this.prev_id);
            if (destination) {
                location.href = destination.href;
            }
        }
        if ((code == 39) && (e.ctrlKey == true)) {
            var destination = document.getElementById(this.next_id);
            if (destination) {
                location.href = destination.href;
            }
        }
    }
    
    document.onkeydown = function(e) {
        Paginator.register(e);
    }
}();

