<!--
// Copyright (c) 2006 Henrik Sjostrand. All rights reserved.
//
// Note:
// Make sure the divs' CSS "display" property and "body onload" matches
// Use either display:block and onload="showDiv(..);"
// or display:none and onload="hideDiv(..);"

// Returns the style for a div
function getStyle(id) {
	var _div = null;
	if (document.getElementById) {
		_div = document.getElementById(id).style; // CSS standard
	} else if (document.all) {
		_div = document.all[id].style; // Old Internet Explorer
	} else if (document.layers) {
		_div = document.layers[id].style; // Netscape 4
	}
	return _div;
}

// Makes a div visible
function showDiv(id) {
	getStyle(id).display='block';
}

// Hides a div
function hideDiv(id) {
	getStyle(id).display='none';
}

// Makes id1 visible and hides id2
function showHideDiv(id1,id2) {
	showDiv(id1);
	hideDiv(id2);
}

// Toggles a div between visible and hidden
function toggleDiv(id) {
	if (getStyle(id).display == 'block') {
		hideDiv(id);
	} else {
		showDiv(id);
	}
}

// Toggles two divs between visible and hidden,
// only one of them is displayed at a time
function toggleDivs(id1,id2) {
	if (getStyle(id1).display == 'block') {
		showHideDiv(id2,id1);
	} else {
		showHideDiv(id1,id2);
	}
}

// Shows a form hint
function showHint(id) {
	showDiv(id);
	showHideDiv('hintOff','hintOn');
}

// Hides a form hint
function hideHint(id) {
	hideDiv(id);
	showHideDiv('hintOn','hintOff');
}

// Toggles a form hint
function toggleHint(id) {
	if (getStyle(id).display == 'block') {
		hideHint(id);
	} else {
		showHint(id);
	}
}

// Shows a form explanation
function showExp(id,idon,idoff) {
	showDiv(id);
	getStyle(idon).display='inline';
	getStyle(idoff).display='none';
}

// Hides a form explanation
function hideExp(id,idon,idoff) {
	hideDiv(id);
	getStyle(idon).display='inline';
	getStyle(idoff).display='none';
}

// Shows more of a description
function showMoreDesc(id) {
	getStyle("d"+id).display='inline';
	getStyle("ld"+id).display='none';
}

// Shows more of a note
function showMoreNote(id) {
	getStyle("n"+id).display='inline';
	getStyle("ln"+id).display='none';
}

// Debug function
function getState(id) {
	var _style = getStyle(id);
	var _state='';
	_state = _state + 'isBlock=' + (_style.display == 'block');
	_state = _state + '  isEmpty=' + (_style.display == '');
	_state = _state + '  isNone=' + (_style.display == 'none');
	return _state;
}

// -->
