Make your own free website on Tripod.com

<HTML>
<HEAD>
<META name="keywords" content="Site Search,
      fast Javascript Search Engine, free script, own Web page site index">
<!-- Created with AOLpress/2.0 -->

<SCRIPT LANGUAGE="JavaScript">
<!--
// Fast SiteSearch JavaScript Engine V1.23, 4 Apr 99
//
// For using to build a local Web Site index and
// a site search with this one JavaScript below.
//
// Originally written by Darryl Stoflet,
// modified and adapted for NS 3.0 and MS IE 4.0 and for using in frames or
// on one page documents by Arnold Schick http://members.tripod.com/~schick/sitesuche.html
//
// There is no permission to use that SiteSearch JavaScript
// on sites with adult material.
//
// For using at your own site (at your own risk),
// adjust (at your own risk) the following lines
// within this JavaScript source:
//
// - define pointer image for every match on result output page
// - define colors and background image of result output page
// - define BGCOLOR of rows for found matches on result output page
// - define maximal number of indexed Pages
// - create your own index of every indexedPage[1..N] with used pattern
// - specify frame name of result output page, if frames are inuse
// - define title, colors and background image of your site search page
//   with field entry for the search
// - write the alternate FORM or output, if the used browser does not support
//   this JavaScript
//
// All changes for your own site search here, are noted in
// this source at the lines with word 'using:' as comments.
// Go to these noted comments and create your own
//     Fast SiteSearch JavaScript Engine.
//
// This JavaScript can be used on one page HTML documents or
// within frames (main frame or navigation frame).

// Initialization Section for Variables

// using: specify the wanted properties of your result output page below:

var PointerPicture = "<IMG SRC=hot.gif width=26 height=20 align=top>";
//                    if the PointerPicture is empty, no image is printed
var ResultBody = "<BODY BGCOLOR='#000000' TEXT='#ffffff' LINK='#80ffff'" +
                 " VLINK='#ffffff' BACKGROUND='marble.jpg'>";
var ResultBGCOLOR = "#448484"; // result rows
// end of properties of result output page

function compress(str) {
var h=str;
var leading=(h.charAt(0) == " " || h.charAt(0) == "*" );
var trailing=(h.charAt(h.length-1) == " " || h.charAt(h.length-1) == "*");
while (trailing || leading) {
 if (leading) {
  h=h.substring(1,h.length);
  leading=(h.charAt(0) == " " || h.charAt(0) == "*" );
 }
 if (trailing) {
  h=h.substring(0,h.length-1);
  trailing=(h.charAt(h.length-1) == " " || h.charAt(h.length-1) == "*");
 }
}
document.searchForm.search_name.value=h;
return document.searchForm.search_name.value;
}

function checkField() {

if ( compress(document.searchForm.search_name.value) != '' ) {
 find(document.searchForm, indexedPage);
 return true }
else { alert("Please enter term(s) for search");
 document.searchForm.search_name.focus();
 return false }
}

function makeArray(n){
this.length = n;
for (i = 1; i <= n; i++){
this[i] = "";
 }
}

function index (link,summary,keywds) {
var argc = index.arguments.length;
var keys = argc - 2;
this.link = link;
this.keywords = new makeArray(keys);
this.keywords[1] = summary;
for(var i = 2; i <= keys+1; i++) {
this.keywords[i] = index.arguments[i];
 }
}

// Initialization Section for the Index

// using: define max number of indexed Pages
//                             vvv
var indexedPage = new makeArray(10);

// using: create your own index of every indexedPage[1..n]
// like this pattern: indexedPage[i] = new index("URL","Title","one Keyword",
//                                             "keyword two","other keywords");
// at least, there must be the URL, the title, and one keyword
//
indexedPage[1]=new index("sas_tips.html","Tips","Techniques","programming","topics");
indexedPage[2]=new index("datasets.html","Datasets","JASA","archive","IASC","SAS");
indexedPage[3]=new index("sas_conferences.html","SAS Conferences","SUGI","SEUGI");
indexedPage[4]=new index("deja-sas.html","Search SAS-L","newsgroups");
indexedPage[5]=new index("http://lib.stat.cmu.edu/cgi-bin/iform?STATLIB","StatLib",
                         "Carnegie Mellon University","CMU");
indexedPage[6]=new index("medline.html","Search","bioethicsline","healthstar");
indexedPage[7]=new index("sas-links.html","Links to SAS System");
indexedPage[8]=new index("stat-links.html","Links for Statisticians");
indexedPage[9]=new index("what_sas.html","SAS System","License","licence");
indexedPage[10]=new index("a.sas","Calculates Main Points",
                          "limited areas","Schwerpunkt");

// Routine Section for FORM

