function toggleMessage(onOrOff) {
	if (document.getElementById) {
		var part = document.getElementById('elipsis');
		var full = document.getElementById('extended');
		if (part && full) {
			  if (part.style) {
					part.style.display = (onOrOff ? 'none' : 'inline');
					full.style.display = (onOrOff ? 'inline' : 'none');
				}
		}
	}
}

function textCounter(field, countfield, maxlimit) {
/*
* The input parameters are: the field name;
* field that holds the number of characters remaining;
* the max. numb. of characters.
*/
	if (field.value.length > maxlimit) // if the current length is more than allowed
		field.value =field.value.substring(0, maxlimit); // don't allow further input
	else
		countfield.value = maxlimit - field.value.length; // set the display field to remaining number
} 


function copyToList(from,to)
{
	fromList = eval('document.forms[0].' + from);
	toList = eval('document.forms[0].' + to);
	if (toList.options.length > 0 && toList.options[0].value == 'temp')
	{
		toList.options.length = 0;
	}
	var sel = false;
	for (i=0;i<fromList.options.length;i++)
	{
		var current = fromList.options[i];
		if (current.selected)
		{
			sel = true;
			if (current.value == 'temp')
			{
				alert ('You cannot move this text!');
				return;
			}
			txt = current.text;
			val = current.value;
			toList.options[toList.length] = new Option(txt,val);
			fromList.options[i] = null;
			i--;
		}
	}
	if (!sel) alert ('You haven\'t selected any options!');
}

function allSelect()
{
	List = document.forms[0].chosen;
	if (List.length && List.options[0].value == 'temp') return;
	for (i=0;i<List.length;i++)
	{
		List.options[i].selected = true;
	}
}
