// ***UNDER CONSTRUCTION*** // SEARCH.txt is at attempt to create a unified search function that returns POINTERS (and possibly LINKS) from a search of all databases: i.e. LIBRARY.txt, PEOPLE.txt, THEATRES.txt // THIS file ASSUMES that the following files have ALREADY BEEN LOADED by some other program: // LIBRARY.txt // PEOPLE.txt // THEATRES.txt var database function searchTest(dummyVariable) { document.write("CONFIRMED
") } function searchFor(codesought) { document.write("searchFor also LIVE") document.write("
") document.write("Variable received:"+codesought) document.write("
") document.write("attempt to tap into PEOPLE database") document.write("
") document.write(People[5].codeName) } function PointAtObject(CodeSought) { database="Yipes! Error! Not Found!" searchpointer="Yipes! Error! Not Found!" if (searchpointer == "Yipes! Error! Not Found!") { for (var loop = 0; loop <= Library.length-1; loop++) { if (Library[loop].code == CodeSought) {searchpointer = loop; database = "Library"} }} // eventually I hope to make Library2 obsolete by combining it with Library, but for now... for (var loop = 0; loop <= Library2.length-1; loop++) { if (Library2[loop].code == CodeSought) {searchpointer2 = loop} } if (searchpointer == "Yipes! Error! Not Found!") { for (var loop = 0; loop <= People.length-1; loop++) { if (People[loop].codeName == CodeSought) {searchpointer = loop; database = "People"} }} if (searchpointer == "Yipes! Error! Not Found!") { for (var loop = 0; loop <= Theatres.length-1; loop++) { if (Theatres[loop].code == CodeSought) {searchpointer = loop; database = "Theatres"} }} return(searchpointer,database) } function HREFsearch(CodeSought) { PointAtObject(CodeSought) if(database == "Library") {document.write("")} if(database == "People") { if(People[searchpointer].peoplePage != "") {document.write("")} else { if(People[searchpointer].offsite != "OFFSITE") {document.write("")} } } if(database == "Theatres") { if(Theatres[searchpointer].page != "") {document.write("")} else { if(Theatres[searchpointer].url != "") {document.write("")} } } } // HREFsearch prefers JeffNet People page to an Offsite URL // HREFsearch prefers JeffNet Theatre page to the theatres own homepage function LogoSearch(CodeSought) { PointAtObject(CodeSought) document.write("") } // LogoSearch substitutes a temp headshot if one is not listed in the database function LinkedLogo(CodeSought) { HREFsearch(CodeSought) LogoSearch(CodeSought) document.write("") } function NameSearch(CodeSought) { // name or title PointAtObject(CodeSought) if(database == "Library") {document.write(Library[searchpointer].title)} if(database == "People") { if(People[searchpointer].stageName != "") {document.write(People[searchpointer].stageName)} else {document.write(People[searchpointer].codeName)} } if(database == "Theatres") {document.write(Theatres[searchpointer].name)} } // NameSearch uses their StageName, but if it is blank, reverts to JeffNet codeName function LinkedName(CodeSought) { // link with name HREFsearch(CodeSought) NameSearch(CodeSought) document.write("") } function BillboardSearch(CodeSought) { PointAtObject(CodeSought) document.write("
*** NO BILLBOARDS AT THIS TIME ***
") }