function pic_clicked() {
  g_n++;
  if (g_n>g_pics) g_n=1;
  for (var id=0;id<30;id++) {
    var el=document.getElementById(id);
    el.style.backgroundImage="url(images/"+g_n+".png)";
  }
  Show_class('piece');
  scramble();
  var el=document.getElementById('pic');
  el.src='images/'+g_n+'.png';
  Hide('pic');
}