function url_param (name) {
  var str     = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex   = new RegExp("[\\?&]"+ str +"=([^&#]*)");
  var results = regex.exec(window.location.href);
  return results == null ? "" : results[1];
}


function maybe_show_page () {
  var pg = url_param('pg');

  if (pg) iui.showPageById(pg);
}
