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 = "#cc3300";
var borderColor = "#ccff33";
var textColor = "#ffffff";
var capTextColor = "#FFFFFF";
var closeTextColor = "#9999FF";
var width = "210"; //125
var border = "1";
//var offsetx = 50;
//var offsety = 50;
var tipVisible = false;
var theLayer="popLayer";//this is the name of the tip layer

var x = 1; //1
var y = 205; //205

function getObject(obj) {
	var theObj;
	if (typeof obj=="string") {
		theObj= eval("document." + collection + obj + styleObj);
	}
	else {
		theObj=obj;
	}
	return theObj;
}

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=text;
   writeLayer(html,tipLayer);
	//moveTo(tipLayer,x+offsetx,y+offsety);
	//moveTo(tipLayer,x,y);
   tipVisible = true;
	show(tipLayer);
}

function unpop_tip(layerToHide) {
   hide(layerToHide);
   tipVisible = false;
   //pop_tip('navigate:home');
}

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 show(obj) {
	var theObj=getObject(obj);
	theObj.visibility='visible';
}

function moveTo(obj,xL,yL) {
        obj.left = xL;
        obj.top = yL;
}

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);
	}
}