/***********************************************
* TOGGLE More/Less
* Function to extend/contract body of objects, normally used for DIVs.
* Inputs are ID of object (object must have an ID), followed by height (e.g. "auto" or "300px"), followed by
* id of text element to toggle between "more" and "less" text.
* Copyright Marian Zamfirescu. This note must be kept with all instances of the sripts wherever used.
* This script may not be re-distributed in any for-profit form.
***********************************************/

function more(obj, displaystyle, text){

	var targ = document.getElementById(obj);
	var prop = "height";
	var propoverflow = "overflow";
	if (targ.style[prop] != "auto" || targ.style[prop] == "") {
		propreset = targ.style[prop];
	}
	
	switch (true) {

	case (targ.style[prop] == "" || targ.style[prop] != displaystyle):
		targ.style[prop] = displaystyle;
		targ.style[propoverflow] = "auto";
		document.getElementById(text).innerHTML = "less...";

		break;

	default :
		targ.style[prop] = propreset;
		targ.style[propoverflow] = "hidden";
		document.getElementById(text).innerHTML = "...more";

	}

}