function bookmarkHomepage(pTitle) {
  try {
    window.sidebar.addPanel(pTitle, window.document.URL, '');
    return;
  } catch (Err) {}
  try {
    window.external.AddFavorite(window.document.URL, pTitle);
    return;
  } catch (Err) {}
  try { 
    var Elem = window.document.createElement('a');
	Elem.setAttribute('href', window.document.URL);
	Elem.setAttribute('rel', 'sidebar');
	Elem.setAttribute('title', pTitle);
	Elem.click();
	return;
  } catch (Err) {}
}

function doConfirmActionDeleteBoard(pMsg, pIndex) {
  loadPageConfirm(pMsg, '&action=deleteboard&index=' + pIndex);
}

function doPopupActionSend(pMsg, pDestUmi, pIndex) {
  var List = getAllOptSelValues(formByIndex(1).elements['users']);
  if (List.length > 0 && confirm(pMsg)) {
    goOpener('index.php?umi=' + pDestUmi + '&action=send&index=' + pIndex + '&selusers=' + encodeURIComponent(List.join('|')));
    window.close();
  }
}

function doPromptActionAddBoard(pMsg) {
  var S = prompt(pMsg, '');
  if (S != null && S != '') {
    formByName('board').elements['text'].value = S;
    submitFormIndicator('board');
  }
}

function selGroup(pOpt) {
  var Elem = formByName('groups').elements['groupname'];
  if (!Elem.checked)
    Elem[pOpt].checked = true;
  submitForm('groups');
}

function viewInfoBoxEvent(pIndex) {
  if (pIndex != '-1')
    viewInfoBox('event' + pIndex, 'plain.php?umi=org_calendar&page=event.info&index=' + pIndex);
}