home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 February
/
PCWorld_2005-02_cd.bin
/
komunikace
/
slim
/
sbsetup.exe
/
ExtractSearchEngine.js
< prev
next >
Wrap
Text File
|
2003-06-20
|
984b
|
52 lines
ExtractSearchEngine();
function ExtractSearchEngine()
{
var topBody = top.document.body;
var vForm=GetActiveForm();
var vDoc=eval(vForm.path+".document");
vDoc.activeElement.value="sbTestKeyword";
topBody.sbFormMethod=vForm.method;
topBody.sbActiveForm=vForm;
SubmitForm(vForm);
}
function GetActiveForm()
{
var vForm;
vForm=GetActiveFormEx("top",true);
if (vForm==null) vForm=GetActiveFormEx("top",false);
return vForm;
}
function GetActiveFormEx(path,bActive)
{
var vWindow=eval(path);
var vDocument=vWindow.document;
var vForm;
if (bActive)
{
vForm=vDocument.activeElement.form;
if (vForm!=null)
{
vForm.path=path;
return vForm;
}
}
else
{
vForm=vDocument.forms[0];
if (vForm!=null)
{
vForm.path=path;
return vForm;
}
}
for(var i=0; i<vWindow.frames.length; i++ )
{
vForm=GetActiveFormEx(path+".frames["+i+"]",bActive);
if (vForm!=null) return vForm;
}
return null;
}