<?

global $BibleApp;
$BibleApp=`1`;

if ($_SESSION[`PM_External`]==1)
  {
     $_REQUEST[`exte`]=1;
     $_REQUEST[`clean`]=1;
  }

$_SESSION[`PM_B_Ico`]=`<link rel=~shortcut icon~ href=~../images/Bible.ico~ type=~image/x-icon~ />`;

$_REQUEST[`bgimage`]=`../images/gardentomb.jpg`;

$linkico=$_SESSION[`PM_B_Ico`];


$kwords=$_REQUEST[`kwords`];
if($kwords==``) $kwords=$_SESSION[`PM_B_KeyWords`];

$kwords=strip_tags($_REQUEST[`kwords`]);

$BookSel=$_REQUEST[`BookSel`];
if ($BookSel==``) $BookSel=`Bible`;
$_SESSION[`BookSel`]=`$BookSel`;

$reslimit=$_REQUEST[`reslimit`];
if ($reslimit==``) $reslimit=$_SESSION[`PM_B_Limit`];

$found=$_REQUEST[`found`];

//echo ~found=$found BookSel=$BookSel<br>~;

$_SESSION[`PM_B_Limit`]=$reslimit;

$_SESSION[`PM_B_Found`]=`Found 0`;

$txtsiz=$_REQUEST[`txtsiz`];
if($txtsiz==``) $txtsiz=$_SESSION[`PM_B_Tsiz`];
if($txtsiz==``) $txtsiz=10;

$_SESSION[`PM_B_Tsiz`]=$txtsiz;

$wiki=$_REQUEST[`wiki`];
if($wiki==``) $wiki=$_SESSION[`PM_B_Wiki`];
if($wiki==``) $wiki=0;

$_SESSION[`PM_B_Wiki`]=$wiki;

$yethee=$_REQUEST[`yethee`];
if($yethee==``) $yethee=$_SESSION[`PM_B_YeThee`];
if($yethee==``) $yethee=0;

$_SESSION[`PM_B_YeThee`]=$yethee;

//echo ~Bible booksel=$BookSel~;

echo `
<head>
<title>
King James Bible
</title>
<meta name=~description~
content=~The Holy Bible King James Version keywords and string search ~>
<meta name=~keywords~ id=~keywords~ content=~Bible King James God Christ Jesus Christian
love concordance~>`;

$ht=`65%`;
$browser=$_SESSION[`PM_BROWSER`];
if ($browser==`AN`) 
  {
    $ht=`75%`;
    echo `<meta id=~meta~ name=~viewport~ content=~width=device-width; initial-scale=1.0~ />`;
  }
elseif ($exte==1)
   {
      if ($clean==1) $ht=`545px`;
      else $ht=`475px`;
   }
elseif ($clean==1) $ht=`300px`;

echo `
</head>
<style>
  .BibTxt{
                font-size:`,$txtsiz,`px;
	 }
</style>

<input type=~submit~ value=~Submit~ style=~display: none;~>

<input type=~hidden~ id=~txtsiz~ name=~txtsiz~ value=`,$txtsiz,`> 
<input type=~hidden~ id=~wiki~ name=~wiki~ value=`,$wiki,`> 
<input type=~hidden~ id=~yethee~ name=~yethee~ value=`,$yethee,`> 
<center>
<table border=0 width=100%><tr>

<td width=30%>

<table border=0><tr><td bgcolor=#FFFFAF> 

<input type=~image~ return onclick=~BibSS(); return false;~; src=../images/slideshow.jpg width=20 `,$_SESSION[`PM_AltTitle`],`=~SlideShow mode~>  

<img src=~../images/magnify.jpg~ width=22px title=~Resize text~ onclick=~javascript: SizTxt();~>  

<img src=~../images/study.png~ height=20px title=~Link to significant words~ onclick=~javascript: CapWiki();~>  

<img src=~../images/map.gif~ width=20px height=20px  onclick=~javascript: Biblemap();~   title=~Maps of Biblical Times~>  

<img src=~../images/OldEnglish.jpg~ height=20px onclick=~javascript: YeThee();~ title=~Change Old English Words~>  

 </td></tr></table>

</td>

<td align=center valign=bottom width=30%><img src=../images/KJV.png width=200px></td>

<td align=right width=30%>

<table border=0><tr><td bgcolor=#FFFFAF> 

<img src=~../images/BibleVerse.jpg~ height=22px width=30px title=~Verse of the day~ 
onclick=`,~`~,`javascript: popitup(~../ProjectManagement/Help.php?tabname=VerseOfDay&winnam=BiblePassage&exte=1&txtsiz=15&clean=1~,50,150,575,700);`,~`~,`>

<a href=ProjectManagement.php?projectid=33 target=_BLANK><img src=../upload/Graith/images/Graith.jpg width=24px title=~Sponsored by Graith_Ministries~></a>  

<img src=~../images/dollarsign.jpg~ width=18px title=~Make a donation to Graith_Ministries with Pay-Pal - it is fast, free and secure!~ onclick=~javascript: GoPay();~>

<img id=BibleHelp onclick=TitleAlert(~Graith_Bible_Search_Tool~,~BibleHelp~,~25000~) src=~../images/help.gif~ width=24px title=
~This search app has four pages-
1) Bible_search main page
2) BiblePassage_page when you click on a scripture link
3) BibleChapter_page when you click on the Bible-Chapter link on any of the passage page
4) BibleBook_page when you click on the Bible-Book link on the chapter

You may click on links from within each page to yet four additional pages:
1) HelpPop which shows a text document about the link you clicked
2) BibleSS which renders the text you are viewing into slides.
3) Bible_Topics which shows a list of topics associated with the verse
4) Bible_Audio which plays the audio file for a verse or chapter

If you enjoy this app click on the dollar sign icon to make a donation, ... and thanks!
~
>

<img src=~../images/info.png~ height=22px title=~Information~ onclick=~javascript: BibleInfo();~>  

 </td></tr></table>
</td></tr></table>
<table border=0 bgcolor=#A26C0E width=100%><tr><td>
<table border=0 cellspacing=3 width=100%><tr class=tdgoldV>
<td align=center>`,
         LimitSelect($reslimit),`</td>
<td align=center>`,
	 BookSelect($BookSel),` </td>
<td align=center>
 <input name=~kwords~ id=~kwords~ size=35 value=~`,$kwords,`~ autofocus onFocus=~this.select()~>
 <input type=~submit~ id=~search~ name=~search~ value=~Search~>
</td>
<td align=center> <table border=0 cellpadding=5><tr>`;

