function isUrl(s) {
  var regexp = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
  return regexp.test(s);
}

function nav(sel) {
  if (sel.selectedIndex == -1) return;
  var opt = sel.options[sel.selectedIndex];
  // Make sure opt.value is a URL before jumping to the selected page
  if (opt && isUrl(opt.value)) location.href = opt.value;
}

