 
function contentsHead() {
	document.write('<STYLE type=text/css>A {color:#000000; text-decoration:underline;} A:hover {color:#000000; text-decoration:underline; background:#FFfFc0;} A:active {color:#000000; text-decoration:underline; background:#c0fFc0;} </STYLE>')
}


function indexBodyTop() {
	contentsBodyTop()
	document.write('<FONT size=3><B></P><a href="Contents.htm">Table of Contents</a>')
	document.write('<P><FONT size=5>Index: <a href="IndexA.htm">A</a> <a href="IndexB.htm">B</a> <a href="IndexC.htm">C</a> <a href="IndexD.htm">D</a> <a href="IndexE.htm">E</a> <a href="IndexF.htm">F</a> <a href="IndexG.htm">G</a> <a href="IndexH.htm">H</a> <a href="IndexI-K.htm">I-K</a> <a href="IndexL.htm">L</a> <a href="IndexM.htm">M</a> <a href="IndexN.htm">N</a> <a href="IndexO.htm">O</a> <a href="IndexP.htm">P</a> <a href="IndexQ-R.htm">Q-R</a> <a href="IndexS.htm">S</a> <a href="IndexT.htm">T</a> <a href="IndexU-Z.htm">U-Z</a></FONT></P></B><BR>')
}

function contentsBodyTop() {
	document.write('<CENTER><TABLE bgColor=#ffffff border=2 cellPadding=0 cellSpacing=0 width="100%"><TBODY>')
	document.write('<TR><TD width="99%">')
	document.write('<P align=center><FONT  size=5 color=#0000ff>Divorce & Remarriage in the 1<SUP>st</SUP> & 21<SUP>st</SUP> Century</FONT></P>')
	document.write('<P align=center><FONT size=4 color=#0000ff>© Rev Dr David Instone-Brewer (Grove Books, 2001)</FONT></P>')
	document.write('<P align=center><FONT size=3 color=#0000ff><A href="http://www.grovebooks.co.uk/cgi-bin/sh000004.pl?ACTINIC_REFERRER=http%3a%2f%2fwww%2egrovebooks%2eco%2euk%2facatalog%2fsearch%2ehtml&REFPAGE=http%3a%2f%2fwww%2egrovebooks%2eco%2euk%2facatalog%2findex%2ehtml&WD=instone%20brewer&SHOP=trialshop1083&PREVQUERY=SHOP%3dtrialshop1083%26PAGE%3dSEARCH%26SS%3dInstone%2bBrewer%26TB%3dA&PN=Grove_Books_Online_Biblical_2%2ehtml%23aB19#aB19">')
	document.write('Purchase from Grove Books</A>, sales@grovebooks.co.uk </A><BR>Phone UK 01223 464748 £2.50 (about $3.60) plus postage </FONT></P>')
	document.write('</FONT></P></TD>')

	document.write('<TD align=left><A href="http://www.grovebooks.co.uk/cgi-bin/sh000004.pl?ACTINIC_REFERRER=http%3a%2f%2fwww%2egrovebooks%2eco%2euk%2facatalog%2fsearch%2ehtml&amp;REFPAGE=http%3a%2f%2fwww%2egrovebooks%2eco%2euk%2facatalog%2findex%2ehtml&amp;WD=b19&amp;SHOP=trialshop1083&amp;PREVQUERY=SHOP%3dtrialshop1083%26PAGE%3dSEARCH%26SS%3dB19%26TB%3dO&amp;PN=Grove_Books_Online_Biblical_2%2ehtml%23aB19#aB19">')
	document.write('<IMG alt="" border=0 height=282 hspace=0 src="Cover2.jpg" width=200></A></TD>')
	document.write('</TR></TBODY></TABLE></CENTER>')
}
function contentsBodyTopX() {
	document.write('<CENTER><TABLE bgColor=#ffffff border=2 cellPadding=0 cellSpacing=0 width="100%">')
	document.write('<TBODY><TR><TD width="99%"><P align=center><FONT color=#0000ff>')
	document.write('<H1 align=center>Divorce And Remarriage in the Bible</H1></FONT>')
	document.write('<H2 align=center>The social and literary context</H2>')
	document.write('<H3 align=center>© Dr. David Instone-Brewer (Eerdmans, 2002)</H3>')
	document.write('<TABLE border=1 cellPadding=0 cellSpacing=0 width="100%"><TBODY><TR>')
	document.write('<TD ALIGN="CENTER"><A href="http://www.amazon.co.uk/exec/obidos/ASIN/0802849431/instonebrewer-21">Buy from Amazon UK</A></TD>')
	document.write('<TD ALIGN="CENTER"><A href="http://www.amazon.com/exec/obidos/ASIN/0802849431/instonebrewer-20">Buy from Amazon USA</A></TD>')
	document.write('<TD ALIGN="CENTER"><A href="http://www.amazon.com/exec/obidos/tg/browse/-/468520/ref=hy_f_3/103-7405596-5018250">Amazon postage rates</A></TD></TR></TBODY></TABLE></TD>')
	document.write('<TD align=left><A href="http://www.eerdmans.com/shop/product.asp?p_key=0802849431"><IMG alt="" border=0 height=222 hspace=0 src="COVER2.jpg" width=150></A>')
	document.write('</TD></TR></TBODY></TABLE></CENTER>')
}

