function link()
 {
  var oldFilename;
  var newFilename;
  var oldURL = document.URL;
  var lastSlash = oldURL.lastIndexOf("/");
  var lastBackslash = oldURL.lastIndexOf("\\");
  var slashPos = lastSlash;
  if (lastBackslash > lastSlash) // Internet Explorer; Windows
   {
    slashPos = lastBackslash;
   }
  oldFilename = oldURL.substr(slashPos + 1);
  newFilename = document.getElementById("select").value;
  if ((newFilename.length != 0) && (newFilename != oldFilename))
   {
    var newURL = oldURL.substr(0,slashPos + 1) + newFilename;
    window.location.href = newURL;
    // window.location.reload(); // IE workaround?
   }
 }