function ShowProgressBar() {
  var ID = (new Date()).getTime() % 1000000000;
  document.radiomixnew.id.value = ID;
  document.radiomixnew.action = "/scripts/upload_radiomix.asp?ID=" + ID;
  var URL = "/scripts/progress.asp?ID=" + ID;
  var Ver = navigator.appVersion;
  var I = Ver.indexOf("MSIE");
  if (I > -1 && Ver.charAt(I + 5) > 4) // IE 5 or later
    window.showModelessDialog(URL, null, "dialogWidth=320px; dialogHeight:170px; help:no; status:no; resizable:yes; scroll:no");
  else
    window.open(URL, "_blank", "left=240,top=240,width=320,height=150,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,directories=no");
}

function GetFileExtension(Filename) {
  var I = Filename.lastIndexOf(".");
  return (I > -1) ? Filename.substring(I + 1, Filename.length).toLowerCase() : "";
}

function BeforeSubmit() {
  var Form = document.radiomixnew;
  var dateipfad = Form.dateipfad.value;
  var Ext = "";
  if (dateipfad == "") { alert("Bitte eine MP3 Datei auswählen"); return false; }
  // The following html validation of file types serves as just a reminder for careless users (not a security measure).
  // In order to ENSURE users can upload only allowed file types, you must set ValidFileTypes property in "Example3.asp".
  if (dateipfad != "") {
    Ext = GetFileExtension(dateipfad);
    if (Ext != "mp3") { alert("Bitte wählen Sie eine gültige MP3 Datei aus!"); return false; }
  }
  ShowProgressBar();
  return true;
}
