function loginsubmit()
{
	document.theform.ctest.value = "login";
	document.theform.submit();
	return false;
}

function select_first ()
{
	var index=0;
	var obj;
	while (obj = document.theform.elements[index])
	{
		if ((obj.type == "text") || (obj.type == "textarea"))
		{
			return obj.focus();
		}
		index++;
	}
}

function show_list(name, string)
{
	var arr = string.split(/\//);
	document.getElementById('show ' + name).style.display = "none";
	document.getElementById('hide ' + name).style.display = "inline";
	for (var index=0; index < arr.length; index++)
	{
		document.getElementById(arr[index] + '_descrip').style.display = "inline";
	}
}

function hide_list(name, string)
{
	var arr = string.split(/\//);
	document.getElementById('hide ' + name).style.display = "none";
	document.getElementById('show ' + name).style.display = "inline";
	for (var index=0; index < arr.length; index++)
	{
		document.getElementById(arr[index] + '_descrip').style.display = "none";
	}
}

function show(target)
{
	document.getElementById(target).style.display = "inline";
	document.getElementById('show_' + target).style.display = "none";
}

function hide(target)
{
	document.getElementById(target).style.display = "none";
	document.getElementById('show_' + target).style.display = "inline";
}

function hideobj(obj)
{
	obj.style.display = "none";
}

function chg_display (list, mode)
{
	for (var index=0; index < list.length; index++)
	{
		var obj = document.getElementById(list[index]);
		if (obj)
		{
			obj.style.display = mode;
		}
	}
}

function chooser_bg (element, field, path)
{
	var elem = document.getElementById(element);
	elem.style.backgroundImage = "url('/image" +path+ "')";

	document.all[field].value = path;
}
