var KeyCommand = Class.create();

KeyCommand.prototype = {
  initialize: function() {
    this.map = [];
    this.key_history = '';
    Event.observe(document, 'keyup', this.observer.bind(this));
  },

  observer: function (event) {
    this.key_history += "/" + event.keyCode;
    
    for(i=0, len=this.map.length; i < len; i++) {
      if (this.key_history.indexOf(this.map[i].command) > -1) {
        this.map[i].callback();
        this.key_history = "";
      }
    }
  },
  
  set_command: function (command, callback) {
    this.map.push({
      command: command,
      callback: callback
    });
  }
}


	var cmd = new KeyCommand;
	cmd.set_command("/38/38/40/40/37/39/37/39/66/65", kakushi);
	cmd.set_command("/38/38/40/40/76/82/76/82/66/65", kakushi);


function kakushi(){
	location.href = 'submit.html';
}
