function check(form, name)
{
	var ret = new Array();
	for(i = 0; i < form.elements.length; i ++)
	{
		var elm = form.elements[i];
		if(elm.type == "checkbox" && elm.name == name && elm.checked) ret.push(elm.value);
	}
	return ret;
}

function image(arg)
{
	if(document.images)
	{
		res = new Image();
		res.src = arg;
		return res;
	}
}

function trim(str)
{
	while(str.substring(0, 1) == ' ') str = str.substring(1, str.length);
	while(str.substring(str.length - 1, str.length) == ' ') str = str.substring(0, str.length - 1);
	return str;
}