//JavaScript cMajor

/***MAKE MORE KEYS***/

KEY[42]="lesson"; KEY[48]="lesson"; if (KEY[84]>1) {KEY[48]="lessons"}
if (KEY[18]=="d") {KEY[42]="service"; KEY[48]="service"; if (KEY[84]>1) {KEY[48]="services"}}
if (KEY[01]=="QuizU") {KEY[42]="quiz"; KEY[48]="quizzes"}
if (KEY[01]=="Train") {KEY[42]="item"; KEY[48]="items"}
if (KEY[01]=="SCMnl") {KEY[42]="tutorial"; KEY[48]="tutorials"}
KEY[90]=GetGenHeader();
KEY[03]=GetListRef(KEY[83]);//Also initialises KEY[02]
if (KEY[18]=="f" && KEY[01]!="Defns") {KEY[02]=KEY[90]+SP+LB+KEY[84]+SP+KEY[48]+RB;}
KEY[04]=GetIsq(KEY[00]);
KEY[06]=GetClrVer(KEY[87]);  if (KEY[06]=="1" && FName=="dprintv.htm") {CLR="1"};
KEY[05]=GetLessonNum(KEY[00]);
KEY[07]=KEY[18]+KEY[91]+KEY[17];
if (KEY[07]=="dindex.htm")  {KEY[07]="index.htm";}
if (KEY[07]=="dprintv.htm") {KEY[07]="dlinks.htm";}
KEY[76]=KEY[18]+KEY[75] + KEY[17];
if (KEY[76]=="dindex.htm")  {KEY[76]="index.htm";}
if (KEY[76]=="dprintv.htm") {KEY[76]="daptja.htm";}
KEY[08]=GetLessonNum(KEY[91]);//next
KEY[78]=GetLessonNum(KEY[75]);//prev
KEY[09]=LB+KEY[08]+RB;//next
KEY[79]=LB+KEY[78]+RB;//prev
KEY[10]=LB+KEY[05]+RB;//curr
KEY[11]=GetAlt(KEY[00]);//**************change to GetTitle when Minors all edited
KEY[12]=GetSubTitle(KEY[00]);
KEY[13]="";
KEY[14]=GetAlt(KEY[00]);
KEY[15]="";
KEY[22]="";
KEY[70]="000"//initialise quiz question selector
KEY[72]="10"//Number of Questions - reset by whichever cQuiz data script is used
KEY[92]="Next "+KEY[42]+" ~&nbsp;"+KEY[09]+SP+GetAlt(KEY[91]);
KEY[85]="Previous "+KEY[42]+" ~&nbsp;"+KEY[79]+SP+GetAlt(KEY[75]);
KEY[99]="1";//spin buttons
KEY[98]=GetUsage(KEY[00]);//GetUsage function is in the cMinor script
KEY[43]=Uz(KEY[98]);//Uz function in Library converts data string to notice
KEY[41]+=GetCopyrightYears(KEY[00]);

function PageDescr(){return"descr"} 

/***PAGE TOP***/

if (location.search.slice(7)=="1") {CLR="1"; Sidebar="OFF"}

if (CLR!="1" && FName!="dprintv.htm") {
new ptopmenu()
new ptoploading()
new ptoplogo()
new ptopimg()
new ptoptitle()
}//endif

function ptopmenu() {
a='<div class="topmenu">'; 
s='<span class="topmenubtn"><a href="';
t='</a></span> ';
//sb="Show Sidebar"; sw="1"; r=KEY[19]+'?SidebarON">';
//if (Sidebar.toUpperCase()=="ON") {sb="Hide Sidebar";  sw='0'; r=KEY[19]+'?SidebarOFF">';}
b="";//s+r+sb+t;
c=s+'dhome.htm">HOME'+t;
d=s+'#PageEnd"><nobr>PICK-A-BOX</nobr>'+t;
e=s+'dalpha.htm"><nobr>INDEX A-Z</nobr>'+t;
f=s+'dglossary.htm">WORDS'+t; 
g=s+'dcontents.htm">STUDIES'+t;
h=s+'dinfo.htm">ABOUT&nbsp;US'+t;
i=s+'dhub.htm">THE&nbsp;HUB'+t;
j=s+'f517.htm">TRAINING'+t;
document.write(a+b+c+d+e+f+g+h+i+j+'</div>');
}

function ptoploading() {
a='<div id="header2"><a name="Top" id="Top"&nbsp;</a>';//OPEN BANNER DIV
b='<div id="loading"><img src="imgpageload.gif" alt="thank you for waiting" title="page loading" border="0" /></div>';
if (CLR=="1" || FName=="dprintv.htm") {b=""};
KEY[21]=a+b; document.write(KEY[21]); 
}//end ptloading

