var tooltip_open=0;
var timerID=0;
var show_tooltip_status=1;


var current_obj;
var current_tip_code;
var current_tooltip_content;


var hide_time_schedule=0;
var show_time_schedule=100;


function get_obj_y(obj)
{

	temp_pos=0;

	if (obj.offsetParent!==null)
	{

		while(obj.offsetParent!==null)
		{
			temp_pos+=obj.offsetTop;
			if (obj.offsetParent!==null)
				obj=obj.offsetParent;
			else
				return temp_pos+15;
		}
	}
	else
		if (obj.y)
			temp_pos+=obj.y;
	

	
	return temp_pos+15;
	
}//function get_obj_y(obj)




function get_obj_x(obj)
{
	

	
	
	temp_pos=0;
	
	

	if (obj.offsetParent!==null)
	{

		while(obj.offsetParent!==null)
		{
			temp_pos+=obj.offsetLeft;
			if (obj.offsetParent!==null)
				obj=obj.offsetParent;
			else
				return temp_pos;
		}
	}
	else
		if (obj.x)
			temp_pos+=obj.x;
	

	
	return temp_pos;
	
}//function get_obj_x(obj)




function show_instant_tooltip(tooltip_object_id)
{
	if (tooltip_open==1)
		return false;
	
	obj=current_obj;

	tooltip_place=element_by_id(tooltip_object_id);

	
	X_position=get_obj_x(obj);
	Y_position=get_obj_y(obj);
	



	
	
	
	
	
	
	
	
	tooltip_place.style.visibility='visible';
	
	
	
	
	tooltip_place.style.left=X_position;
	tooltip_place.style.top=Y_position;
	
	tooltip_open=1;
	clearTimeout(timerID);

}//function show_instant_tooltip(tooltip_object_id)


function hide_instant_tooltip(tooltip_object_id)
{

	tooltip_place=element_by_id(tooltip_object_id);

	
	
	tooltip_place.style.visibility='hidden';
	tooltip_open=0;
}//function hide_tooltip(obj)


function schedule_hide_tooltip(tooltip_object_id)
{
	
	if (timerID)
		clearTimeout(timerID);
	timerID=setTimeout('hide_instant_tooltip("'+tooltip_object_id+'")',hide_time_schedule);
	

}//function schedule_hide_tooltip(obj)


function schedule_show_tooltip(obj,tooltip_object_id)
{
	current_obj=obj;

	tooltip_object=element_by_id(tooltip_object_id);


	if (timerID)
		clearTimeout(timerID);
	setTimeout('show_instant_tooltip("'+tooltip_object_id+'")',show_time_schedule);
	//show_instant_tooltip(tooltip_object_id);
}//function schedule_show_tooltip(obj)


function over_tooltip(tooltip_object_id)
{
	
	clearTimeout(timerID);
	
}//function over_tooltip()


function out_tooltip(tooltip_object_id)
{

	timerID=setTimeout('hide_instant_tooltip("'+tooltip_object_id+'")',hide_time_schedule);
}//function out_tooltip()









function element_by_id(temp)
{
	if(document.all)
		{
			s="."+temp;
			return eval("document.all"+s);
				
	
		}
	
	if(!document.all && document.getElementById)
		{
			
			return document.getElementById(temp);
				
	
		}	
}//function element_by_id(temp)


function tooltip_login_user()
{
	
	command='login';
	username=document.forms["tooltip_login_form"].username.value;
	password=document.forms["tooltip_login_form"].password.value;
	popup_myinfobox('/home/index.php?command='+command+'&username='+username+'&password='+password,'myinfobox','210','700','center','front');
	
	document.forms["tooltip_login_form"].username.value="";
	document.forms["tooltip_login_form"].password.value="";	
}//function tooltip_login_user()

