home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Thompson Chain-Reference…ible - Preacher's Library
/
Iep_tcpl_5r.iso
/
Catalog
/
ibible_link.js
< prev
next >
Wrap
Text File
|
2001-11-17
|
3KB
|
59 lines
// ibible_link.js : Javascript include for iBible search box link - ibible_link.htm
//---------------------------------------------------------------------------
var _bibles=6;
var _bible=Array("NASB","King James","ASV","GOD's WORD","Darby Translation","Young's Literal");
var _ibibles="NASB,KJV,ASV,GW,DAR,YLT"; // sets the Bible list in iBible
//---------------------------------------------------------------------------
var _server="www.iBibleHome.com";
var _browser=navigator.appVersion;
var _IE=(_browser.indexOf("MSIE") >= 0);
var _IE5=(_browser.indexOf("MSIE 5") >= 0);
function DoBibles() { for(i=0; i<_bibles; i++) document.write("<OPTION>" + _bible[i]); }
function DoInput() {
if (_IE) n="18"; else n="15";
document.write("<INPUT name=Text type=text size=" + n +" maxlength=30 onkeydown='Key(self)'>");
}
function DoButtons() {
with (document) {
write(" ");
if (_IE5) {
write("<BUTTON style='position:relative; top:-4px' onclick=Search()>Search</BUTTON> ");
write("<A href='javascript:iBible()'><IMG src='images/ibiblebtn.gif' style='position:relative; left:-5px' border=0></A>");
}
else write("<input type=button value=Search onclick=Search()>");
}
}
function Key(me) { if (me.event.keyCode == 13) Search(); }
function Fix(txt) {
s = "";
for(i=0; i<txt.length; i++) {
c = txt.charAt(i);
cc = txt.charCodeAt(i);
if (cc == 32) s += "+"; else if (cc == 39) s += "_"; else s += ("" + c);
}
return s;
}
function SelectedBible() {
ndx = document.Frm.Bibles.selectedIndex;
return Fix(document.Frm.Bibles.options[ndx].text);
}
function SearchText() {
txt = document.Frm.Text.value;
if (txt == "") txt = "_none_";
return Fix(txt);
}
function iBible() {
window.open("http://" + _server + "/x.iis2?LoadiBible?BIBLE=" + SelectedBible()
+ "&BIBLELIST=" + _ibibles + "&BROWSER=" + _browser,
"","resizable,status,menubar=0,titlebar=0,hotkeys=0");
}
function Search() {
txt = SearchText();
if (txt == "_none_") { alert("Please enter a search word or phrase"); return; }
if (_IE5) func = "LoadiBible"; else func = "NSPage";
window.open("http://" + _server + "/x.iis2?" + func + "?BIBLE=" + SelectedBible()
+ "&SEARCH=" + txt + "&BIBLELIST=" + _ibibles + "&BROWSER=" + Fix(_browser),
"","resizable,status,menubar=0,titlebar=0,hotkeys=0");
return false;
}
function _Submit() { if (!_IE) return Search(); }