/**********************************************************************************
PopupDescriptions
*   Copyright (C) 2001 Thomas Brattli
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by Thomas Brattli
*
*   Script date: 09/04/2001 (keep this date to check versions)
*********************************************************************************/
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=lib_bwcheck()

/***************************************************************************************
Variables to set:
***************************************************************************************/
messages=new Array()
//Write your descriptions in here.

	messages[0] = "<b>Romans 3:23</b><br><br>For all have sinned and fall short of the glory of God."
	messages[1] = "<b>John 3:3-7</b><br><br>In reply Jesus declared, &quot;I tell you the truth, no one can see the kingdom of God unless he is born again.&quot; &quot;How can a man be born when he is old?&quot; Nicodemus asked. &quot;Surely he cannot enter a second time into his mother's womb to be born!&quot; Jesus answered, &quot;I tell you the truth, no one can enter the kingdom of God unless he is born of water and the Spirit. Flesh gives birth to flesh, but the Spirit gives birth to spirit. You should not be surprised by my saying, &lsquo;You must be born again.&rsquo;&quot;"
	messages[2] = "<b>Romans 8:15</b><br><br>For you did not receive a spirit that makes you a slave again to fear, but you received the Spirit of sonship. And by him we cry, <i>&quot;Abba,</i> Father.&quot;"
	messages[3] = "<b>Galatians 4:6-7</b><br><br>But when the time had fully come, God sent his Son, born of a woman, born under the law, to redeem those under the law, that we might receive the full rights of sons. Because you are God's sons, God sent his the Spirit of his Son into our hearts, the Spirit who calls out, <i>&quot;Abba,</i> Father.&quot; So you are no longer a slave, but a son; and since you are a son, God has made you also an heir."
	messages[4] = "<b>Matthew 18:3</b><br><br>And he said, &quot;I tell you the truth, unless you change and become like little children, you will never enter the kingdom of heaven.&quot;"
	messages[5] = "<b>Genesis 2:16-17</b><br><br>And the Lord God commanded the man, &quot;You are free to eat of any tree in the garden; but you must not eat from the tree of knowledge of good and evil, for when you eat of it you will surely die.&quot;"
	messages[6] = "<b>Romans 6:23a</b><br><br>For the wages of sin is death.."
	messages[7] = "<b>Romans 5:8</b><br><br>But God demonstrates his own love for us in this: While we were still sinners, Christ died for us."
	messages[8] = "<b>2 Corintians 5:21</b><br><br>God made him who had no sin to be sin for us, so that in him we might become the righteousness of Christ."
	messages[9] = "<b>Acts 2:23-24</b><br><br>&quot;This man was handed over to you by God's set purpose and foreknowledge; and you, with the help of wicked men, put him to death by nailing him to the cross. But God raised him from the dead, freeing him from the agony of death, because it was impossible for death to keep its hold on him.&quot;"
	messages[10] = "<b>John 1:12</b><br><br>Yet to all who received him, to those who believed in his name, he gave the right to become the children of God."
	messages[11] = "<b>Romans 10:9</b><br><br>If you confess with your mouth, &quot;Jesus is Lord,&quot; and believe in your heart that God raised him from the dead, you will be saved."
	messages[12] = "<b>Matthew 11:28-30</b><br><br>&quot;Come to me, all who are weary and burdened, and I <i>(Jesus)</i> will give you rest. Take my yoke upon you and learn from me, for I am gentle and humble in heart, and you will find rest for your souls. For my yoke is easy and my burden is light.&quot;"
	messages[13] = "<b>John 6:37</b><br><br>&quot;All that the Father gives me will come to me, and whoever comes to me I <i>(Jesus)</i> will never drive away.&quot;"
	messages[14] = "<b>Romans 8:16</b><br><br>The Spirit himself testifies with our spirit that we are God's children."
	messages[15] = "<b>John 3:16</b><br><br>&quot;For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.&quot;"
	messages[16] = "<b>John 10:10</b><br><br>&quot;The thief comes only to steal and kill and destroy; I <i>(Jesus)</i> have come that they may have life, and have it to the full.&quot;"
	messages[17] = "<b>Ephesians 2:4-9</b><br><br>But because of his great love for us, God, who is rich in mercy, made us alive with Christ even when we were dead in transgressions -- it is by grace you have been saved. And God raised us up with Christ and seated us with him in the heavenly realms in Christ Jesus, in order that in the coming ages he might show the incomparable riches of his grace, expressed in his kindness to us in Christ Jesus. 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."
	messages[18] = "<b>ref</b><br><br>"
	messages[19] = "<b>ref</b><br><br>"
	messages[20] = "<b>ref</b><br><br>"
	messages[22] = "<b>ref</b><br><br>"
	messages[23] = "<b>ref</b><br><br>"
	messages[24] = "<b>ref</b><br><br>"
	messages[25] = '<div class="clCaption">caption</div><br><br>Description</div>'


//To have more descriptions just add to the array.

fromX = -220 //How much from the actual mouse X should the description box appear?
fromY = -100 //How much from the actual mouse Y should the description box appear?

//To set the font size, font type, border color or remove the border or whatever,
//change the clDescription class in the stylesheet.

//Makes crossbrowser object.
function makeObj(obj){
   	this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
	if(!this.evnt) return false
	this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;
   	this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;
	this.writeIt=b_writeIt;
	return this
}

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

function b_writeIt(text){
	if (bw.ns4){this.wref.write(text);this.wref.close()}
	else this.wref.innerHTML = text
}

//Capturing mousemove
var descx = 0
var descy = 0
function popmousemove(e){descx=bw.ns4||bw.ns6?e.pageX:event.x; descy=bw.ns4||bw.ns6?e.pageY:event.y}

var oDesc;
//Shows the messages
function popup(num){
    if(oDesc){
		oDesc.writeIt('<div class="clDescription">'+messages[num]+'</div>')
		if(bw.ie5||bw.ie6) descy = descy+document.body.scrollTop
		oDesc.css.left = (descx+fromX)+px
		oDesc.css.top = (descy+fromY)+px
		oDesc.css.visibility = "visible"
    }
}
//Hides it
function popout(){
	if(oDesc) oDesc.css.visibility = "hidden"
}
function setPopup(){
   	if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove = popmousemove;
	oDesc = new makeObj('divDescription')
}
