

//<![CDATA[

<!--

// BrowserCheck Object

function BrowserCheck() {
	var b = navigator.appName
//HBS extension
	this.mac = (navigator.appVersion.indexOf('Mac') != -1)
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
	this.CRAPBrowser = (this.ie && this.mac); //Cannot Resolve Addresses Properly
}

is = new BrowserCheck();

var LocFolder = GetFolder(window.location.href);
function GetFolder(LocPath){
	LocPath = ReplaceStuff('\'','%27',LocPath);
	var i = LocPath.lastIndexOf('/');
	if (i<0){i=LocPath.lastIndexOf('\\')};
	return LocPath.substring(0,i);
}

function CombineURLs(InURL){
	var i = InURL.indexOf('../');
	var s = LocFolder;
	while (i >- 1){
		s = GetFolder(s);
		InURL = InURL.substring(3,InURL.length);
		i = InURL.indexOf('../');
	}
	return s + '/' + InURL;
}

x = new Array();
function ResolveURLs(InText,Attribute){
	x.length=0;
	var Temp = InText.toLowerCase();
	var z;
	var AttLen = Attribute.length + 2;
	var y=Temp.lastIndexOf(Attribute + '="');
	while (y>-1){
		var sLoc = y+AttLen;
		if (Temp.substring(sLoc,sLoc+5) != 'http:'){
			x[x.length]=new Array();
			x[x.length-1][0] = sLoc;
			z = Temp.indexOf('"',sLoc);
			x[x.length-1][1] = z;
			x[x.length-1][2] = Temp.substring(sLoc,z);
		}
		Temp = Temp.substring(0,y);
		y=Temp.lastIndexOf(Attribute + '="');
	}
	for (var j=x.length-1; j>-1; j--){
		InText = InText.substring(0,x[j][0]) + CombineURLs(x[j][2]) + InText.substring(x[j][1], InText.length);
	}
	return InText;
}

function ResolveAllURLs(Stuff){
	Stuff = ResolveURLs(Stuff,'href');
	Stuff = ResolveURLs(Stuff,'src');
	Stuff = ResolveURLs(Stuff,'parent.location');
	return Stuff;
}

var ExerciseTitle = 'Scripture Flash Cards  - 1 Timothy Chapter 4';
var ExerciseSubtitle = 'Memorize Scripture';
var Instructions = 'Click the ( * ) symbol to toggle between the scripture list and scripture words.<br />Scripture passages will be randomly generated.';

var PreviousPage = history.length;

var NavBar='';



var TitleCode = '<tr><td colspan="2" align="center" valign="top" bgcolor="#ffffff">';
TitleCode += '<font size="+1" face="Geneva,Arial" color="#000033">' + ExerciseTitle + '</font><br />';
TitleCode += '<font size="-1" face="Geneva,Arial" color="#000033">' + ExerciseSubtitle + '<br />';
TitleCode += '</font></td></tr>';

var FlashButton = '<tr><form name="Flashcard" action="">';
FlashButton += '<td align="center" valign="middle"><font face="Geneva,Arial" size="-1">';
FlashButton += '<input type="button" name="Flash" value="  [*]  " onclick="parent.ShowItem()"></input>';
FlashButton += '</td></form></tr>';

var CurrItem = 0;
var Stage = 1;

var CellOpener = '<td valign="middle" align="center" width="50%" bgcolor="#bbbbee"><font face="Geneva,Arial" size="+2">';
var CellCloser = '</font></td>';

function GoBack(){
	var BackSkip = history.length - PreviousPage;
	if (BackSkip > 0){
		history.go((BackSkip+1)*-1);
	}
	else{
		parent.history.back();
	}
}

