function cell_clicked(el) {
  if (el.style.borderColor!='green') {
    if (g_cell1=='') { // first click
      g_cell1=el; // remember
      el.style.borderColor='blue'; // mark
    } else {
      if (g_cell1==el) { // re-click of same cell
        g_cell1='';
        el.style.borderColor='lightgrey';
      } else { // check legal
        if (el.className==g_cell1.className) {
          g_cell1.style.borderColor='lightgrey';
          var temp=el.textContent; // swap
          el.textContent=g_cell1.textContent;
          g_cell1.textContent=temp;
          g_cell1=''; // forget
          words_check();
        }
      }
    }
  }
}