heckboxes_r = r == checkboxData.elems ? 1.0 : -1.0;
    console.log(['click-checkboxes', checkboxes_r, button_state, link_state]);
    if (checkboxes_r == 1.0 && link_state == 1.0 && button_state == 1.0) {
      box_state = 1.0;
    } else {
      box_state = -1.0;
    }
  });


  // click-dialog 
  var dialogDiv = $('#dialog'); 
  if (dialogDiv.length == 0)  div.append('div').attr('id', 'dialog');
  var dialogDiv = $('#dialog');

  createDialog(dialogDiv);

  $('button.ui-button').on('click', function(){ 