I = new Array();
I[0] = new Array();
I[0][0] = '1 Timothy 4:2';
I[0][1] = 'by means of the hypocrisy of liars seared in their own conscience as with a branding iron,';
I[1] = new Array();
I[1][0] = '1 Timothy 4:3';
I[1][1] = 'men who forbid marriage and advocate abstaining from foods, which God has created to be gratefully shared in by those who believe and know the truth.';
I[2] = new Array();
I[2][0] = '1 Timothy 4:4';
I[2][1] = 'For everything created by God is good, and nothing is to be rejected, if it is received with gratitude;';
I[3] = new Array();
I[3][0] = '1 Timothy 4:5';
I[3][1] = 'for it is sanctified by means of the word of God and prayer.';
I[4] = new Array();
I[4][0] = '1 Timothy 4:6';
I[4][1] = 'In pointing out these things to the brethren, you will be a good servant of Christ Jesus, constantly nourished in the words of faith and of the sound doctrine which you have been following.';
I[5] = new Array();
I[5][0] = '1 Timothy 4:7';
I[5][1] = 'But have nothing to do with worldly fables fit only for old women. On the other hand, discipline yourself for the purpose of godliness;';
I[6] = new Array();
I[6][0] = '1 Timothy 4:8';
I[6][1] = 'for bodily discipline is only of little profit, but godliness is profitable for all things, since it holds promise for the present life and also for the life to come.';
I[7] = new Array();
I[7][0] = '1 Timothy 4:9';
I[7][1] = 'It is a trustworthy statement deserving full acceptance.';
I[8] = new Array();
I[8][0] = '1 Timothy 4:10';
I[8][1] = 'For it is for this we labor and strive, because we have fixed our hope on the living God, who is the Savior of all men, especially of believers.';
I[9] = new Array();
I[9][0] = '1 Timothy 4:11';
I[9][1] = 'Prescribe and teach these things.';
I[10] = new Array();
I[10][0] = '1 Timothy 4:12';
I[10][1] = 'Let no one look down on your youthfulness, but rather in speach, conduct, love, faith and purity, show yourself an example of those who believe.';
I[11] = new Array();
I[11][0] = '1 Timothy 4:13';
I[11][1] = 'Until I come, give attention to the public reading of Scripture, to exhortation and teaching.';
I[12] = new Array();
I[12][0] = '1 Timothy 4:14';
I[12][1] = 'Do not neglect the spiritual gift within you, which was bestowed upon you through prophetic utterance with the laying on of hands by the presbytery.';
I[13] = new Array();
I[13][0] = '1 Timothy 4:15';
I[13][1] = 'Take pains with these things; be absorbed in them, so that your progress may be evident to all.';
I[14] = new Array();
I[14][0] = '1 Timothy 4:16';
I[14][1] = 'Pay close attention to yourself and to your teaching; persevere in these things; for as you do this you will insure salvation for both yourself and for those who hear you.';


function Shuffle(){
	var Temp;
	var Num;
	for (var i=0; i<I.length; i++){
		Num = Math.round(Math.random() * (I.length-1));
		Temp = I[i];
		I[i] = I[Num];
		I[Num] = Temp;
	}
}

function StartUp(){
	Shuffle();
	WriteFeedback(Instructions);
	WriteOutput(TitleCode);
}

function ShowItem(){
	if (CurrItem >= I.length){
		Shuffle();
		CurrItem = 0;
	}
	var Output = TitleCode + '<tr>' + CellOpener + I[CurrItem][0] + CellCloser;
	if (Stage == 1){
		Output += CellOpener + '&nbsp;' + CellCloser;
		Stage = 2;
	}
	else{
		Output += CellOpener + I[CurrItem][1] + CellCloser;
		Stage = 1;
		CurrItem++;
	}
	Output += '</tr>';
	WriteOutput(Output);
}

function WriteFeedback(Feedback) {
	if (is.CRAPBrowser){Feedback=ResolveAllURLs(Feedback);}
//Build the output string
	var OutString = '';
	OutString += '<html>';
	OutString += '<body  background="jesusbkgrnd.jpg" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#0000cc">';
	OutString += '<center><table border="0" cellpadding="5" cellspacing="1" width="85%">';
	OutString += NavBar;
	if (Feedback.length>0){
		OutString += '<tr><td bgcolor="#bbbbee" align="center">'; 
		OutString += '<font face="Geneva,Arial" size="-1" color="#000000">';
		OutString += Feedback;
		OutString += '</font></td></tr>'
	}
	OutString += FlashButton;
	OutString += '</table></center></body></html>';
//Write it to the frame
	TopFrame.document.clear();
	TopFrame.document.open();
	TopFrame.document.write(OutString);
	TopFrame.document.close();
}

function WriteOutput(Output) {
	if (is.CRAPBrowser){Output=ResolveAllURLs(Output);}
	BottomFrame.document.clear();
	BottomFrame.document.open();
	BottomFrame.document.writeln ('<html>');
	BottomFrame.document.writeln ('<body  background="jesusbkgrnd.jpg" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#0000cc">');
	BottomFrame.document.writeln ('<center><table border="0" cellpadding="5" cellspacing="1" width="85%">');
	BottomFrame.document.writeln (Output);
	BottomFrame.document.writeln ('</table></center></body></html>');
	BottomFrame.document.close();
}

function ReplaceStuff(Token, Replacement, InString){
	var i = InString.indexOf(Token);
	var FirstBit = '';
	var LastBit = '';
	while (i>-1){
		FirstBit = InString.substring(0, i);
		LastBit = InString.substring(i + Token.length, InString.length);	
		InString = FirstBit + Replacement + LastBit;
		i = InString.indexOf(Token);
	}
	return InString;
}

function Blank(){
	return '<html><body>&copy;Half-Baked Software. Loading...</body></html>';
}


//-->

//]]>



