var input;
var help_bt;
var help_bt_id;
var help_bt_container;
var tip_content;

function helpToolTip(_form_id, _help_bt_id, _tip_content)
{
	//input = document.forms[_form_id].getElementsByTagName('input')[0];//document.getElementById(input_id);
	input = document.getElementById('query');//document.getElementById(input_id);
	help_bt_id = _help_bt_id;
	tip_content = _tip_content;
	input.onfocus = showHelpBt; 
	input.onblur = hideHelpBt;
	showHelpBt();

		//--- pokaż ikonkę pomocy w textfieldzie ---//
			
	function showHelpBt()
	{
		if(!help_bt_container)
		{
			help_bt_container = document.createElement("div");
			help_bt_container.style.position = 'absolute';
			help_bt_container.style.right = '94px';			
			help_bt_container.style.top = '46px';
			if(navigator.appName=='Microsoft Internet Explorer')
				help_bt_container.style.top = '48px';			
			help_bt_container.style.width = '20px';			
			help_bt_container.style.height = '16px';
			input.parentNode.appendChild(help_bt_container);
		}
		
		if(!document.getElementById(help_bt_id))
		{
			help_bt = document.createElement("span");
			help_bt.id = help_bt_id;
			help_bt.style.position = 'absolute';
			help_bt.style.right = '2px';			
			help_bt.style.top = '0px';			
			help_bt_container.appendChild(help_bt);
			help_bt.onclick = '';
		}
		help_bt.style.display = 'block';

					// utwórz tip-a dla elementu
			new Tip(
				help_bt,
				tip_content,
				{
					className: 'light',
					delay: 0.01,
					effect: 'appear',
					hook: {target: 'topLeft', tip: 'topRight'},
					offset: {x: -120, y: -7},
					showOn: 'mouseover',
					hideOn: 'mouseout'
				}
			);
			
		
	}
	
		//--- ukryj ikonkę pomocy w textfieldzie ---//

	function hideHelpBt()
	{
		if(help_bt = document.getElementById(help_bt_id))
			help_bt.style.display = 'none';		
			//help_bt.parentNode.removeChild(help_bt);
	}


}