/*
 * jQuery tool tip
 *
 * Copyright (c) 2008 Bruce Li <bruce.li@sbs.com>
 */
var tooltip = {
	'tip'     : null,
	'isShown' : false,

	'show' : function(theObj, title, cont){
				if (this.tip == null) {
					this.tip = $('#divToolTipSrc');
				}

				// get x/y..
				var linkObj = $(theObj);

				// compose
				var tipcont = '<b>' + title + '</b><br />' + cont;
				this.tip.html(tipcont);
				this.tip.css('left', mousePos.x + 5);
				this.tip.css('top', mousePos.y + 5);

				if (!this.isShown) {
					this.tip.fadeIn('slow');
					this.isShown = true;
				} else {
					this.isShown = true;
				}
			  },

	'clear' : function() {
				this.tip.html('');
				this.tip.hide();
				this.isShown = false;
			  }

};

var mousePos = {x:0, y:0};

jQuery(document).ready(function(){
    $().mousemove(function(e){
      mousePos = {x: e.pageX, y: e.pageY};
    });

})