Site hosted by Angelfire.com: Build your free website today!
// This Script was created by Satadip Dutta. // Email: sat_dutta@post1.com / satadipd@inf.com // URL:http://www.angelfire.com/sd/dutta // Please honor my hard work, if you use a variant of this in your page, // then please email me :) and keep these comments in the Script. // This code is Copyright (c) 1997 Satadip Dutta // all rights reserved. // License is granted to user to reuse this code on their own Web site // if, and only if, this entire copyright notice is included. The Web Site // containing this script must be a not-for-profit ( non-commercial ) web site. If the script is to be used in a commercial // website exclusive permission must be obtained before using it. // Joe Burns of htmlgoodies.com has been authorised to use this code in the // site htmlgoodies.com. title = new Object(); desc = new Object(); links= new Object(); matched= new Object(); keywords= new Object(); found= new Object(); var temp=0; // actual location or the item to be searched // description of he location // actual link // percentage match found // keywords as parsed from the input // # of titles present in the database title[0]=6 //no of keywords after parsing keywords[0]=0 //no of matches found. found[0]=0 title[1]="rei profile information info inner senshi hino transformation sailor mars eternal queen power star school fugu fire father mother raye grandfather temple crows identities Hikawa Jinja cherry tree T*A phobos deimos chad priestess karate food " desc[1]="Sailor Mars' realm profile page" links[1]="http://www.angelfire.com/realm/cartoon/bio.html" matched[1]=0 title[2]="award seal approval mars shrine beauty dreamy effort contest" desc[2]="sailor mars' ream awards" links[2]=" http://www.angelfire.com/realm/cartoon/awards.html" matched[2]=0 title[3]=" award apply guestbook quiz e-card card guessing guess " desc[3]="sailor mars' realm awards to give " links[3]=" http://www.angelfire.com/realm/cartoon/awardsforu.html" matched[3]=0 title[4]="game fun love test puzzle adopt knowledge" desc[4]="sailor mars' realm fun page " links[4]=" http://www.angelfire.com/realm/cartoon/funstuff.html" matched[4]=0 title[5]="links link sailor moon sites site other" desc[5]="sailor mars' realm link site" links[5]="http://www.angelfire.com/realm/cartoon/links.html" matched[5]=0 title[6]="link me banners credits" desc[6]="sailor mars' realm link me " links[6]="http://www.angelfire.com/realm/cartoon/linkme.html" matched[6]=0 title[7]="fanfiction fanfics fan fiction stories rei story sailorknight atonement" desc[7]="sailor mars' realm fanfics" links[7]="http://www.angelfire.com/realm/cartoon/fanfic.html" matched[7]=0 title[8]="pictures picture manga rei sailor mars group gallery" desc[8]="sailor mars' realm picture gallery" links[8]="http://www.angelfire.com/realm/cartoon/pics.html" matched[8]=0 title[9]="MIDI mid sounds music tunes locket tuxedo mask multimedia" desc[9]="sailor mars'realm music" links[9]="http://www.angelfire.com/realm/cartoon/music.html" matched[9]=0 title[10]="review grade mark award email " desc[10]="sailor mars' realm reviews" links[10]="http://www.angelfire.com/realm/cartoon/review.html matched[10]=0 function search(){ // get the input from the input by the user and strip it into keywords //+ var skeyword=document.searchengine.keywords.value.toLowerCase(); var check=1; var pos=0; var i=0; var j=0; var itemp=0; var config=''; while (true) { if (skeyword.indexOf("+") == -1 ) { keywords[check]=skeyword; break; } pos=skeyword.indexOf("+"); if (skeyword !="+") { keywords[check]=skeyword.substring(0,pos); check++; } else { check--; break; } skeyword=skeyword.substring(pos+1, skeyword.length); if (skeyword.length ==0) { check--; break; } } // the keywords have been put in keywords object. keywords[0]=check; //alert(check); // matching and storing the matches in matched for ( i=1; i<=keywords[0];i++) { for (j=1;j<=title[0];j++) { if (title[j].toLowerCase().indexOf(keywords[i]) > -1 ) { matched[j]++; } } } // putting all the indexes of the matched records in found for (i=1;i<=title[0];i++) { if (matched[i] > 0 ) { found[0]++; // increment the found found[found[0]]=i; } } //alert("found 0 " + found[0]); // sort the list as per max percentage of matches for (i=1;i<=found[0]-1;i++) { for(j=i+1;j<=found[0];j++) { if ( matched[found[i]]< matched[found[j]] ) { temp= found[j]; found[j]=found[i]; found[i]=temp; } } } // end of sort // prepare for document write. config='toolbar=no,location=no,directories=no,status=no,menubar=no,' config += 'scrollbars=yes,resizable=yes' output = window.open ("","outputwindow",config) output.document.write(' Goodies Search Results '); output.document.write(''); output.document.write('

Goodies Search Results

'); output.document.write('
'); output.document.write(' The Keyword(s) you searched :: '.big() ) for (i=1; i<=keywords[0]; i++) { output.document.write( keywords[i].bold() +" "); } output.document.write('
'); if (found[0]==0) { //alert(found[0]); output.document.write('
'); output.document.write("No matches resulted in this search
"); output.document.write("You may close the results and reduce the length/number of the keywords
"); } else { // data has been found output.document.write("
The Results of the search are : "); output.document.write( found[0] +" Entries found ".italics()); output.document.write(""); for (i=1; i<=found[0];i++) { output.document.write("
"); output.document.write("

" +i +"

"); output.document.write("
"); itemp=found[i]; output.document.write(desc[itemp].bold() +"
" + links[itemp].link(links[itemp])+"
"); temp= (matched[itemp]/keywords[0])*100 output.document.write(" Matched with keywords :: " +temp+" % " ); matched[itemp]=0 } found[0]=0; output.document.write("
"); } output.document.write ('This search was created by © Satadip Dutta 1997'); output.document.write ("
"); output.document.write ("
") output.document.write ("") output.document.write ("
") }