ns4 = (document.layers)? true:false
dom = (document.all)? true:false
ie5=navigator.userAgent.indexOf('MSIE 5')>0?true:false;
ie6=navigator.userAgent.indexOf('MSIE 6')>0?true:false;

var collection="";
var styleObj="";
if (dom) {
	collection="all.";
	styleObj=".style";
	}


var bgcolor = "#bdbdbd";
var borderColor = "#000000";
var textColor = "#000000";
var capTextColor = "#FFFFFF";
var closeTextColor = "#9999FF";
var width = "200";
var border = "2";
var offsetx = 10;
var offsety = 10;
var tipVisible = false;
var theLayer="popLayer";//this is the name of the tip layer

var x = 0;
var y = 0;

tipLayer=getObject(theLayer);//Make sure Layer is above script and then makesure you define tipLayer before any functions need it.

document.onmousemove = mouseMove;
if (ns4) document.captureEvents(Event.MOUSEMOVE);

function pop_tip(text) {
	html = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR="+borderColor+"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="+bgcolor+"><TR><TD><span style='font-family:Arial,Helvetica;color:"+textColor+";font-size:10px'>"+text+"</span></TD></TR></TABLE></TD></TR></TABLE>";
		writeLayer(html,tipLayer);
		moveTo(tipLayer,x+offsetx,y+offsety);
		tipVisible = true;
		show(tipLayer);
}

function unpop_tip(layerToHide) {
   hide(layerToHide);
   tipVisible = false;
}

function hide(obj) {
	//This function is overridden from cp.js.  
	//It's a quick fix to solve the scroll bar issue with IE and the tip_up functions.
	var theObj=getObject(obj);
	theObj.visibility='hidden';
	tipVisible = false;
}

function writeLayer(html,obj) {
	if (ns4) {
		document.popLayer.document.write(html);
		document.popLayer.document.close();
	}
	else if (dom) {
		document.all.popLayer.innerHTML = html;
	}
}

function mouseMove(e) {
	if (ns4) {x=e.pageX; y=e.pageY;}
	if (dom) {x=event.x; y=event.y;}
	if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
	if (ie6) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
    if (tipVisible) {
		moveTo(tipLayer,x+offsetx,y+offsety);
	}
}

