

// No of pixels to the right/left of the cursor to show the popup
// Values between 3 and 12 are best
	if (typeof offsetx == 'undefined') { var offsetx = -130;}

// No of pixels  below the cursor to show the popup
// Values between 3 and 12 are best
	if (typeof offsety == 'undefined') { var offsety = 20;}
	
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
		ie5 = true;
	} else {
		ie5 = false; }
} else {
	ie5 = false;
}

/////////for version 6
if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 6')>0) {
		ie6 = true;
	} else {
		ie6 = false; }
} else {
	ie6 = false;
}

/////////for version 7
if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 7')>0) {
		ie7 = true;
	} else {
		ie7 = false; }
} else {
	ie7 = false;
}

var x = "0";
var y = "0";
var snow = "0";
var sw = "0";
var cnt = "0";
var dir = "1";
var tr = "1";

 var over = document.getElementById("overDiv").style;
	document.onmousemove = mouseMove;


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Caption popup center
function dcc(text, title) {
	dtc(2,text,title);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Clears popups if appropriate
function nd() {
	if ( cnt >= 1 ) { sw = 0 };

		if ( sw == 0 ) {
			snow = 0;
			hideObject(over);
		} else {
			cnt++;
		}
	
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function dtc(d,text, title) {
	txt = "<TABLE WIDTH='' BORDER=0 CELLPADDING='2' CELLSPACING=0 BGCOLOR='#E75D29' align=center><TR><TD><TABLE WIDTH='' BORDER=0 CELLPADDING=1 CELLSPACING=0 align=''><TR><TD align=''><FONT FACE=\"Zurich BT\" COLOR='white' style='font-size:14px;'><B>"+title+"</b></FONT></TD></TR></TABLE><TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 BGCOLOR='white' align=center width=100%><TR><TD><div align=justify><FONT FACE=\"Zurich BT\" COLOR='black' style='font-size:11px;'>"+text+"</FONT></div></TD></TR></TABLE></TD></TR></TABLE>"
	layerWrite(txt);
	dir = d;
	disp();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function disp() {
	
		if (snow == 0)  {
			if (dir == 2) { // Center
				moveTo(over,x+offsetx,y+offsety);
			}
			if (dir == 1) { // Right
				moveTo(over,x+offsetx,y+offsety);
			}
			if (dir == 0) { // Left
				moveTo(over,x-offsetx-width,y+offsety);
			}
			showObject(over);
			snow = 1;

	}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function mouseMove(e) {

	if (ie7) {
		x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;
	}
	else
	{x=e.x; y=e.y;

	}
	if (snow) {
		if (dir == 2) { // Center
			moveTo(over,x+offsetx,y+offsety);
		}
		if (dir == 1) { // Right
			moveTo(over,x+offsetx,y+offsety);
		}
		if (dir == 0) { // Left
			moveTo(over,x-offsetx-width,y+offsety);
		}
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function cClick() {
	hideObject(over);
	sw=0;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Writes to a layer
function layerWrite(txt) {
document.getElementById("overDiv").innerHTML = txt
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function showObject(obj) {
 obj.visibility = "visible"
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function hideObject(obj) {
 obj.visibility = "hidden"
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function moveTo(obj,xL,yL) {
	obj.left = xL
	obj.top = yL
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