function find(form,indexedPage) {
var key;
var tmp_find_word;
var find_word = form.search_name.value;
var match = false;
var doc;
var resultOne =''; //part One of output
var resultTwo =''; //part Two of output
var resultThr =''; //part Three of output
var N_found = 0;

// search and output

var j=0;
for (var i = 1; i <= indexedPage.length; i++) {
for (var n in indexedPage[i].keywords) {
key = indexedPage[i].keywords[n].toString();
key = key.toUpperCase();
tmp_find_word = find_word.toUpperCase();
if ((key.indexOf(tmp_find_word) != -1 ||
  tmp_find_word.indexOf(key) != -1) && (n != "length")) {
  match = true;
  j++;
  key1 = key.substring(0,key.indexOf(tmp_find_word)) +
         "<B>" + tmp_find_word + "</B>";
  key2 = key1 + key.substring(key1.length-7,key.length);
  resultTwo += " <TR><TD valign=top align=right><i>" + j + ". </i> " +
                 PointerPicture + "</TD>\n";
  resultTwo += " <TD><FONT FACE='Arial' SIZE=-1>\n";
  resultTwo += " key: " + key2 + "<br>\n";
  resultTwo += " title: " + indexedPage[i].keywords[1] + "<br>\n";
  resultTwo += " URL: <A HREF=" + indexedPage[i].link + ">"
    + indexedPage[i].link + "</A></FONT>\n";
  resultTwo += " </TD></TR>\n";
  N_found = j;
   }
  }
 }

// if nothing found

if (!match) {
resultThr += " <TR><TD><FONT FACE='Arial' SIZE=-1>No match for <B>" +
                find_word + "</B>\n";
resultThr += " <br><center>Please try again</center></FONT></TD></TR>\n";
}
resultThr += " </TABLE></TD></TR>\n";
resultThr += "</TABLE><BR>\n";
resultThr += "</CENTER>\n";
resultThr += "</BO" + "DY></HT" + "ML>\n";

// if matchable

resultOne += "<HT" + "ML><HE" + "AD><TI" + "TLE>Search Results for " + find_word +
             "</TI" + "TLE></HE" + "AD>\n";
resultOne += ResultBody +"\n";
resultOne += "<CENTER><FONT FACE='Arial' SIZE=+2>Search Results for <B>" +
              find_word + "</B></FONT><br>\n";
if (match)
if (N_found == 1) resultOne += "<FONT FACE='Arial' SIZE=1><B>1</B> " +
                               "matching result found</FONT><br><br>\n";
else resultOne += "<FONT FACE='Arial' SIZE=1><B>" + N_found +
                  "</B> matching results found</FONT><br><br>\n";
resultOne += "<TABLE border=1 CELLSPACING='0' width='90%' CELLPADDING='0'><TR><TD>\n";
resultOne += " <TABLE border=0 CELLSPACING='0' CELLPADDING='8' BGCOLOR='" +
              ResultBGCOLOR + "' width='100%'>\n";

// if frames are inuse?
if (parent == null || parent == self) { doc = window.document; }
else { doc = parent.main.document; }
//                  ^^^^
// using: if frames are inuse, specify there the assigned frame name
//        note: the frame name is case sensitive

doc.open();
doc.write(resultOne);
doc.write(resultTwo);
doc.write(resultThr);
doc.close();

}

// that's all here, for the SiteSearch JavaScript
// the FORM for search input entry, see below -->

</SCRIPT>

<!-- using: your HTML SiteSearch Document begins here with the TITLE -->

<TITLE>Search my Web Site</TITLE>

</HEAD>

<!-- using: define colors and background image of your search HTML document: -->

<BODY BGCOLOR="#000000" TEXT="#ffffff" LINK="#80ffff" ALINK="#70ffff"
  VLINK="#ffffff" BACKGROUND="marble.jpg">

<!-- using: text area of your search HTML document begins here -->

<CENTER>
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="6" BGCOLOR="#008484">
  <TR>
    <TD ALIGN=Center><IMG SRC="search.gif" ALIGN="TOP" WIDTH="79" HEIGHT="23" ALT="Search">
    <FONT FACE="Arial"><B>my Web Site</B></FONT></TD>
  </TR>
</TABLE>
<P>

<SCRIPT LANGUAGE="JavaScript">
<!--

// Browser test for Fast SiteSearch JavaScript Engine

var browserName = navigator.appName;
var browserVer = parseInt(navigator.appVersion);
if ((browserName == "Netscape" && browserVer >= 3) ||
(browserName == "Microsoft Internet Explorer" && browserVer >= 4))
{

// generation of the FORM for Fast SiteSearch JavaScript Engine

if (browserName == "Netscape" && browserVer < 4)
 document.writeln("<FORM NAME='searchForm' ACTION='' METHOD='GET'" +
                  " target='_self'>");
else document.writeln("<FORM NAME='searchForm' onSubmit='return checkField()'" +
                      " target='_self'>");

document.writeln(" <FONT FACE='Arial' SIZE=-1>Please enter term(s) below" +
 " and press <i><b>find</b></i> button:<BR>wildcards * are allowed</FONT><BR>");
document.writeln(" <INPUT TYPE='text' SIZE=28 NAME='search_name'><BR>");

if (browserName == "Netscape" && browserVer < 4)
 document.writeln(" <INPUT TYPE='button' VALUE='Find'" +
                  " onClick='return checkField()'>");
else document.writeln(" <INPUT TYPE='submit' VALUE='Find'>");

document.writeln(" <INPUT TYPE='reset' VALUE='Clear'" +
                 " onClick='this.form.search_name.focus()'><br>");
document.writeln(" <FONT FACE='Arial' SIZE=-1>Fast SiteSearch" +
                 " JavaScript Engine!");
document.writeln(" </FONT></FORM><BR><small>");
document.writeln(" Fast SiteSearch JavaScript Engine was originally" +
                 " written by Darryl Stoflet.<BR>");
document.writeln(" This <a href='http://members.tripod.com/~schick/sitesuche.html'>" +
                 " JavaScript</a> was modified by Arnold Schick</small><p>");
document.writeln(" ");
document.searchForm.search_name.focus();

} else {

document.writeln(" Sorry! Your Web browser does not support this JavaScript.");
document.writeln("<p>");

}

//--> </SCRIPT>

<NOSCRIPT>
Sorry!<br> Your Web browser does not support this JavaScript <br>
or<br> JavaScript is disabled on your used Web browser.
</NOSCRIPT><BR>

<BR><small>This JavaScript runs in Netscape (version >=3) and<BR>
Microsoft Internet Explorer (version >=4) only, <small>if JavaScript is enabled.</small></small>
<P>
</CENTER>

</BODY></HTML>