/**
 * @file
 * @brief Dispute Tree JavaScript functions.
 */
 
/**
 * @fn onMilestoneClick(id)
 * @brief Expand or collapse milestone in the Dispute Tree.
 * @param[in] id ID of the milestone element.
 */
function onMilestoneClick(id) {

	var milestone = document.getElementById(id);

	if (milestone) {
		if (milestone.style.display == 'none') {
			milestone.style.display = '';
		} else {
			milestone.style.display = 'none';
		}
	}
}

/**
 * @fn onStateClick(id)
 * @brief Expand or collapse state in the Dispute Tree.
 * @param[in] id ID of the state element.
 */
function onStateClick(id) {

	var state = document.getElementById(id);

	if (state) {
		if (state.style.display == 'none') {
			state.style.display = '';
		} else {
			state.style.display = 'none';
		}
	}
}

/**
 * @fn showPopupWin(event, id)
 * @brief Show tooltip popup window in the Dispute Tree.
 * @param[in] event Mouse event.
 * @param[in] id ID of the action element.
 */
function showPopupWin(event, id) {
	var element = document.getElementById(id);

	if (element) {
		if (element.style.visibility != 'hidden') return;
		// needed for IE
		if (isIE()) element.style.pixelLeft = 180;
		element.style.top = (event.clientY + document.body.scrollTop - 58) + "px";
		// call common routine
		showElement(id);
	}
}

/**
 * @fn hidePopupWin(id)
 * @brief Hide tooltip popup window in the Dispute Tree.
 * @param[in] id ID of the action.
 */
function hidePopupWin(id) {
	// call common routine
	hideElement(id)
}

