//  C.McDonald May 2003
//=====================

var verses = new Array();

verses[0]=[ 'Isaiah 45:22',
        0, '<b>Look</b> unto <b>me</b>,',
	2, 'and <b>be</b> ye <b>saved</b>,',
	0, '<div><b>all</b> the <b>ends</b> of the <b>earth</b></div>' ];

verses[1]=[ '1 Timothy 1:15',
        0, '<b>Jesus Christ</b> came',
	2, 'into the <b>world</b>',
	4, 'to <b>save sinners</b>' ];

verses[2]=[ 'Isaiah 55:6',
        0, '<b>Seek ye</b> the <b>LORD</b>',
	2, '<b>while he</b> may be <b>found</b>' ];

verses[3]=[ 'John 14:6',
        0, '<b>I am</b> the <b>way</b>,',
	2, 'the <b>truth</b>,',
	4, 'and <b>the life</b>' ];

verses[4]=[ 'Psalms 53:1',
        0, 'The <b>fool</b> hath said',
	2, 'in <b>his heart</b>,',
	4, 'There is <b>no God</b>' ];

verses[5]=[ 'Romans 6:23',
        0, 'For the <b>wages</b> of <b>sin</b> is <b>death</b>;',
	2, 'but the <b>gift</b> of <b>God</b> is',
	1, '<b>eternal life</b> through',
	3, '<b>Jesus Christ</b> our <b>Lord</b>' ];

verses[6]=[ 'Acts 2:21',
        0, '<b>Whosoever</b> shall <b>call</b>',
	2, 'on the <b>name</b> of the <b>Lord</b>',
	4, 'shall be <b>saved</b>' ];

verses[7]=[ 'Job 19:25',
        0, 'I <b>know</b> that',
	2, 'my <b>Redeemer liveth</b>' ];

verses[8]=[ 'Joshua 3:9',
        1, '<b>Come</b> hither,',
	0, 'and <b>hear</b> the <b>words</b>',
	2,  'of the <b>LORD</b> your <b>God</b>' ];

verses[9]=[ 'Luke 11:28',
        0, '<b>Blessed</b> are they that',
	2, '<b>hear</b> the <b>Word</b> of <b>God</b>,',
 	4, 'and <b>keep</b> it' ];

verses[10]=[ 'Matthew 6:33',
        0, '<b>Seek</b> ye <b>first</b>',
	2, 'the <b>Kingdom of God</b>' ];

verses[11]=[ 'Luke 19:10',
        0, 'The <b>Son of Man</b> is <b>come</b>',
	2, 'to <b>seek</b> and to <b>save</b>',
	4, 'that which was <b>lost</b>' ];

verses[12]=[ 'John 3:3',
        0, '<b>Except</b> a man be <b>born again</b>,',
	3, 'he <b>cannot</b> see',
	1, 'the <b>Kingdom of God</b>' ];

verses[13]=[ 'Psalms 150:6',
        0, 'Let <b>every thing</b>',
	2, 'that hath breath',
	1, '<b>praise</b> the <b>LORD</b>' ];

verses[14]=[ '2 Corinthians 4:5',
	0, 'We <b>preach</b> not ourselves,',
	2, 'but <b>Christ Jesus</b> the <b>Lord</b>' ];

verses[15]=[ 'Hebrews 13:8',
	1, '<b>Jesus Christ</b>',
	2, 'the same <b>yesterday</b>,',
	0, 'and <b>today</b>, and for <b>ever</b>' ];

verses[16]=[ 'Psalms 118:8',
	1, 'It is better',
	2, 'to <b>trust</b> in the <b>LORD</b>',
	0, 'than to put confidence in <b>man</b>' ];

verses[17]=[ '1 John 4:9',
	0, '<b>God</b> sent his <b>only begotten Son</b>',
	2, 'into the <b>world</b>,',
	0, 'that we might <b>live</b> through <b>him</b>' ];

verses[18]=[ 'Hebrews 9:28',
	0, '<b>Christ</b> was <b>once offered</b>',
	2, 'to <b>bear the sins</b> of many</b>' ];

verses[19]=[ '2 Timothy 3:16',
	0, '<b>All scripture</b> is given',
	2, 'by <b>inspiration</b> of <b>God</b>' ];

verses[20]=[ 'Romans 14:12',
	0, '<b>Every one</b> of us shall <b>give</b>',
	2, '<b>account</b> of himself to <b>God</b>' ];

verses[21]=[ 'Psalms 92:1',
	0, 'It is a <b>good thing</b>',
	2, 'to give <b>thanks</b>',
	4, 'unto the <b>LORD</b>' ];

verses[22]=[ '1 John 1:7',
	0, 'The blood of <b>Jesus Christ</b> ...',
	1, '<b>cleanseth</b> us from all <b>sin</b>' ];

