function rock_clicked(image) {
  image.classList.add('move');
}
function door_clicked(image) {
  hide(image.id);
  g_door=false;
  g_layout[9]=[17,8,0,0];
  set_scene(9);
}
function arrow_clicked(image) {
  var id=image.id;
  if (id=='up') var n=0;
  if (id=='right') var n=1;
  if (id=='down') var n=2;
  if (id=='left') var n=3;
  var urdl=g_layout[g_scene];
  var new_scene=urdl[n];
  set_scene(new_scene);
}
function shape_clicked(image) {
  var id=image.id;
  hide(id);
  if (id=='red') g_red=false;
  if (id=='orange') g_orange=false;
  if (id=='yellow') g_yellow=false;
  if (id=='green') g_green=false;
  if (id=='blue') g_blue=false;
  if (id=='indigo') g_indigo=false;
  if (id=='violet') g_violet=false;
  g_count++;
  if (g_count==6) g_layout[8]=[10,7,0,9];
  if (g_count==6) message('Just one colour to find<br>but where can it be?');
  if (g_count==7) message('Return to the start to see the complete rainbow.');
}
function cell_clicked(image) {
  if (image.id==g_colours[g_kount]) {
    hide(image.id);
    g_kount++;
    if (g_kount==7) open_rock();
  } else {
    show_class('cell'); g_kount=0;
  }
}
function open_rock() {
  var rock=document.getElementById('rock');
  rock.classList.add('move');
  g_rock=false;
}
