<?
$_REQUEST[`bgimage`]=`../images/gardentomb.jpg`;
//global $BibleTopic;


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

echo `
<style>
  .BibTxt{
		font-family: Arial, Helvetica, sans-serif;
		font: `,$txtsiz,`pt Tahoma;
	 }
</style>
`;

$lineNumber=$_REQUEST[`refndx`];
if($lineNumber==``)
  { 
    AlertCustom(~Error~,~No Scripture Reference Number~);
    die();
  }
$lin=ShowQueryResultScalar(~select links from Bible where line=$lineNumber~);
$book=ShowQueryResultScalar(~select book from Bible where line=$lineNumber~);
$chapter=ShowQueryResultScalar(~select chapter from Bible where line=$lineNumber~);
$verse=ShowQueryResultScalar(~select verse from Bible where line=$lineNumber~);
$ref=$book.` `.$chapter.`:`.$verse;
$tops=$_REQUEST[`topics`];
if($tops==``) $topics=trim($lin);
else $topics=$tops;

$tbib=~ <a href=`javascript: window.close();` title=`Bible search`><img src=../images/close.png width=30px></a> ~;

echo $tbib,` <font size=5>Topics for `,$ref,` :</font><br><b class=Bibtxt><ol><li> `,str_replace(~,~,~ <li> ~,$topics),` </ol>`;
$userid=$_SESSION[`UserId`];
if ($userid==12)
   {
      if($tops==``) $tops=$topics; 
      else
         {
            $sql=~update Bible set links=`$tops` where line=$lineNumber~;
            ExecuteSQL($sql);
         }
      echo `<input type=text id=topics name=topics value=~`,$topics,`~ size=50>`;
      echo `<br><input type=submit id=Save name=Save value=Save></b>`;
   }
echo `
<script language=javascript>
window.opener.close();
</script>
`;
?>