verses[23]=[ '1 Chronicles 16:29',
	0, '<b>Give</b> unto the <b>LORD</b>',
	2, 'the <b>glory</b> due',
	4, 'unto his <b>name</b>' ];

verses[24]=[ 'John 14:6',
	1, '<b>I</b> am the <b>way</b>,',
	2, 'the <b>truth</b> and the <b>life</b>:',
	0, '<b>no man</b> cometh unto the <b>Father</b>,',
	4, 'but by <b>me</b>' ];

verses[25]=[ 'Matthew 11:28',
	1, '<b>Come</b> unto <b>me</b>,',
	3, 'all ye that <b>labour</b>',
	0, 'and are <b>heavy laden</b>,',
	2, 'and <b>I</b> will give you <b>rest</b>' ];

verses[26]=[ 'Psalms 46:1',
	0, '<b>God</b> is our',
	2, '<b>refuge</b> and <b>strength</b>,',
	1, 'a very present <b>help</b>',
	3, 'in <b>trouble</b>' ];

verses[27]=[ 'Psalms 46:10',
	0, 'Be <b>still</b> and <b>know</b>',
	2, 'that <b>I</b> am <b>God</b>' ];

verses[28]=[ 'Mark 1:15',
	0, 'the <b>kingdom</b> of <b>God</b>',
	2, 'is at hand: <b>Repent</b> ye,',
	1, 'and <b>believe</b> the </b>gospel</b>' ];

verses[29]=[ '2 Chronicles 20:20',
	1, '<b>Believe</b> in',
	0, 'the <b>LORD</b> your <b>God</b>' ];

verses[30]=[ '2 Corinthians 6:2',
	1, '<b>Behold</b>, now is',
	0, 'the <b>day</b> of <b>salvation</b>' ];



function fVrsDisplay() {

    var v, reflink, i, vtext, idx, vinfo, bref, cv, booklink, refname;

    if ( !document.getElementById ) return;

    idx = Math.round( Math.random()*(verses.length-1) );
    // idx = verses.length-1;
    vinfo = verses[idx];

    bref = vinfo[0].split(" ");
    if ( bref.length == 3 ) {
	booklink = bref[0] + bref[1];
	cv = bref[2];
    	refname = bref[0] + ' <b>' + bref[1] + '</b> ' + cv;
    } else {
	booklink = bref[0];
	cv = bref[1];
	if ( bref[0] == "Song" ) {
	   refname = '<b>Song</b> of <b>Solomon</b> ' + cv;
	} else { refname = '<b>' + bref[0] + '</b> ' + cv; }
    }

    if ( cv.split(':').length == 1 ) cv = '1:' + cv;

    reflink = '<a target="_top" href="javascript:bibleRef(\'' +
	booklink + "','" + cv +
	'\')" title="Click here to go to on-line Bible" ';

    vtext = ""
    for ( i=1; i<vinfo.length; i+=2 ) {
	vtext = vtext + '<div style="text-indent:' + vinfo[i] +
		'em;">' + vinfo[i+1] + '</div>'
    }

    v = document.getElementById("fVrsText");
    v.innerHTML = reflink + 'id="fVrsTextLink">' + vtext + '</a>';

    v = document.getElementById("fVrsRef");
    v.innerHTML = reflink + 'id="fVrsRefLink">' + refname + '</a>';

    fVrsFadeCount = 0;
    fVrsFade(1);
}


function fVrsFade( fadein ) {

    var i, v, divs, colourRgb, textColour, intervals=40;
    var startRgb = [0x94, 0xb5, 0xce], endRgb = [0x00, 0x33, 0x66];

    if ( fadein ) {
	colourRgb = startRgb;
    } else {
	colourRgb = endRgb;
	endRgb = startRgb;
    }

    for ( i=0; i<3; i++ ) {
	colourRgb[i] = Math.round( colourRgb[i] +
	   ( endRgb[i] - colourRgb[i] ) * fVrsFadeCount / intervals );
    }

    textColour = "rgb(" + colourRgb[0] + "," + colourRgb[1] +
			"," + colourRgb[2] + ")";

    v = document.getElementById("fVrsTextLink");
    if ( v ) {
	v.style.color = textColour;
	divs = v.getElementsByTagName("div");
	for ( i=0; i<divs.length; i++ )
	    divs[i].style.color = textColour;
    }

    v = document.getElementById("fVrsRefLink");
    if ( v ) v.style.color = textColour;

    fVrsFadeCount++;

    if ( fVrsFadeCount <= intervals ) {
	setTimeout("fVrsFade("+fadein+")",50);
    } else {
    	fVrsFadeCount = 0;
	if ( fadein ) setTimeout("fVrsFade(0)",3000);
	else fVrsDisplay();
    }
}


fVrsDisplay()

