procedure TForm1.WebBrowser1BeforeNavigate2(Sender: TObject;
const pDisp: IDispatch
var URL, Flags, TargetFrameName, PostData,
Headers: OleVariant
var Cancel: WordBool);
begin
if(Pos('FORM2',UpperCase(URL))<>0) then
begin
Form2:=TForm2.Create(Self);
Form2.ShowModal;
Form2.Free;
cancel:=true;
end;
end;