unit Unit9;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, OleCtrls, SHDocVw, StdCtrls,shellapi;

type
  TForm9 = class(TForm)
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N11: TMenuItem;
    N13200620071: TMenuItem;
    N21: TMenuItem;
    N211: TMenuItem;
    N221: TMenuItem;
    N31: TMenuItem;
    N311: TMenuItem;
    N41: TMenuItem;
    N411: TMenuItem;
    N51: TMenuItem;
    N511: TMenuItem;
    N521: TMenuItem;
    N61: TMenuItem;
    N611: TMenuItem;
    N621: TMenuItem;
    N71: TMenuItem;
    N711: TMenuItem;
    N721: TMenuItem;
    N731: TMenuItem;
    N81: TMenuItem;
    N91: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    WebBrowser1: TWebBrowser;
    N321: TMenuItem;
    N421: TMenuItem;
    N431: TMenuItem;
    N811: TMenuItem;
    N821: TMenuItem;
    N911: TMenuItem;
    N921: TMenuItem;
    N6: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    N10: TMenuItem;
    N101: TMenuItem;
    N112: TMenuItem;
    N122: TMenuItem;
    N131: TMenuItem;
    N141: TMenuItem;
    N151: TMenuItem;
    N12: TMenuItem;
    N13: TMenuItem;
    N14: TMenuItem;
    N92: TMenuItem;
    N93: TMenuItem;
    N102: TMenuItem;
    N103: TMenuItem;
    N104: TMenuItem;
    N105: TMenuItem;
    N152: TMenuItem;
    N111: TMenuItem;
    N142: TMenuItem;
    N153: TMenuItem;
    N15: TMenuItem;
    N132: TMenuItem;
    N133: TMenuItem;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure svChange(Sender: TObject);
    procedure N4Click(Sender: TObject);
    procedure N5Click(Sender: TObject);
    procedure FormResize(Sender: TObject);
    procedure FormShow(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form9: TForm9;
  sPath:String[60];
  path,path1: string;
  glav:boolean;
  i:integer;
  ddd:string;

implementation

uses Unit8, Unit5, Unit3, Unit2, Unit4;

{$R *.dfm}

procedure TForm9.FormClose(Sender: TObject; var Action: TCloseAction);
begin
form8.Visible:=true;
end;

procedure TForm9.FormCreate(Sender: TObject);
begin
  GetDir(0,sPath);
 webbrowser1.Height:=form3.Height-80;
 webbrowser1.Width :=form3.Width-10;
end;

procedure TForm9.svChange(Sender: TObject);
var   p2: array[0..100] of Char;
begin
  glav:=false;
case (Sender as TMenuItem).Tag of
2,3,4,5,6,7,8,9:
  begin
    datamodule5.ADOTable2.Edit;
    datamodule5.DataSource2.DataSet.fieldbyname('glava').AsString:=(Sender as TMenuItem).Parent.caption+(Sender as TMenuItem).Caption;;
    datamodule5.ADOTable2.Post;
    path:=spath+'\web_kz\'+(Sender as TMenuItem).Parent.caption+'.htm'+'#a'+inttostr((Sender as TMenuItem).Tag-1);
    form9.WebBrowser1.Navigate(ExpandUNCFileName(path));
    form8.statusbar1.Panels[2].Text:=datamodule5.DataSource2.DataSet.fieldbyname('user').AsString;
    form8.statusbar1.Panels[4].Text:=datamodule5.DataSource2.DataSet.fieldbyname('glava').AsString;
  end;
1:
  begin
    datamodule5.ADOTable2.Edit;
    datamodule5.DataSource2.DataSet.fieldbyname('glava').AsString:=(Sender as TMenuItem).Parent.caption+(Sender as TMenuItem).Caption;;
    datamodule5.ADOTable2.Post;
    path:=spath+'\web_kz\'+(Sender as TMenuItem).caption+'.htm';
    form9.WebBrowser1.Navigate(ExpandUNCFileName(path));
    form8.statusbar1.Panels[2].Text:=datamodule5.DataSource2.DataSet.fieldbyname('user').AsString;
    form8.statusbar1.Panels[4].Text:=datamodule5.DataSource2.DataSet.fieldbyname('glava').AsString;
  end;
21,22,23,24,25:
  begin
    path:=spath+'\video\'+inttostr((Sender as TMenuItem).tag-20) +'.avi';
    StrPcopy(p2, path);
    ShellExecute(Handle, nil, p2, nil, nil, SW_SHOW);
  end;
  end;
end;

procedure TForm9.N4Click(Sender: TObject);
begin
 if form8.Visible then
  begin
  form8.Visible:=false;
  form4.Tag:=4
  end
  else
  begin
   form9.Visible:=false;
   form4.Tag:=5;
  end;
 form9.Visible:=false;
 form4.SpeedButton20.Caption :='Тесті аяќтау';
 form4.Label1.Caption:='20 ден 1';
 //form4.DBText1.Left :=150;
 form4.Label1.Left:=80;
 form4.visible:=true;
end;

procedure TForm9.N5Click(Sender: TObject);
begin
close;
end;

procedure TForm9.FormResize(Sender: TObject);
begin
 webbrowser1.Height:=form9.Height-80;
 webbrowser1.Width :=form9.Width-10;
end;

procedure TForm9.FormShow(Sender: TObject);
var r: TRect;
    xl,yt:integer;
begin
  SystemParametersInfo(SPI_GETWORKAREA, 0, @r, 0);
  xl:=r.Bottom;
  yt:=r.Right;
left:=0;
top:=0;
width:=yt;
height:=xl;
end;


end.
