

function newInstance() { //Save 2 DB
  $.ajax({
    type: "POST",
    url: "",
    success: function(res) {
      $("#instance-url").val((window.location.href + "/" + res + "/builder").replace(/([^:]\/)\/+/g, "$1"));
    },
    error: function (request, status, error) {
      alert(request.responseText + status + error);
    }
  });
}

function openInstance() { //Save 2 DB
  if($("#instance-url").val()){
      window.location.replace($("#instance-url").val());
  }
}