var is_regexp = (window.RegExp) ? true : false;

function fetch_object(idname){
	if (document.getElementById){
		return document.getElementById(idname);
	}else if (document.all){
		return document.all[idname];
	}else if (document.layers){
		return document.layers[idname];
	}else{
		return null;
	}
}
function toggles(objid){
	if (!is_regexp){
		return false;
	}

	obj = fetch_object('obj_' + objid);
	img = fetch_object('img_' + objid);

	if (!obj){
		// nothing to collapse!
		if (img){
			// hide the clicky image if there is one
			img.style.display = 'none';
		}
		return false;
	}

	if (obj.style.display == 'none'){
		obj.style.display = '';
		if (img){
			img.src = img.src.replace('plus.gif', 'minus.gif');
			img.alt = 'Collapse';
			img.title = 'Collapse';
		}
	}else{
		obj.style.display = 'none';
		if (img){
			img.src = img.src.replace('minus.gif', 'plus.gif');
			img.alt = 'Expand';
			img.title = 'Expand';
		}
	}
	return false;
}