//set up cross-browser event 
window.onmouseover = function(event){window.event = event;}


//Glossary container box (div)
var str_div = '<div ID="box" style="position:absolute;top:0px;display:none;"><table border="0" bgcolor="#333399" cellpadding="3" cellspacing="1" width="314"><tr><td valign="top" height="19" valign="middle" class="glossaryHeaderCell"><img src="/skillswise/glossary/images/icon.gif" width="35" height="19" alt="" border="0">&nbsp;<strong><font color="#FFFFFF">Skillswise Glossary</font></strong></td></tr><tr><td id="gdata" bgcolor="#ccccff"><i>abyssal</i><br>Extremely deep.</td></tr></table></div>';

//write the box
document.write(str_div);

//refernce the box
var gbox = document.getElementById("box");

/*this replaces the original (and v. big) overlib.js. 
The function names are the same so as not to have to 
edit the pages that use it.*/

function overlib(strContent){

//event ref
var e = window.event;	
	
	var rightOK = checkWidths(e.clientX);
	
	//poition box left		
	if (rightOK){
		gbox.style.left = e.clientX+"px";
		}else{
		gbox.style.left = (e.clientX-315)+"px";
		}
	//work out if we've scrolled vertically:
	var offsety = (navigator.userAgent.indexOf("MSIE") != -1) ? document.body.scrollTop : window.pageYOffset;
	//some stupid IE5 mac problem...
	if (navigator.userAgent.indexOf("Mac") !=-1) offsety -= 100;
	
	//position box top
	gbox.style.top = (e.clientY+offsety)+"px";
	
	//put the content in the box
	document.getElementById("gdata").innerHTML = strContent;
	
	//display box
	gbox.style.display = "block";	
	
return false;
}

//Calculates whether the pop up jargon box should appear on the right or the left of the cursor.
	function checkWidths (x)
	{
		if ( (x+332) > document.body.offsetWidth) return false;
		else return true;
	}

//stop displaying the box
function nd(){
	gbox.style.display = "none";
	return false;
}

