/* createToolTips(id, text, css)
 * This function create a tool tips in the html page
 * id = id of the tool tip
 * text = tool tip text
 */
function createToolTips(id, text) {
	createToolTips(id, text,'tooltips', null);
}

/* createToolTips(id, text, css)
 * This function create a tool tips in the html page
 * id = id of the tool tip
 * text = tool tip text
 * css = tool tip style
*/
function createToolTips(id, text, css) {
	createToolTips(id, text, css, width, null);
}

/* createToolTips(id, text, css, width)
 * This function create a tool tips in the html page
 * id = id of the tool tip
 * text = tool tip text
 * css = tool tip style
 * width = fix tool tip width
*/
function createToolTips(id, text, css, width) {
	document.writeln('<div id="tt_'+id+'" class="'+css+'" style="display: none; position:absolute; z-index:10;'+(width?'width:'+width+';':'')+'">'+text+'</div>');
	if(_isIE() && parseInt(navigator.appVersion) <= 6) {
		document.write('<iframe id="tt_'+id+'_bgframe" style="display: none; position:absolute; z-index:9;" src="'+getHost()+'/empty.html"></iframe>');
	}
}


/* shToolTips(obj,id)
 * This function shows a tool tip for the specificed object
 * obj = any element objects in the document
 * id =id of the tool tip
 * return false
 */
function shToolTips(obj,id) {
	var tooltip = document.getElementById('tt_'+id);
	if(!tooltip.style.top || !tooltip.style.left) {
		tooltip.style.top = (getTop(obj)-tooltip.offsetHeight)+"px";
		tooltip.style.left = (getLeft(obj)+obj.offsetWidth)+"px";
	}
	tooltip.style.display = '';
	
	if(_isIE() && parseInt(navigator.appVersion) <= 6) {
		var bgframe = document.getElementById('tt_'+id+'_bgframe');
		if(!bgframe.style.top || !bgframe.style.left) {
			bgframe.style.top = tooltip.style.top;
			bgframe.style.left = tooltip.style.left;
		}
		if(!bgframe.width || !bgframe.height) {
			bgframe.width = tooltip.offsetWidth;
			bgframe.height = tooltip.offsetHeight;
		}
		bgframe.style.display = '';
	}
	return false;
}

/* hideToolTips(id)
 * This function hides a tool tip for the specificed object
 * id =id of the tool tip
 */
function hideToolTips(id){
	if(_isIE() && parseInt(navigator.appVersion) <= 6) {
		document.getElementById('tt_'+id+'_bgframe').style.display = 'none';
	}
	document.getElementById('tt_'+id).style.display = 'none';
}