/*  */
function mode_ttrmove_serno(path, sval, mode, dform, serid) {
	var loary = JSON.parse(return_language_str(path, sval, mode, '', ''));
	var tarval = serid.val(),
		srcval = serid.attr('value'),
		sername = serid.attr('name'),
		tartr = '',
		srctr = serid.closest('tr');
	if (isNaN(tarval) || tarval == '' || tarval == null) {
		alert(((loary['TEXTVAL_NOT_NUMBER_ERROR']) ? loary['TEXTVAL_NOT_NUMBER_ERROR'] : 'TEXTVAL_NOT_NUMBER_ERROR'));
		serid.val(serid.attr('value'));
		return;
	}
	$(dform+' input[name="'+sername+'"]').each( function() {
		var serobj = $(this);
		if (serobj.attr('value') == tarval) {
			tartr = serobj.closest('tr');
			return false;
		}
	});
	if (tartr == '') {
		//alert('錯誤!沒有符合的序號!');
		serid.val(serid.attr('value'));
		return;
	} else {
		if (parseInt(tarval) < parseInt(srcval)) {
			srctr.insertBefore(tartr);
		} else if (parseInt(tarval) > parseInt(srcval)) {
			srctr.insertAfter(tartr);
		}
		$(dform+' input[name="'+sername+'"]').each( function() {
			var serobj = $(this);
			serobj.attr('value',serobj.closest('tr').index()+1);
			serobj.val(serobj.closest('tr').index()+1);
		});
	}
}