function ptoplogo() {
T="Click this logo to drop down to the pick-a-box directory.";
L="<nobr><img src='imglogo.gif' alt= 'simplybible.com logo' title='"+T+"' border='0' />&nbsp;";
a='<div class="logoisq">';//OPEN LOGO/ISQ
b="<a href='#PageEnd'>"+L+'</a>';//logo
KEY[22]=a+b; document.write(KEY[22]); 
}//end ptoplogo

function ptopimg() {
a='';
b="<img src='"+KEY[04]+"' alt='NEXT' class='imgyb center' width='100' height='100' border='1' usemap='#SwitchPge' /></nobr>";
c="</div>";//CLOSE LOGO/ISQ
m1="<map id='SwitchPge' name='SwitchPge'>";
m2="<area shape='rectangle' href='";
m3="' coords='0,0,100,50' />";
m4="' alt='"+KEY[92]+"' title='"+KEY[92];
m5="' alt='"+KEY[02]+"' title='"+KEY[02];
m6="' coords='0,50,100,100' /></map>";
KEY[23]=a+b+c+m1+m2+KEY[07]+m4+KEY[13]+m3+m2+KEY[03]+m5+m6; document.write(KEY[23]);
}//end ptopimg

function ptoptitle() {
var a,b,c,d,e,f;
a='<div class="htitle">';//OPEN TITLE TABLE
b='<nobr>'+KEY[11]+'</nobr>';//title 
c=B1+'<span class="small green italic"><nobr>'+KEY[12]+'</nobr></span>';//subtitle
d=B1+'<span class="small red"><nobr>'+GetParts("small")+'</nobr></span>';
e='</div>';//CLOSE TITLE
f='</div>';//CLOSE BANNER DIV
KEY[24]=a+b+c+d+e+f; document.write(KEY[24]);
}//end ptoptitle

/***AFTER PAGETOP***/

new afterptop()
function afterptop() {
if (FName=="dprintv.htm") {CLR="1"; Sidebar="OFF"}

if (CLR!="" && FName!="dprintv.htm") {document.write('<br /><h1 class="btpi"><a name="Head" id="Head">'+KEY[14]+'</a></span>&nbsp;'+GetParts("h1")+'</h1>');}//print version heading

//OPEN-PRINT-CLOSE SIDEBAR DIV, OPEN CONTENT DIV
if (CLR=="" && Sidebar=="ON") {document.write('<div id="sidebar2">'+SideBar()+'</div><div id="content2">');}
if (CLR=="" && Sidebar!="ON") {document.write('<div id="content1">');}

document.write(PartsButtons());
}//end afterptop

/***POINT HEADINGS***/

function Point(n) {if (CLR!="" || FName=="dprintv.htm") {return "";} else {document.write(DownArrow(n));}}
function GetPoint(n,h) {if (CLR!="") {return ""} else {document.write('<h1>'+DownArrow(n)+h+'</h1>');}}
//use GetPoint to eliminate entire heading from print version (not just arrow)

/***PAGE END***/

if (CLR!="1" && FName!="dprintv.htm") {
new peMoreIcon()
new pePrintvButton()
new peFinder()
new mTopBox()
new mPartBox()
new mPrevBox()
new mNextBox()
new mListBox()
new mPrintvBox()
new mThreadBox()
new mChartBox()
new mReadmeBox()
new mOnlineBibleBox()
new mAlphaBoxes()
new mServiceBoxes()
new peplate()
new KangaKorna()
}//endif

function peMoreIcon() {
return MoreIcon("","","")
}//end peMoreIcon

function pePrintvButton() {
if (CLR=="") {return PrintVerButton(KEY[87],"pfv");}
return ""
}//end pePrintvButton

function peFinder() {
KEY[47]=AssembleFinder("normal");//library
}//end peFinder

function mTopBox() {
t1=B1+"<a name='PageEnd' id='PageEnd' href='#PageEnd'><span class='bold italic'>Pick a box...</span></a>"+B1
t2="<a href='#Top'><img src='ztop.jpg' alt='Top' title='Top of this page ~&nbsp;"
t3="' border='0' /> </a>";
KEY[29]=t1+t2+GetTabTi(KEY[87])+t3;
}//end mTopBox

