VAR NS4 = (Document.Layers);
Var IE4 = (Document.all);
Var win = window;
VAR n = 0;
Function FindinPage (STR) {
VAR TXT, I, FOUND;
IF (str == "")
Return False;
IF (ns4) {
IF (! Win.Find (STR))
While (win.find (str, false, true))
N ;
Else
N ;
IF (n == 0)
Alert ("No found.");
}
IF (IE4) {
TXT = Win.Document.body.createtextRange ();
For (i = 0; i <= n && (Found = txt.findtext (str))! = false; i ) {
TXT.MOVESTART ("Character", 1);
TXT.MOVEEND ("textedit");
}
IF (Found) {
TXT.MOVESTART ("Character", -1);
TXT.FINDTEXT (STR);
TXT.SELECT ();
TXT.Scrollintoview ();
N ;
}
Else {
IF (n> 0) {
n = 0;
FindInPage (STR);
}
Else
Alert ("No found.");
}
}
Return False;
}
script>