function FullYear(theDate)
{
	x = theDate.getYear();
	var y = x % 100;
	y += (y < 38) ? 2000 : 1900;
	return y;
}

function dayOfYear()
{	var now = new Date();
	var d = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	var y = FullYear(now);
	var m = now.getMonth();
	var days = 0;
	if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) d[1] = 29;
	while (m) days+= d[--m];
	days+=now.getDate();
	return days;
}

function getURLArgs(caseBool) 
{ 
  // gets the arguments the page was loaded with - that is, 
  // everything after the first '?' 
  // parameters:
  // caseBool - set to true or positive integer to force lowercase 
  // for parameter values 
  // 
  // values are ALWAYS case sensitive 
  // 
  var casefree = ( (true == caseBool) || (caseBool >= 1)) ? true: false; 
  var args  = new Object(); 
  var query = location.search.substring(1); 
  //  alert(query); 
  var pairs = query.split("&"); 
  for(var i = 0; i< pairs.length; i++) 
	 { 
		pairs[i]= unescape(pairs[i]); 
		var pos=pairs[i].indexOf('='); 
		if(-1 == pos) continue; 
		var argname; 
		if(true != casefree) { argname = pairs[i].substring(0,pos); } 
		else { argname = pairs[i].substring(0,pos).toLowerCase(); } 
		var value = pairs[i].substring(pos+1); 
		args[argname] = value; 
	 } 
  return args; 
} 

function LoadQuotes(asQuote)
{
var i = 0;
asQuote[i++] = "Jesus answered, I am the Way and the Truth and the Life. No one comes to the Father except through Me.~(John 14:6)";
asQuote[i++] = "I can do all things through Christ which strengtheneth me.~(Philippians 4:13)";
asQuote[i++] = "Seek first his kingdom and his righteousness, and all these things will be given to you.~(Matthew 6:33)";
asQuote[i++] = "Do not worry about tomorrow, for tomorrow will worry about itself.~(Matthew 6:34)";
asQuote[i++] = "Come to me, all you who are weary and burdened, and I will give you rest.~(Matthew 11:28)";
asQuote[i++] = "Everything is possible for him who believes.~(Mark 9:23)";
asQuote[i++] = "Whatever, therefore, you eat or drink, or whatever you do, do all to the glory of God.~(1 Corinthians 10:31)";
asQuote[i++] = "Man does not live by bread alone, but by every word that proceeds from the mouth of God.~(Matthew 4:4)";
asQuote[i++] = "Whoever drinks of the water I give him, shall never thirst.~(John 4:14)";
asQuote[i++] = "But rejoice that you participate in the sufferings of Christ, so that you may be overjoyed when his glory is revealed.~(1 Peter 4:13)";
asQuote[i++] = "This is how we know what love is: Jesus Christ laid down his life for us.~(1 John 3:16)";
asQuote[i++] = "God made him who had no sin to be sin for us, so that in him we might become the righteousness of God.~(2 Corinthians 5:21)";
asQuote[i++] = "For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord.~(Romans 6:23)";
asQuote[i++] = "Blessed are the pure in heart, for they will see God.~(Matthew 5:8)";
asQuote[i++] = "Give thanks to the Lord, call on his name; make known among the nations what he has done.~(Psalm 105:1)";
asQuote[i++] = "Let us come before him with thanksgiving and extol him with music and song.~(Psalm 95:2)";
asQuote[i++] = "For God hath not given us the spirit of fear, but of power, and of love, and of sound mind.~(2 Timothy 1:7)";
asQuote[i++] = "What shall we then say to these things? If God be for us, who can be against us?~(Romans 8:31)";
asQuote[i++] = "Let the people praise thee, O God; let all the people praise thee.~(Psalm 67:3)";
asQuote[i++] = "Seek ye the Lord while he may be found, call ye upon Him while He is near.~(Isaiah 55:6)";
asQuote[i++] = "Wait on the Lord: be of good courage, and he shall strengthen thine heart: wait, I say, on the Lord.~(Psalm 27:14)";
asQuote[i++] = "The Lord is nigh unto all them that call upon Him, to all that call upon Him in truth.~(Psalm 145:18)";
asQuote[i++] = "To everything there is a season, and a time to every purpose under Heaven.~(Ecclesiastes 3:1)";
asQuote[i++] = "The Lord will give strength unto his people; the Lord will bless his people with peace.~(Psalm 29:11)"; 
asQuote[i++] = "The world and its desires pass away, but the man who does the will of God lives forever.~(1 John 2:17)";
asQuote[i++] = "He will cover you with his feathers, and under his wings you will find refuge.~(Psalm 91:4)";
asQuote[i++] = "For where two or three come together in my name, there am I with them.~(Matthew 18:20)";
asQuote[i++] = "The Lord is my light and my salvation; whom shall I fear? the Lord is the strength of my life; of whom shall I be afraid?~(Psalm 27:1)";
asQuote[i++] = "In God have I put my trust; I will not be afraid what man can do unto me.~(Psalm 56:11)"; 
asQuote[i++] = "This is the confidence we have in approaching God: that, if we ask anything according to his will, he hears us.~(1 John 5:14)"; 
asQuote[i++] = "This is love: not that we loved God but that He loved us, and sent his Son as an atoning sacrifice for our sins.~(1 John 4:10)";  
asQuote[i++] = "I will both lie down and sleep in peace, for you alone, O Lord, make me dwell in safety.~(Psalm 4:8)";
asQuote[i++] = "But I trust in your unfailing love; my heart rejoices in your salvation. I will sing to the Lord, for He has been good to me.~(Psalm 13:5-6)";
asQuote[i++] = "The steps of a good man are ordered by the Lord, And He delights in his way.~(Psalm 37:23)";
asQuote[i++] = "Blessed are the peacemakers, for they shall be called sons of God.~(Matthew 5:9)";
asQuote[i++] = "Peace I leave with you, my peace I give unto you.~(John 14:27)";
asQuote[i++] = "And we know that in all things God works for the good of those who love him.~(Romans 8:28)";
asQuote[i++] = "Set your mind on things above, not on things on the earth.~(Colossians 3:2)";
asQuote[i++] = "When Christ, who is your life, appears, then you also will appear with Him in glory.~(Colossians 3:4)";
asQuote[i++] = "Draw near to God and He will draw near to you.~(James 4:8)";
return (--i);
}

function WriteVerse()
{
   var iNum;
   var sVerse;
   var asQuote = new Array(128) // There are actually only 40 at the moment!
   var iLastQuote = LoadQuotes(asQuote);

// Use the following 2 lines if you want a random quote each time
   //iNum = parseInt(Math.random()*(iLastQuote));

// ...or use the following 1 line if you always only want the first quote
   //iNum=1;

// ...or use the following 1 line if you want one quote per day
   iNum = dayOfYear() % iLastQuote;

   sVerse = '"' + asQuote[iNum];
   if (sVerse.lastIndexOf("~") > -1)
      sVerse = sVerse.substring(0,sVerse.lastIndexOf("~")) + '" ' + sVerse.substring(sVerse.lastIndexOf("~")+1,sVerse.length+1)
      // sVerse = sVerse.replace("~",'" '); // Note: Not Netscape 3.0 compatible
   else
      sVerse += '"';
   document.write(sVerse);
}

WriteVerse();