function mPartBox() {
P=KEY[16][0]; if (P==1) {return ""}
if (KEY[16][2].indexOf("*")==3) {return ""}
stem=GetParts("nextstem");
part=GetParts("nextpart");
if (KEY[16][part].indexOf("*")==3) {part=1; stem=KEY[16][1];}//endif
p1='Go to Part '+part+' of this lesson ~&nbsp;'+GetTabTi(stem);
p2="<a href='f"+stem+".htm'>";
p3="<img src='zpart"+part+".jpg' alt='Part' title='"+p1+"' border='0' /></a>";
KEY[29]+=p2+p3;
}//end mPartBox

function mPrevBox() {
n1=" <a href='";
n2="'><img src='zprev.jpg' alt='"+KEY[85];
n4="' title='"+KEY[85];
n3="' border='0' /></a> ";
KEY[30]=n1+KEY[76]+n2+KEY[15]+n4+KEY[15]+n3;
}//end mPrevBox

function mNextBox() {
n1=" <a href='";
n2="'><img src='znext.jpg' alt='"+KEY[92];
n4="' title='"+KEY[92];
n3="' border='0' /></a> "; 
KEY[31]=n1+KEY[07]+n2+KEY[13]+n4+KEY[13]+n3;
}//end mNextBox

function mListBox() {
a1="<a href='";
a2="'> <img src='zlist.jpg' alt='";
a4="' title='";//added Aug 2009
a3="' border='0' /></a> ";
KEY[32]=a1+KEY[03]+a2+KEY[02]+a4+KEY[02]+a3;
}//end mListBox

function mPrintvBox() {
KEY[32]+=GetPrintvBox(KEY[89]);//from Library
}//end mPrintvBox

function mThreadBox() {
KEY[93]=GetThreads(KEY[00]);
if (KEY[93]!="") {KEY[33]=GetThreadArray(KEY[93]);}
}//end mThreadBox

function mChartBox() { 
KEY[94]=GetChartFiles();
KEY[34]=GetCharts(KEY[94]);
}//end mChartBox

function mReadmeBox() {
KEY[95]=GetReadMe(KEY[00]);
KEY[35]=GetReadMeBoxes(KEY[95])
}//end mReadMeBox

function mOnlineBibleBox() {
KEY[96]=GetBibleBkCh(KEY[00]);//from Minor
KEY[36]=GetBibleBoxes(KEY[96]);//from Library
}//end mOnlineBibleBox

function mAlphaBoxes() {
KEY[37]="<center>"+AssembleAlphaBoxes();
}//end mAlphaBoxes

function mServiceBoxes() {
KEY[38]=AssembleSvceBoxes();
}//end mServiceBoxes

function peplate() {
KEY[40]=AssembleEndPlate();
}//end peplate

/***PRINT PAGE END**/

function PrintPageEnd(){
//PRINT FRIENDLY VERSION
if (CLR!="" || FName=="dprintv.htm") {document.write('<p>'+Clrvref()+' &nbsp;&nbsp;<img src="imgmarker.jpg" border="0" height="5" width="150" /><span class="small italic"> www.simplybible.com</span></p>');}

function Clrvref() {if (KEY[16][0]!="1") {return '<a href="f'+GetParts("nextstem")+'.htm?Clear=1"><span class="small bold yellow greenbg padded">To Part '+GetParts("nextpart")+'</span></a>'} return ""}//*****remove Clrvref function mid 2010 (duplicated in Library)

//OPEN NORMAL FOOTER DIV (nested inside content div)
if (CLR=="") {
var i=0; var x=""; var d1 ="<div id='footer2' class='center'>"; 
document.write(d1+peMoreIcon()+B1+pePrintvButton()+'<center>'+KEY[47]+'</center>');//finder
for (i=29; i<=38; i++) {x+=(KEY[i]);
document.write(KEY[i])}//next i (loop displays boxes)
document.write(KEY[40]);//endplate

//CLOSE NORMAL FOOTER DIV
document.write("</div>");
}//endif

//CLOSE CONTENT DIV 
document.write("</div>");
document.write("<noscript>");//patch - remove when all page end noscripts fixed as per eg f60e
}//end PrintPageEnd

//STATSCOUNTER.COM

var sc_project=5566654; 
var sc_invisible=1; 
var sc_partition=60; 
var sc_click_stat=1; 
var sc_security="64e24832"; 

document.write('<script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><span class="yellow">*</span>');

/***LIST ALL KEYS***/

//for (x=0; x<=99; x++) {document.write("<br /> "+x+" "+KEY[x]); if (KEY[x]=="") {document.write(" null");}}

/***END OF SCRIPT (cMajor.js)***/