if ($wiki==1) $results=BibleStr($kwords,`ALL`,$BookSel);
else $results=BibleStr($kwords,`ALL`,$BookSel);

$_SESSION[`PM_B_Method`]=`ALL`;

//echo ~kwords=$kwords PM_B_KeyWords=~,$_SESSION[`PM_B_KeyWords`],~<br>~;

if($kwords!==$_SESSION[`PM_B_KeyWords`])
{
  $found=``;
  $_SESSION[`PM_B_Keywords`]=$kwords;
}

//echo ~BookSel=$BookSel found=$found<br>~;

if($found==$BookSel) $found=$_SESSION[`PM_B_FoundOld`];
else 
  {
    $found=$_SESSION[`PM_B_Found`];
    $_SESSION[`PM_B_FoundOld`]=$_SESSION[`PM_B_Found`];
  }

if ($found==``) `Found 0`;

$_SESSION[`PM_B_KeyWords`]=$kwords;

echo `<td>`,~
~,$found,~
~,`</td></tr></table>
 
</td></tr></table>
</td></tr></table>
</center>
 `;

echo `<div style=~overflow-y:auto;
      padding: 5px; border: 2px solid; resize: vertical;
height:`,$ht,`; background:#008070;~>`,
	$results,
`</div>

<script language=javascript>

function BibSS()
{
//alert(~BibSS started~);
    var elt = document.getElementById(~BookSel~);
    if (elt.selectedIndex == -1)
        return null;
    FndS=elt.options[elt.selectedIndex].text;
    purl=~../inc/slideshow.php?name=1&controls=1&height=500&txtsize=200&fun=BibleStr(`,~`~,$kwords,~`,`ALL`,`~,$BookSel,~`~,`)&winnam=BibleSS&exte=1&ttl=`,~Found: `~,$kwords,~`~,` in ~+FndS;
    popitup(purl,75,250,575,800);
}

function Biblemap()
{
//alert(~Biblemap started~);
//   var width = window.innerWidth ;
//   var width = document.documentElement.clientWidth ;
   var width = document.body.clientWidth ;
//   var height = window.innerHeight ;
//   var height = document.documentElement.clientHeight ;
   var height = document.body.clientHeight ;

   turl=~../ProjectManagement/Help.php?tabname=BibleMaps&winnam=BibleMaps&exte=1&clean=1&twid=~+width+~&thit=~+height;
   popitup(turl,0,175,height,width);   
}

 function BibleInfo()
 {
    turl=~../upload/Bible/BibleInfo.png?winnam=BibleInfo~;
    popitup(turl,0,0,500,400);   
 }

function CapWiki()
{
//alert(~In CapWiki~);
  var wiki= document.getElementById(~wiki~).value;
  if (wiki==0) wiki=1;
  else wiki=0;
  document.getElementById(~wiki~).value=wiki;
  document.Help.submit();
}

function YeThee()
{
//alert(~In YeThee~);
  var yethee= document.getElementById(~yethee~).value;
  if (yethee==0) yethee=1;
  else yethee=0;
  document.getElementById(~yethee~).value=yethee;
  document.Help.submit();
}


function SizTxt()
{
  var txtsiz= document.getElementById(~txtsiz~).value;
//alert(~In Siztxt txtsiz=~+txtsiz);
  var newsiz=parseInt(txtsiz)+1;
  if (newsiz>20) {newsiz=10;}
  document.getElementById(~txtsiz~).value=newsiz;
  document.Help.submit();
}
function SetBook(sel)
{
  var FndSelect= document.getElementById(sel).value;
  var SelNdx= document.getElementById(sel).selectedIndex;
//alert(~In SetBook book=~+FndSelect);
  var kWrd= document.getElementById(~kwords~).value;
//alert(~In SetBook keyword=~+kWrd);

  if(sel===~found~)
    {  
      document.getElementById(~BookSel~).value=FndSelect;
      document.getElementById(~found~).value=FndSelect;
      document.Help.submit();
    }
  else if(kWrd>~~)
    {
      document.Help.submit();    
    }
  else if(SelNdx>2)
    {
      ref=FndSelect+~ 1:1~;
      turl=~../ProjectManagement/Help.php?tabname=BibleChapter&ref=~+ref+~&winnam=BibleChapter&exte=1&clean=1~;
      popitup(turl,75,175,575,700);      
    }
}

</script>
`;
?>