var lastexpanded = null;
var lasticon = null;
var lastcontrol;

function ShowHide(what)
{
	// For normal browsers - not ie

	if (lastexpanded != null) {
		lastexpanded.style.display='none';
		lastexpanded = null;
	}
	if (lasticon != null) {
		lasticon.src = '/graphics/collapse.png';
		lasticon = null;
	}

	arr = document.getElementsByName(what+'text');
	if (arr.length > 0) {
		var obj = document.getElementsByName(what+'text').item(0);
		var img = document.getElementsByName(what+'ind').item(0);
		if (obj != lastcontrol) {
			if (obj.style.display=='none') {
				lastexpanded = obj;
				lasticon = img;
				obj.style.display='';
				img.src='/graphics/expand.png';
			} else {
				obj.style.display='none';
				img.src='/graphics/collapse.png';
			}
		}
		lastcontrol = obj;
	} else {
		for (i=0;i<document.all.length;i++) {
			tag = document.all(i).name;
			if (tag == what+'text') {
				if (lastcontrol != document.all(i)) {
					if (document.all(i).style.display=='none') {
						document.all(i).style.display='';
						lastexpanded = document.all(i);
						for (x=0;x<document.all.length;x++) {
							tag = document.all(x).name;
							if (tag == what+'ind') {
								document.all(x).src='/graphics/expand.png';
								lasticon = document.all(x);
							}
						}
					} else {
						document.all(i).style.display='none';
						for (x=0;x<document.all.length;x++) {
							tag = document.all(x).name;
							if (tag == what+'ind') document.all(x).src='/graphics/collapse.png';
						}
					}
				}
				lastcontrol = document.all(i);
			}
		}
	}
}

