unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, OleCtrls, SHDocVw, sSkinManager, StdCtrls, sButton, ComCtrls,
  sTreeView, Menus, shellAPI, sStatusBar, ExtCtrls, sSkinProvider,
  sToolBar, ToolWin, acCoolBar, sEdit;

type
  TForm1 = class(TForm)
    sSkinManager1: TsSkinManager;
    WebBrowser1: TWebBrowser;
    sTreeView1: TsTreeView;
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    N7: TMenuItem;
    N11: TMenuItem;
    N21: TMenuItem;
    CSS1: TMenuItem;
    WEBMSWord1: TMenuItem;
    sStatusBar1: TsStatusBar;
    Timer1: TTimer;
    sSkinProvider1: TsSkinProvider;
    N8: TMenuItem;
    N9: TMenuItem;
    N10: TMenuItem;
    N12: TMenuItem;
    N13: TMenuItem;
    N14: TMenuItem;
    N15: TMenuItem;
    MetaLinkBase1: TMenuItem;
    HTML1: TMenuItem;
    procedure FormCreate(Sender: TObject);
    procedure sTreeView1Change(Sender: TObject; Node: TTreeNode);
    procedure N4Click(Sender: TObject);
    procedure N5Click(Sender: TObject);
    procedure N6Click(Sender: TObject);
    procedure N7Click(Sender: TObject);
    procedure N11Click(Sender: TObject);
    procedure N21Click(Sender: TObject);
    procedure CSS1Click(Sender: TObject);
    procedure WEBMSWord1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure N1Click(Sender: TObject);
    procedure N13Click(Sender: TObject);
    procedure N12Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure N10Click(Sender: TObject);
    procedure N14Click(Sender: TObject);
    procedure N15Click(Sender: TObject);
    procedure MetaLinkBase1Click(Sender: TObject);
    procedure HTML1Click(Sender: TObject);
    procedure N23Click(Sender: TObject);
    procedure WebBrowser1BeforeNavigate2(Sender: TObject;
      const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
      Headers: OleVariant; var Cancel: WordBool);
    procedure N9Click(Sender: TObject);
