var subOld =					'';							// Name of the current visible sub menu
var subNew =					'';							// Name of the sub menu to be made visible
var subWaiting =			'';							// Name of the sub menu waiting to be made visible
var subCount = 				108;						// Position of the sub menu from top of the page
var subDirection = 		'Down';					// Direction of movement
var subLocked = 			'No';						// Locks functionality until transitiion is complete

function initSub(section,page) {
	document.getElementById(section + 'Link').className = 'Selected';
	document.getElementById(section + 'Sub').style.top = '108px';
	subOld = section;
	document.getElementById('Sub' + page + 'Link').className = 'Selected';
}

function hideSub(subNew) {
	if (subOld != subNew) {
		if (subLocked == 'No') {
			subLocked = 'Yes';
		}
		if (subOld == '') {
			subCount = 132;
			subDirection = 'Up';
			setTimeout("showSub('" + subNew + "')", 5);
		} else if ((subCount < 132) && (subDirection == 'Down')) {
			subCount = subCount + 4;
			document.getElementById(subOld+'Sub').style.top = subCount + 'px';
			setTimeout("hideSub('" + subNew + "')", 5);
		} else {
			subDirection = 'Up';
			setTimeout("showSub('" + subNew + "')", 5);
		}
	}
}

function showSub(subNew) {
	if ((subCount > 108) && (subDirection == 'Up')) {
		subCount = subCount - 4;
		document.getElementById(subNew+'Sub').style.top = subCount + 'px';
		setTimeout("showSub('" + subNew + "')", 5);
	} else {
		subDirection = 'Down';
		subOld = subNew;
		subLocked = 'No';
		if (subWaiting != '') {
			hideSub(subWaiting);
		}
		subWaiting = '';
	}
}