
var gDDFakeExist	= false;
var g_arDDFake		= new Array();
function showSelect(str){
	
	dd = document.getElementsByTagName('SELECT');

	
	for(i=0;i< dd.length; i++){
		
		if(!gDDFakeExist){
	
			d						= document.createElement("div");
			d.style.position		= 'absolute';
			d.style.left			= getOffsetLeft(dd[i],true) + 'px';
			d.style.top				= getOffsetTop(dd[i],true) + 'px';
			d.style.width			= dd[i].offsetWidth;
			d.style.height			= dd[i].offsetHeight;
			d.style.backgroundColor	= "white";
			d.style.border			= '1px solid #999999';
			
			document.body.appendChild(d);
			g_arDDFake[i] = d;
		}
		else{

			if(str == "hidden")		g_arDDFake[i].style.visibility = "visible";
			if(str == "visible")	g_arDDFake[i].style.visibility = "hidden";

		}
		
		dd[i].style.visibility = str;
	
	}

	gDDFakeExist = true;
}

var xTooltip = null;
var mx; var my;
function showTooltip(e, alpha, className){

	showSelect('hidden');

	if(alpha == undefined)
		alpha = 30;

	if(className == undefined)
		className = 'tbTooltip';

	SetAlphaPanel(alpha);

	if(xTooltip==null){

		xTooltip					= document.createElement("DIV");
		
		xTooltip.className			= className;
		
		xTooltip.style.position		= 'absolute';
		xTooltip.style.left			= '0px';
		xTooltip.style.top			= '0px';
		
		document.body.appendChild(xTooltip);
	}
	xTooltip.style.zIndex		= 90;

	if(e != null){
		mx = mouseX(e); 
		my = mouseY(e);
		xTooltip.style.left = (mx + 20) + 'px';
		xTooltip.style.top	= (my - 10) + 'px';
	}


	xTooltip.style.visibility = 'visible';

}

function hideTooltip(){

	if(xTooltip!=null){
		SetAlphaPanel(0);
		document.body.removeChild(xTooltip);
		xTooltip = null;
	}

	showSelect('visible');



}

function repoTooltip(){

	if(mx > screen.width/2)
		xTooltip.style.left = getOffsetLeft(xTooltip, true) -  (getOffsetLeft(xTooltip, true) - 200+50);
	if(my > screen.height/2)
		xTooltip.style.top = getOffsetTop(xTooltip, true) - (xTooltip.offsetHeight) + 16;

}