
// --------------------------------------------------------
function sortResultList(path)
{
  var sort_elem = path.substring(path.lastIndexOf("/") + 1, path.length);
  var new_loc = window.location.href;
  new_loc = new_loc.replace(/sort=.*&/, "");
//   alert("2sorting request:" + path + " new loc: " + new_loc);
  if (new_loc.lastIndexOf('?') < 0) {
  	new_loc+='?';
  }
  window.location.href = new_loc + "&sort="+sort_elem+"&form=search&db="+MDM_DB;
}

// --------------------------------------------------------
function toggSelResultElem(elem_id, setto)
{
  var win_url = DATA_ENTRY_WEB_ROOT + '/procedures/toggleselectrecord.php';
  win_url += "?id=" + elem_id;
  if(setto != null)
    win_url += "&setto=" + encodeURIComponent(String(setto));
//   alert(win_url);
     
  var target_iframe = null;
  if(MDM_SELECT_TARGET_)
    target_iframe = document.getElementById(MDM_SELECT_TARGET_);
  if(target_iframe)
  {
//   alert("grame: " + elem_id);
    win_url += "&iframe=1";
    target_iframe.src = win_url;
  }
  else
  {
    win_url += "&jsclose=1";
    var win_opts = "";
    win_opts += "width=60";
    win_opts += ",height=30";
    win_opts += ",toolbar=no";
    win_opts += ",menubar=no";
    win_opts += ",scrollbars=no";
    win_opts += ",status=no";
    win_opts += ",location=no";
        //win_opts += "dependent=yes";
    window.open(win_url, "SelectElem", win_opts);
  }
}