//    procedure N2Click(Sender: TObject);
  private
     { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  s: String;
  q:integer;
  ToggleURL:string;
implementation

uses Unit2, Unit3, Unit4, Unit5;

{$R *.dfm}


procedure TForm1.FormCreate(Sender: TObject);
begin
WebBrowser1.Navigate(ExtractFilePath(ParamStr(0))+'txt\test.htm');
end;

procedure TForm1.N1Click(Sender: TObject);
begin
If Form1.N1.Caption='Скрыть оглавление  ' then begin
N1.Caption:='Показать оглавление';
sTreeView1.Visible:=false;
WebBrowser1.Left:=WebBrowser1.Left-255;
WebBrowser1.Width:=WebBrowser1.Width+255;
end else begin
N1.Caption:='Скрыть оглавление  ';
sTreeView1.Visible:=true;
WebBrowser1.Left:=WebBrowser1.Left+255;
WebBrowser1.Width:=WebBrowser1.Width-255;
end;
end;

procedure TForm1.sTreeView1Change(Sender: TObject; Node: TTreeNode);
begin
s:=ExtractFilePath(Application.ExeName);
case sTreeView1.Selected.AbsoluteIndex of

1: WebBrowser1.Navigate(ExtractFilePath(ParamStr(0))+'lec\text1.htm');
2: WebBrowser1.Navigate(s+'lec\text2.htm');
3: WebBrowser1.Navigate(s+'lec\text3.htm');
4: WebBrowser1.Navigate(s+'lec\text4.htm');
5: WebBrowser1.Navigate(s+'lec\text5.htm');
6: WebBrowser1.Navigate(s+'lec\text6.htm');
7: WebBrowser1.Navigate(s+'lec\text7.htm');
8: WebBrowser1.Navigate(s+'lec\text8.htm');
9: WebBrowser1.Navigate(s+'lec\text9.htm');
10: WebBrowser1.Navigate(s+'lec\text10.htm');
11: WebBrowser1.Navigate(s+'lec\text11.htm');
12: WebBrowser1.Navigate(s+'lec\text12.htm');
13: WebBrowser1.Navigate(s+'lec\text13.htm');
14: WebBrowser1.Navigate(s+'lec\text14.htm');
15: WebBrowser1.Navigate(s+'lec\text15.htm');

17: WebBrowser1.Navigate(ExtractFilePath(ParamStr(0))+'umkd\p1.htm');
18: WebBrowser1.Navigate(s+'umkd\p2.htm');
19: WebBrowser1.Navigate(s+'umkd\p3.htm');
20: WebBrowser1.Navigate(s+'umkd\p4.htm');
21: WebBrowser1.Navigate(s+'umkd\p5.htm');
22: WebBrowser1.Navigate(s+'umkd\p6.htm');
23: WebBrowser1.Navigate(s+'umkd\p7.htm');
24: WebBrowser1.Navigate(s+'umkd\p8.htm');
25: WebBrowser1.Navigate(s+'umkd\p9.htm');

27: WebBrowser1.Navigate(ExtractFilePath(ParamStr(0))+'umkd\c1.htm');
28: WebBrowser1.Navigate(s+'umkd\c2.htm');
29: WebBrowser1.Navigate(s+'umkd\c3.htm');
30: WebBrowser1.Navigate(s+'umkd\c4.htm');
31: WebBrowser1.Navigate(s+'umkd\c5.htm');

32: WebBrowser1.Navigate(s+'umkd\syillabus.htm');

33: WebBrowser1.Navigate(s+'umkd\kurs.htm');

35: WebBrowser1.Navigate(s+'umkd\RK1.htm');
36: WebBrowser1.Navigate(s+'umkd\RK2.htm');
37: WebBrowser1.Navigate(s+'umkd\vopr.htm');

end;
end;

procedure TForm1.N4Click(Sender: TObject);
begin
 ShellExecute(handle,'open','Present\avotr_resh.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.N5Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\avtor.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.N6Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\document.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.N7Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\format.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.N11Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\mikro.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.N21Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\podg.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.CSS1Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\pryamoi.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.WEBMSWord1Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\radoi.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
sStatusBar1.Panels[0].Text:= TimeToStr(now);
sStatusBar1.Panels[1].Text:= DateToStr(now);
end;



{procedure TForm1.N3Click(Sender: TObject);
begin
 WebBrowser1.Navigate(ExtractFilePath(ParamStr(0))+'txt\html-gloss.htm');
end;}

procedure TForm1.N13Click(Sender: TObject);
begin
close;
end;

procedure TForm1.N12Click(Sender: TObject);
begin
shellexecute(form1.Handle,'open',pansichar(extractfilepath(paramstr(0))+'test\tester.exe'),nil,nil,0);
end;


procedure TForm1.FormShow(Sender: TObject);
begin
Form2.Show;
end;

procedure TForm1.N10Click(Sender: TObject);
begin
form3.show;
end;

procedure TForm1.N14Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\reklama.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.N15Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\SMI.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.MetaLinkBase1Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\sredstva.pps',nil,nil,SW_RESTORE);
end;

procedure TForm1.HTML1Click(Sender: TObject);
begin
ShellExecute(handle,'open','Present\zhanr.pps',nil,nil,SW_RESTORE);
end;




procedure TForm1.N23Click(Sender: TObject);
begin
shellexecute(handle,pansichar('open'),pansichar('12345'),pansichar(extractfilename(toggleurl)),pansichar(extractfilepath(toggleurl)),sw_shownormal);
end;

procedure TForm1.WebBrowser1BeforeNavigate2(Sender: TObject;
  const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
  Headers: OleVariant; var Cancel: WordBool);
begin
toggleurl:=url;
end;

procedure TForm1.N9Click(Sender: TObject);
begin
form5.show;
end;


end.