function NthChar(vLookin,vNum) {
// returns the char vNum in vLookin
   	//if (vLookin.length<vNum) vNum = vLookin.length
	vLookfor = "(\.\)"
	for (var i = 1; i<=vNum-1; i++) {
	vLookfor = vLookfor + "(\.\)";} 
	myRe = new RegExp(vLookfor, "ig")
	if (vLookin != null) {
		myArray = myRe.exec(vLookin);
		return myArray[vNum] ;}
	else return ""
}


function extractFrom(vLookin,vLookfor) {
// returns the vLookin without any occurances of vLookfor
   	vReg = "(\.\*)" + vLookfor + "(\.\*)"
	myRe = new RegExp(vReg, "ig")
	myArray = myRe.exec(vLookin);
	while (myArray != null) {
		vLookin = myArray[1]+myArray[2] 
		myArray = myRe.exec(vLookin)
		}
	return vLookin 
}

function OpenCont(filename,WinName) {
  var winX =410;
  var winY = 410;
  vBlank =""
  // only set new values if 4.0 browser
  if (parseInt(navigator.appVersion) >= 4) {
  winX = (screen.availWidth - 300);
  winY = (screen.availHeight - 40) }
  strFeatures='minimize=no,maximize=no,resizable=yes,dependent=yes,menubar=no,directories=no,location=0,status=0,scrollbars=yes,toolbar=no,left=0,top=0 ,height='+winY+',width='+winX;
     content=window.open('',WinName,strFeatures)
     window.content.focus()
     content=window.open(filename,WinName,strFeatures)
     window.content.focus()
}



function OpenChap(num,rel) {
	var filePrefix = cFile
  if (navigator.appName!="Microsoft Internet Explorer"){
  alert("The de-encryption routines may not work with your browser. Sorry!")
   }
  cNum = readCookie("cNum")
  cNum++
  writeTodayCookie("cNum",cNum)
    filename = cFile+num+".htm"
    filenameRel = filename+"#"+rel
	if ((cNum > 6) && (readCookie("accessCode") != "entered")) filename="freecode.htm"
  WinName = "Chapter"
  var winX =410;
  var winY = 410;
  vBlank =""
  // only set new values if 4.0 browser
  if (parseInt(navigator.appVersion) >= 4) {
  vWidth = (screen.availWidth * 0.66)
  vHeight = (screen.availHeight -25)
  vLeft = (screen.availWidth - vWidth -10)
  vTop = 0
  }
  strFeatures='minimize=no,maximize=no,resizable=yes,dependent=yes,menubar=no,directories=no,location=0,status=0,scrollbars=yes,toolbar=no,left='+vLeft+',top='+vTop+',height='+vHeight+',width='+vWidth;
  content=window.open('',WinName,strFeatures)
 
newLoad()  
//  if (navigator.appName!="Microsoft Internet Explorer") newLoad() 
//  else {
//	if (extractFrom(content.document.location,filename)==content.document.location)  newLoad()
//  }
  window.content.focus()
}

