function adminOperate(obj)
{
	var action = obj.options[obj.selectedIndex].value;
	if (action == '')
	{
		obj.options[0].selected = true;
		return;
	}
	var f = document.forms['admin'];
	var idList = '';
	for (i=f.elements.length; i>0; i--)
	{
		if (f.elements[i-1].type.toLowerCase() == "checkbox")
		{
			if (f.elements[i-1].checked)
			{
				idList += f.elements[i-1].value.toString() + ",";
			}
		}
	}
	if (idList == '')
	{
		alert('没有选择任何记录行');
		obj.options[0].selected = true;
		return;
	}
	idList = idList.substring(0, idList.length - 1);
	if (action == 'move')
	{
		location.href = 'topic_move.aspx?topicid=' + idList;
	}
	else if (action == 'delete')
	{
		location.href = 'topic_delete.aspx?topicid=' + idList;
	}
	else
	{
		f.event.value = action;
		f.action = location.href;
		f.submit();	
	}
}

function switchTopicOpenMode(box)
{
	var isPopNew   = box.checked;
	var anchorTags = document.getElementsByTagName('a');
	for (var i=0; i<anchorTags.length; i++)
	{
		if (anchorTags[i].getAttribute('name') != 'topiclink') continue;
		anchorTags[i].target = isPopNew ? '_blank' : '_self';
	}
}
