function tip(element_object, innerHTML, css) {
	// Give some functionality to the element_object
	element_object.tip = this;

    // Create the tip box
    // Note that tip box is a property of element_object
    this.tip_box = document.createElement("div");
    this.tip_box.style.visibility = "hidden";
    this.tip_box.className = "tip " + css;

    if(typeof innerHTML == "object") {
        this.tip_box.appendChild(innerHTML);
    } else {
        this.tip_box.innerHTML = innerHTML;
    }

    element_object.appendChild(this.tip_box);
    element_object.tip_box = this.tip_box;

    // Add Event Handlers
	element_object.onmouseover = this.onmouseover;
	element_object.onmouseout = this.onmouseout;
}

tip.prototype.set_position = function(e) {
    var IE = document.all?true:false;
    if (IE) {
        //pos_x = event.clientX + document.body.scrollLeft;
       // pos_y = event.clientY + document.body.scrollTop;
		pos_x = event.clientX + document.documentElement.scrollLeft; 
        pos_y = event.clientY + document.documentElement.scrollTop;
    } else {
        pos_x = e.pageX;
        pos_y = e.pageY;
    }

    this.tip_box.style.top = (pos_y + 10) + "px";
    this.tip_box.style.left = (pos_x + 10) + "px";
}

tip.prototype.onmouseover = function(e) {
    // Set position first then visible,
    // else you'll get some jumping effect
    if(this.tip_box.style.visibility == "hidden") {
        this.onmousemove = this.tip.onmousemove;
        this.tip_box.style.visibility = "visible";
        this.style.cursor = "pointer";
    }
}

tip.prototype.onmousemove = function(e) {
    this.tip.set_position(e);
}

tip.prototype.onmouseout = function(e) {
    this.tip_box.style.visibility = "hidden";
}