function newLoad() {
   content.document.write('<br><br><br><br><center><H2><font color="#ff0000">Loading protected text . . . .</font></H2>');
   window.content.focus();
   content=window.open(filename,WinName,strFeatures);
   window.content.focus();
}

function FNWin(Message) {
  var winX =0;
  var winY = 0;
  // only set new values if 4.0 browser
  if (parseInt(navigator.appVersion) >= 4) {
  winX = (screen.availWidth - 480);
  winY = (screen.availHeight - 130) 
  }
     strFeatures='minimize=no,maximize=no,resizable=yes,dependent=yes,menubar=no,directories=no,location=0,status=0,scrollbars=yes,toolbar=no,left='+winX+',top='+winY+' ,height=100,width=470';
     content=window.open('','Message',strFeatures)
     window.content.focus()
	 content.document.open()
	 content.document.write('<html><head><STYLE type=text/css> A.n {color:#000000; text-decoration:none; background: yellow} A.n:hover {color:#000000; text-decoration:none; background: pink} A {color: #ffffff}  </STYLE>')
	 content.document.write('<SCRIPT type=text/javascript>function mouseDown(e) { if (parseInt(navigator.appVersion)>3) {')  
	 content.document.write('var clickType=1;    if (navigator.appName=="Netscape") clickType=e.which;    else clickType=event.button;  if (clickType!=1) {')
	 content.document.write('alert();} } return true;} if (parseInt(navigator.appVersion)>3) { document.onmousedown = mouseDown;  if (navigator.appName=="Netscape")    document.captureEvents(Event.MOUSEDOWN); } </SCR')
	 content.document.write('IPT></head><body>')
	 content.document.write(Message)
	 content.document.write('</body></html>')
}

//  ======================================================   Start Cookie Functions


function writeTodayCookie(name,value) {
   //alert("WriteCookie")
   today = new Date()
   expires = new Date()
   //expires.setTime(today.getTime() + 1000*30) // today + 1/2 min
   expires.setTime(today.getTime() + 1000*60*60*24) // today + 1 day
   setCookie(name, value, expires)  
}

function writeExpireCookie(name,value) {
   setCookie(name, value)  
}

function writeCookie(name,value) {
   today = new Date()
   expires = new Date()
   expires.setTime(today.getTime() + 1000*60*60*24*365) // today + 1 yr
   setCookie(name, value, expires)  
}

function readCookie(name) {
	vRead = getCookie(name)
	return vRead  
}

function promptCookie(vPrompt, vName)  {
	vNote = readCookie(vName)
	vNote = prompt(vPrompt, vNote)
	writeCookie(vName, vNote)
	return vNote 
}

// Sets cookie values. Expiration date is optional (default expires with session)
function setCookie(name, value, expire) {
   document.cookie = name + "=" + escape(value)
   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))   
}

function getCookie(Name) {
   search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 
      if (offset != -1) { // if cookie exists 
         offset += search.length 
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 
         // set index of end of cookie value
         if (end == -1) // should there be an "{" here?
            end = document.cookie.length
         return unescape(document.cookie.substring(offset, end)) 
		 } 	
		 else {
			// alert("Cookie " +Name+ " is not yet recorded.")
			ThisCookies = false 
			return "";}
	   }
	   else {
		//	alert("No Cookies have yet recorded.")
			NewCookies = false  
			return "";}
}

function firstOf2variables(text) {  // eg alert(firstOf2variables("two,three"))
var arrayString = new Array(2)
arrayString = text
Length1 =arrayString.indexOf(",",1)
if (Length1 <1) return text
else {
Length2 =arrayString.length - Length1 -1 
String1 = arrayString.substring(0,Length1)
return String1
}
}

function secondOf2variables(text) {  // eg alert(secondOf2variables("two,three"))
var arrayString = new Array(2)
arrayString = text
Length1 =arrayString.indexOf(",",1)
Length2 =arrayString.length - Length1 -1 
String2 = arrayString.substring(Length2-1,Length1+Length2+1)
return String2
}


	
// End Cookie Functions   =======================================================

