function openTerms()
{
	newwin = window.open("terms.html","terms","width=405,height=400,scrollbars=yes");
}

function openPrivacy()
{
	newwin = window.open("privacy.html","terms","width=405,height=400,scrollbars=yes");
}

// form validation
function validateForm(form)
{
	valid = true;
	message = "So we can receive your request:\n\n";
	if(form.elements["firstname"].value == "")
	{
		message += " - Please enter your first name\n";
		valid = false;
	}
	if(form.elements["lastname"].value == "")
	{
		message += " - Please enter your last name\n";
		valid = false;
	}
	
	var supEmail = form.elements["email"].value;
	var emLen = supEmail.length;
	var posAt = supEmail.indexOf('@')
	var posDot = supEmail.lastIndexOf('.')
	if((emLen < 7) || (posAt < 1) || (posDot <= (posAt + 1)) || (posDot >= (emLen - 1)))
	{
		message += " - Please enter a valid email address\n";
		valid = false;
	}
	
	if(valid)
	{
		return true;
	}
	else
	{
		alert(message);
		return false;
	}
}	

function RandomPrayers()
{

    var prayers = [
    ["Pray for us: for we trust we have a good conscience, in all things willing to live honestly","Heb 13:18"],
    ["It is the Spirit who gives life; the flesh profits nothing; the words that I have spoken to you are spirit and are life","John 6:63 (NASB)"],
    ["When I was a child, I talked like a child, thought like a child, reasoned like a child. When I became a man, I put childish ways behind me.","I Corinthians 13:11 (NIV)"],
    ["That is why, for Christ's sake, I delight in weaknesses, in insults, in hardships, in persecutions, in difficulties. For when I am weak, then I am strong.","II Corinthians 12:10 (NIV)"],
    ["And this is the testimony: God has given us eternal life, and this life is in his Son. He who has the Son has life; he who does not have the Son of God does not have life. ","I John 5:11-12 (NIV)"],
    ["For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord. ","Romans 6:23 (NIV)"],
    ["Have I not commanded you? Be strong and courageous. Do not be terrified; do not be discouraged, for the LORD your God will be with you wherever you go.","Joshua 1:9(NIV)"],
    ["He alone is my rock and my salvation; he is my fortress, I will never be shaken.","Psalm 62:2 (NIV)"],
    ["There is a lad here who has five barley loaves and two fish, but what are these for so many people?","John 6:9 (NASB)"],
    ["The Lord is gracious and righteous; our God is full of compassion.","Psalm 116:5 (NIV)"],
    ["However, as it is written: No eye has seen, no ear has heard, no mind has conceived what God has prepared for those who love him","I Corinthians 2:9 (NIV)"],
    ["Now may the Lord of peace Himself continually grant you peace in every circumstance. The Lord be with you all!","II Thessalonians 3:16 (NASB)"],
    ["But Thou, O Lord, art a God merciful and gracious, Slow to anger and abundant in loving kindness and truth.","Psalm 86:15 (NASB)"],
    ["Humble yourselves before the Lord, and he will lift you up.","James 4:10 (NIV)"],
    ["And the peace of God, which surpasses all comprehension, shall guard your hearts and your minds in Christ Jesus. ","Philippians 4:7 (NASB)"],
    ["But the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness and self-control. Against such things there is no law.","Galatians 5:22-23 (NIV)"],
    ["And my God will meet all your needs according to his glorious riches in Christ Jesus. ","Philippians 4:19 (NIV)"],
    ["Do not gloat over me, my enemy! Though I have fallen, I will rise. Though I sit in darkness, the LORD will be my light.","Micah 7:8 (NIV)"],
    ["For the kingdom of God is not eating and drinking, but righteousness and peace and joy in the Holy Spirit","Romans 14:17 (NASB)"],
    ["Therefore having been justified by faith, we have peace with God through our Lord Jesus Christ.","Romans 5:1 (NASB)"],
    ["For Thou, Lord, art good, and ready to forgive, and abundant in loving kindness to all who call upon Thee. ","Psalm 86:5 (NASB)"],
    ["Let not your heart be troubled, nor let it be fearful.","John 14:27b (NASB)"],
    ["Blessed be the God and Father of our Lord Jesus Christ, the Father of mercies and God of all Comfort.","II Corinthians 1:3 (NASB)"],
    ["Do not be anxious about anything, but in everything, by prayer and petition, with thanksgiving, present your requests to God","Philippians 4:6 (NIV)"],
    ["David said about him: I saw the Lord always before me. Because he is at my right hand, I will not be shaken. ","Acts 2:25 (NIV)"],
    ["For it is by grace you have been saved, through faith-and this not from yourselves, it is the gift of God, not by works, so that no one can boast. ","Ephesians 2:8-9 (NIV)"],
    ["Yet to all who received him, to those who believed in his name, he gave the right to become children of God","John 1:12 (NIV)"],
    ["To him who overcomes, I will give the right to sit with me on my throne, just as I overcame and sat down with my Father on his throne.","Revelation 3:21 (NIV)"],
    ["And this is the testimony: God has given us eternal life, and this life is in his Son. He who has the Son has life; he who does not have the Son of God does not have life.","I John 5:11-12 (NIV)"],
    ["He that dwelleth in the secret place of the most High shall abide under the shadow of the Almighty. I will say of the LORD, He is my refuge and my fortress: my God; in him will I trust.","Psalm  91:1-2 (KJV)"],
    ["Trust in the LORD with all thine heart; and lean not unto thine own understanding. 6   In all thy ways acknowledge him, and he shall direct thy paths.","Proverbs 3:5-6 (KJV)"],
    ["For God sent not his Son into the world to condemn the world; but that the world through him might be saved.","John 3:17 (KJV)"],
    ["Be kind and compassionate to one another, forgiving each other, just as in Christ God forgave you","Ephesians 4:32 (NIV)"],
    ["Why are you in despair, O my soul? And why are you disturbed within me? Hope in God, for I shall again praise Him, The help of my countenance, and my God.","Psalm 43:5 (NASB)"],
    ["Let us then approach the throne of grace with confidence, so that we may receive mercy and find grace to help us in our time of need.","Hebrews 4:16 (NIV)"],
    ["The Spirit of the Lord God is upon me, because the Lord has anointed me to bring good news to the afflicted; He has sent me to bind up the brokenhearted, to proclaim liberty to captives, and freedom to prisoners.","Isaiah 61:1  (NASB)"],
    ["It is better to take refuge in the Lord than trust in man","Psalm 118:8 (NIV)"],
    ["Delight yourself in the Lord and he will give you the desires of your heart.","Psalm 37:4 (NIV)"],
    ["I will say to the Lord, \"My refuge and my fortress, My God, in whom I trust!\"","Psalm 91:2 (NASB)"],
    ["The LORD is my light and my salvation-whom shall I fear? The LORD is the stronghold of my life-- of whom shall I be afraid?","Psalm 27:1 (NIV)"],
    ["For all have sinned and fall short of the glory of God.","Romans 3:23 (NIV)"],
    ["For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord. ","Romans 6:23 (NIV)"],
    ["But God demonstrates his own love for us in this: While we were still sinners, Christ died for us.","Romans 5:8 (NIV)"],
    ["For it is by grace you have been saved, through faith-and this not from yourselves, it is the gift of God, not by works, so that no one can boast.","Ephesians 2:8-9 (NIV)"],
    ["..then the Lord knows how to rescue godly men from trials.. ","II Peter 2:9 (NIV)"],
    ["And if I have the gift of prophecy, and know all mysteries and all knowledge; and if I have all faith, so as to remove mountains, but do not have love, I am nothing.","I Corinthians 13:2 (NASB)"],
    ["Therefore the Lord longs to be gracious to you, And therefore He waits on high to have compassion on you. For the Lord is a God of justice; How blessed are all those who long for Him.","Isaiah 30:18 (NASB)"],
    ["That is why, for Christ's sake, I delight in weaknesses, in insults, in hardships, in persecutions, in difficulties. For when I am weak, then I am strong.","II Corinthians 12:10 (NIV)"],
    ["In the same way, the Spirit helps us in our weakness. We do not know what we ought to pray for, but the Spirit himself intercedes for us with groans that words cannot express. And he who searches our hearts knows the mind of the Spirit, because the Spirit intercedes for the saints in accordance with God's will.","Romans 8:26-27 (NIV)"],
    ["The Bible is the Message of God to man.","II Timothy 3: 14-17."],
    ["When in trouble or sorrow, read","John 14: 1-3, 27; Hebrews 12: 6-7; Psalm 46."],
    ["When you worry, read","Matthew 6: 19-34."],
    ["When you have the blues, read ","Psalm 91."],
    ["When God seems far away, read","Psalm 139."],
    ["When you want rest and peace, read ","Matthew 11: 25-30."],
    ["When in sickness, read","James 5: 14-15; Psalm 41: 2-4."],
    ["When in danger, read ","Luke 8: 22-25; Psalm 91."],
    ["When men fail you, read","I Peter 5: 7; Psalm 23."],
    ["When lonely or fearful, read","Matthew 6: 25-34, 11: 28-30."],
    ["When discouraged or tempted, read","I Corinthians 10: 13, James 1: 12; Isaiah 40: 28-31."],
    ["When you have sinned, read","I John 1: 8-9; Hebrews 7: 25; Psalm 51: 1-12."],
    ["When you forget your blessing, read","Psalm 103"],
    ["When your faith seems failing, read","Hebrews 11; Psalm 34: 17-22"],
    ["When you want courage, read","II Corinthians 12: 9"],
    ["When looking for happiness, read","Colossians 3: 1-17; Psalm 1"],
    ["When leaving home for travel, read","Psalm 121"],
    ["When you grow bitter or critical, read","I Corinthians 13"],
    ["If you are not a Christian, read","John 3: 16; Matthew 10: 32-33; 22: 35-40; 25: 31-46; Romans 10: 9-13; Ephesians 2: 8-9"],
    ["If you are a Christian soldier, read ","I Timothy 6: 12; II Timothy 2: 3; Ephesians 6: 11-17"],
    ["To know that you have a divine Saviour, read ","John 6: 47; 20: 31; Acts 10: 43"],
    ["For an assurance of God's mercy, read","John 5: 24; Psalm 40: 1-5"],
    ["For an assurance of God's protection, read","Matthew 10: 29-31; 28: 20; Romans 8: 31-39; Philippians. 4: 6, 19; Psalm 62; 139; 1-12"],
    ["To find out the rewards of a righteous life, read","Matthew 5: 1-12; 10: 42; II Timothy 4: 7-8; I Corinthians 15: 41-58; Psalm 37"]
    ];

    var randomnumber = Math.floor(Math.random() * prayers.length);
    document.write(prayers[randomnumber][0] + " <span style=\"color:#f9e367\"><i>" + prayers[randomnumber][1] + "</i></span>");
}







