//Pop up information box II (Mike McGrath (mike_mcgrath@lineone.net,  http://website.lineone.net/~mike_mcgrath))
//Permission granted to Dynamicdrive.com to include script in archive
//For this and 100's more DHTML scripts, visit http://dynamicdrive.com
// Set it to 0, so it can be display of the popup is next to the text

//if Xoffset= 0 and Yoffset = 0, in firefox browser, the popup box will flicker constantly
Xoffset=-175;    // modify these values to ...
Yoffset=1;    // change the popup position. negative number put the box on top of the text to avoid select box at the bottom

/* What is document.all mean?
In IE, document.all is an "HTML Collection" containing all elements
of the page. You can write
document.all['foo']
to get a reference to the element with ID="foo". The offical way
to do that is
document.getElementById("foo")
and it is supported by IE from version 5.
*/


var old,skn,iex=(document.all),yyy=-1000;
// attribute/property recognized by Netscape browser
// contain layers on the page
var ns4=document.layers
var ns6=document.getElementById&&!document.all


var ie4=document.all
if (ie4){
	//set the elements of the "dek" style attribute to the "skn" variable 
	skn=document.all.dek.style
	//alert(skn)

}

if (ns4)
skn=document.dek
else if (ns6)
skn=document.getElementById("dek").style
else if (ie4)
skn=document.all.dek.style
if(ns4)document.captureEvents(Event.MOUSEMOVE);
else{
skn.visibility="visible"
skn.display="none"
}
//set the event of the mouse of onmousemove to call the get_mousemove
document.onmousemove=get_mouse;

function ehpopup(msg,bak){
Xoffset=-175;    // modify these values to ...
Yoffset=1;

//create the table for the text/definition to be display within the table
var content="<TABLE WIDTH=300 BORDER=1 BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD ALIGN=left><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>";
yyy=Yoffset;
//the skn object is pre-specified or obtain before this function is being called
//for netscape
 if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
 if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
 //for IE browser
 //set the empty "dek" element to the content
 //.innerHTML - Sets or retrieves the HTML between the start and end tags of the object.
 if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}


function get_mouse(e){
//THIS CONDITION IS FOR NETSCAPE BROWSER ONLY FOR X VARIABLE
// conditional expression using ?
//it read if netscape browser 4 or 6 set e.pageX 
// else set event.x+document.boby.scrollleft for IE
//event.x (Sets or retrieves the x-coordinate, in pixels, of the mouse pointer's position relative 
//to a relatively positioned parent element.)
//document.body.scrollLeft -- How much the page has scrolled -- Left position of the scrollset
//document.body.scrollTop -- How much the page has scrolled -- Top position of the scrollset
var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
// use to get the position of the mouse on the screen and display 
// the definition box as the left position start point  
skn.left=x+Xoffset;
// for the Y coordinate yyy = -1000
var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
skn.top=y+yyy;
}
//when onmouseout
function kill(){
Xoffset=10;    // modify these values to ...
Yoffset=-5;  
yyy=-1000;
if(ns4){skn.visibility="hidden";}

else if (ns6||ie4)
skn.display="none"
}

