<!-- Hide
	var v = 'initial value'
	function grabCookie2() // doorway.html writes the password entered into a session cookie called cookie2
	{
	 	if(GetCookie("Cookie2") != null)
		{
	 		GetCookie("Cookie2");
			v = GetCookie("Cookie2")
	 	}
		else{window.location = "doorway.html"}
	}
var message="Sorry, that function is disabled.\n\nContents & Graphics Copyright © 1997-2003 reikifire.ca. For more information contact Rev. Isabelle Faith D.D. e-mail at isabelle@reikifire.org"
function click(e) 
{
	if (document.all) 
	{
		if (event.button == 2) 
		{
			alert(message);
			return false;
		}
	}
	if (document.layers) 
	{
		if (e.which == 3) 
		{
			alert(message);
			return false;
		}
	}
}
if (document.layers) 
{
	document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
//******************************************************************************

// Essential Reiki Footers
var title = ''
var first = ''
var previous = ''
var next = ''
var last = ''
var footer = ''
var journal = ''
var doc_name = ''
var page_num = null
var first_index = 0
var last_index = 0
var pages = ''
function get_titles()
{
	grabCookie2()
	if(v=='0-legend'){title = 'Reiki Level I Refresher Course';first = '1-legend.html';last = '1-ghasso.html'}
	if(v=='0-continuum'){title = 'Reiki Level II Refresher Course';first = '2-continuum.html';last = '2-manifest.html'}
	if(v=='0-ultimate'){title = 'Reiki Level III Refresher Course';first = '3-ultimate.html';last = '3-beyond.stars.html'}	
	if(v=='a-continuum'){title = 'Reiki Levels I &amp; II Refresher Course';first = '1-legend.html';last = '2-manifest.html'}	
	if(v=='a-ultimate'){title = 'Reiki Levels II &amp; III Refresher Course';first = '2-continuum.html';last = '3-beyond.stars.html'}	
	if(v=='b-ultimate'){title = 'Reiki Levels I, II &amp; III Refresher Course';first = '1-legend.html';last = '3-beyond.stars.html'}
	if(v=='s-legend'){title = 'Reiki Self &amp; Family Healing Course';first = '1-legend.html';last = '1-ghasso.html'}
	if(v.charAt(0)=='1'){title = 'Reiki Level I';first = '1-legend.html';last = '1-ghasso.html'}
	if(v.charAt(0)=='2'){title = 'Reiki Levels I &amp; II';first = '1-legend.html';last = '2-manifest.html'}
	if(v.charAt(0)=='3'){title = 'Reiki Levels I, II &amp; III';first = '1-legend.html';last = '3-beyond.stars.html'}		
	return title
}

function get_journal()
{
	grabCookie2()
	if(v.charAt(0)=='s' || v.charAt(0)=='0' || v.charAt(0)=='a' || v.charAt(0)=='b'){journal = ''}//Disable the journal for self-healing and refreasher courses. 
	else
	{
		journal = "<A HREF=\"journal.html\" TARGET=\"_top\"><FONT COLOR=\"Navy\">Journal</FONT></A>" //Enable the journal.
	}
	return journal
}

function get_location(text)
{
//	var splitter1 = unescape(location.pathname).split("\\") //For offline work only
	var splitter1 = unescape(location.pathname).split("/")	// for online work only
	var	splitter2 = splitter1[splitter1.length-1].split("~")//this takes care of homesites addition of hs~ to the filenames
		doc_name  = splitter2[splitter2.length-1] // equals the current doc name.
	get_indices()
	for(i=1;i<rpages.length;i++)
	{
		if(doc_name==rpages[i].page)
		{
			page_num = i
			if(i==1){previous=first}
			if(i==last_index){next=last}
			if(i>first_index){previous=rpages[i-1].page}
			if(i<last_index){next=rpages[i+1].page}
		}
	}
	if(text=='previous'){return previous}
	if(text=='next'){return next}
	if(text=='page_no'){return page_num}
}


function get_indices()
{
	for(i=1;i<rpages.length;i++)
	{
		if(rpages[i].page==first){first_index = i}
		if(rpages[i].page==last){last_index=i}
	}
}

function get_pages()
{
	get_indices()
	for(i=1;i<rpages.length;i++)
	{
		if(i<first_index){pages += "<FONT COLOR=\"Gray\" SIZE=\"-1\">" + i + "&nbsp; </FONT>"; continue}
		if(i>last_index){pages += "<FONT COLOR=\"Gray\" SIZE=\"-1\">" + i + "&nbsp; </FONT>"; continue}
		pages += "<A HREF=\"" + rpages[i].page + "\" TARGET=\"_top\"><FONT SIZE=\"-1\">" + i + "&nbsp;</FONT></A> "
	}
		return pages
}

var quiz = ""
function get_quiz()
{

	get_location('page_no')
	if(rpages[page_num].qpage == 1)
	{
		var x = rpages[page_num].page
		var sub_1 = x.substring(0,x.length-4) + "quiz.html" // Strip off the 'html' and add 'quiz.html'
		quiz = "<A HREF=\'" + sub_1 + "\' TARGET=\'_top\'>Quiz</A>" 
	}
	else{quiz=quiz}
	return quiz
}

footer += "<DIV ALIGN=\"center\">"
footer += "<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"5\" CELLPADDING=\"5\">"
footer += "<!-- Title Row -->"
footer += "	<TR>"
footer += "<TD COLSPAN=\"2\" ALIGN=\"center\">" + get_journal() + "</TD>"
footer += "		<TD ALIGN=\"center\"><B>" + get_titles() + "</B></TD>"
//footer += "<TD COLSPAN=\"2\" ALIGN=\"center\">Quiz</TD>"
footer += "<TD COLSPAN=\"2\" ALIGN=\"center\">" + get_quiz() + "</TD>"
footer += "	</TR>"
footer += "<!-- Pages Row -->"
footer += "	<TR>"
footer += "		<TD ALIGN=\"center\"><A HREF=\"doorway.html\" TARGET=\"_top\"><IMG SRC=\"images/home.gif\" WIDTH=65 HEIGHT=65 BORDER=0 ALT=\"Home\"></A></TD>"
footer += "		<TD ALIGN=\"center\" VALIGN=\"middle\">"
footer += "			<A HREF=\"" + first + "\" TARGET=\"_top\"><IMG SRC=\"images/first.gif\" WIDTH=23 HEIGHT=20 BORDER=0 ALT=\"First Page\"></A>&nbsp;&nbsp;"
footer += "			<A HREF=\"" + get_location('previous') + "\" TARGET=\"_top\"><IMG SRC=\"images/previous.gif\" WIDTH=10 HEIGHT=20 BORDER=0 ALT=\"Previous Page\"></A>&nbsp;&nbsp;"
footer += "		</TD>"
footer += "		<TD ALIGN=\"center\" VALIGN=\"middle\">"
footer +=  get_pages() + "&nbsp;"
footer += "		</TD>"
footer += "		<TD ALIGN=\"center\" VALIGN=\"middle\">"
footer += "			<A HREF=\"" + get_location('next') + "\" TARGET=\"_top\"><IMG SRC=\"images/next.gif\" WIDTH=10 HEIGHT=20 BORDER=0 ALT=\"Next Page\"></A>&nbsp;&nbsp;"
footer += "			<A HREF=\"" + last + "\" TARGET=\"_top\"><IMG SRC=\"images/last.gif\" WIDTH=23 HEIGHT=20 BORDER=0 ALT=\"Last Page\"></A>"
footer += "		</TD>"
footer += "		<TD ALIGN=\"center\"><A HREF=\"mailto:isabelle@reikifire.ca\"><IMG SRC=\"images/mailbird.gif\" WIDTH=46 HEIGHT=56 BORDER=0 ALT=\"E-mail\"></A></TD>"
footer += "	</TR>"
footer += "<!-- Page number Row -->"
footer += "	<TR>"
footer += "		<TD COLSPAN=\"5\" ALIGN=\"center\">Page " + get_location('page_no') + "</TD>"
footer += "	</TR>"
footer += "<!-- Copyright row -->"
footer += "	<TR>"
footer += "		<TD COLSPAN=\"5\" ALIGN=\"center\" CLASS=\"small\"><a href=\"../reikifire.html\">&copy; 1997-2003 reikifire.ca</a></TD>"
footer += "	</TR>"
footer += "</TABLE>"
footer += "</DIV>"

