var parentID = '';
var childOneID = '';
var childTwoID = '';
var timeoutID = '';

function SC_startCloser() {
	timeoutID = window.setTimeout("SC_triggerClose()", 500);
}

function SC_stopCloser() {
	if (timeoutID != '') {
		clearTimeout(timeoutID);
		timeoutID = '';
	}
}

function SC_triggerClose() {
	if (parentID != '') {
		document.getElementById(parentID).style.display = 'none';
		parentID = '';
	}
	if (childOneID != '') {
		document.getElementById(childOneID).style.display = 'none';
		childOneID = '';
	}
	if (childTwoID != '') {
		document.getElementById(childTwoID).style.display = 'none';
		childTwoID = '';
	}
	if (timeoutID != '') {
		timeoutID = '';
	}
}

function SC_displayParent(id) {
	SC_stopCloser();
	SC_triggerClose();
	document.getElementById(id).style.display = 'block';
	parentID = id;
}

function SC_displayChildOne(id) {
	SC_stopCloser();
	if (childTwoID != '') {
		document.getElementById(childTwoID).style.display = 'none';
		childTwoID = '';
	}
	if (childOneID != '') {
		document.getElementById(childOneID).style.display = 'none';
		childOneID = '';
	}
	document.getElementById(id).style.display = 'block';
	childOneID = id;
}

function SC_displayChildTwo(id) {
	SC_stopCloser();
	if (childTwoID != '') {
		document.getElementById(childTwoID).style.display = 'none';
		childTwoID = '';
	}
	document.getElementById(id).style.display = 'block';
	childTwoID = id;
}

