function saveURL() {
  showDiv(load, true);
  if (adv_app) {
    mf.trans.value = xOpacity(tbase);
    mf.vswipe.value = (xTop('vswiper') + (xHeight('vswiper') / 2)) / xHeight('vswipe_cvs');
    mf.hswipe.value = (xLeft('hswiper') + (xWidth('hswiper') / 2)) / xWidth('hswipe_cvs');
  }
  var s = formToQuery(mf)+'&page='+document.URL.replace('http://'+document.domain, '');
  var xhr = new xHttpRequest();
  if (!xhr.send('POST', bookmark_lib, s, xhrTo, false, false, null, onBookmarkResponse)) gotoError();
  xhr = null;
}

function onBookmarkResponse(req, status, obj) {
  showDiv(load, false);
  if (status == 0) {
    var json = JSON.parse(req.responseText);
    if (json.ok) {
      var url = 'http://' + document.domain + json.url;
      var msg = 'The following URL will reload this map. You can copy and paste it into something (such as an email) or you can ' +
      'load it now and bookmark it in your browser.<br><br><b>' + url + '</b><br><br><a href="javascript: location.href=\'' + url +
      '\'"><span class="smallbutton no">Load now</span></a><br><br><a href="javascript:showDiv(\'saveurl\', false)">' +
      '<span class="smallbutton no">Close</span></a>';
      xInnerHtml('saveurl', msg);
      showDiv('saveurl', true);
    } else alert(json.err);
  } else gotoError();
}