program emSystemsWebsite;

{$R *.dres}

uses
  Vcl.Forms,
  WEBLib.Forms,
  View.Home in 'View.Home.pas' {FHome: TWebForm} {*.html},
  View.PublicSafety in 'View.PublicSafety.pas' {FPublicSafety: TWebForm} {*.html},
  View.RecordsManagement in 'View.RecordsManagement.pas' {FRecordsManagement: TWebForm} {*.html},
  View.CustomSoftware in 'View.CustomSoftware.pas' {FCustomSoftware: TWebForm} {*.html},
  View.AboutUs in 'View.AboutUs.pas' {FAboutUs: TWebForm} {*.html},
  View.ContactUs in 'View.ContactUs.pas' {FContactUs: TWebForm} {*.html},
  Utils in 'Utils.pas';

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;

  asm
    // Set a handler to scroll to top on every hash change
    window.addEventListener('hashchange', function() {
      window.scrollTo(0, 0);
    }, false);

    // Ensure navigation to the home form if no hash is present
    if (window.location.hash === '') {
      window.location.hash = '#FHome';
    }
  end;

  if not Application.Route then
  begin
    Application.CreateForm(TFHome, FHome);
  end;
  Application.Run;
end.