/* tooltip */

var tooltip_showing = 'a';
var tooltip_tim = 0;

function tooltip (sender, p_left, p_top, p_width, id, txt) {
	if (!document.getElementById(id)) {
		var tooltip = document.createElement("div");
		tooltip.className = 'tooltip_pop';
		tooltip.style.left = p_left + 'px';
		tooltip.style.top = p_top + 'px';
		tooltip.style.width = p_width + 'px';
		tooltip.style.zIndex = '1';
		tooltip.style.fontWeight = 'normal';
		tooltip.id = id;
		tooltip.innerHTML = txt + '<a class="tooltip_x" href="javascript:hide_tooltip(\''+id+'\')">x</a>';

		sender.parentNode.appendChild(tooltip);
		if (tooltip_showing != "a") hide_tooltip(tooltip_showing);
		clearTimeout(tooltip_tim);
		tooltip_tim = setTimeout("hide_tooltip('"+id+"')", 30000);
		tooltip_showing = id;
	} else if (tooltip_showing != id) {
		document.getElementById(id).style.display = "block";
		if (tooltip_showing != "a") hide_tooltip(tooltip_showing);
		clearTimeout(tooltip_tim);
		tooltip_tim = setTimeout("hide_tooltip('"+id+"')", 30000);
		tooltip_showing = id;
	}
}

function hide_tooltip(id) {
	document.getElementById(id).style.display = "none";
	if(tooltip_showing == id) tooltip_showing = "a";
}

/* tooltip */


/* input field */

function change_field (elm, old_value, new_value) {
	if (elm.value == old_value) elm.value = new_value;
}

/* input field */
