function listvalue(objlist,fulllist) {

  //return the value of a list object

	if (fulllist) {
		//fulllist true indicates to send all list options not just the selected ones.
  	var ret = '';
	  for (var i = 0; i < objlist.options.length; i++) {
      ret += ','+objlist[i].value;
	  }
    return ret.substr(1);
	}

	if (objlist.type == 'select-one') {
	  for (var i = 0; i < objlist.options.length; i++) {
	    if (objlist[i].selected) {
	      return objlist[i].value;
	    }
	  }
  } else if (objlist.type == 'select-multiple') {
  	var ret = '';
	  for (var i = 0; i < objlist.options.length; i++) {
	    if (objlist[i].selected) {
	      ret += ','+objlist[i].value;
	    }
      return ret.substr(1);
	  }
  }

  return '';
}
