
function Afterload()
{
  window.fullscreen="yes";
  var mainFrame  = document.getElementById("mainframe");

  //************************************************************
  // WSH Detection
  //************************************************************
  
  try {
    var shell = new ActiveXObject("WScript.Shell");
    mainFrame.innerHTML="<iframe id=\"frameMain\" src=\".\\menu.html\" APPLICATION=\"yes\" width=\"100%\" height=\"100%\" frameborder=\"no\" marginheight=\"5\" marginwidth=\"5\"></iframe>";
  }catch(exception) {
    mainFrame.innerHTML="<iframe id=\"frameMain\" src=\".\\noshell.html\" APPLICATION=\"yes\" width=\"100%\" height=\"100%\" frameborder=\"no\" marginheight=\"5\" marginwidth=\"5\"></iframe>";
  }

  //***********************************************************
  // Platform Detection and Administrator Account Check
  //***********************************************************

  var env = shell.Environment("SYSTEM");
  var osEnv = env("OS");
  if(osEnv.match(/Windows_NT/)){
    var fso = new ActiveXObject("Scripting.FileSystemObject"); 
    deskTop = shell.SpecialFolders("AllUsersDesktop");
    var forWriting = 2;
    try{
      var testFile = fso.OpenTextFile(deskTop + "\\startsafe-test-file.txt", forWriting, true, true);
      testFile.Close();
      testFile=fso.GetFile(deskTop + "\\startsafe-test-file.txt");
      testFile.Delete();
    }catch(exception){
      mainFrame.innerHTML="<iframe id=\"frameMain\" src=\".\\noadmin.html\" APPLICATION=\"yes\" width=\"100%\" height=\"100%\" frameborder=\"no\" marginheight=\"5\" marginwidth=\"5\"></iframe>";
    }
  }
  delete shell;
  delete fso;
}

