function addSelected(){var n=$("#tv a.selected");n.length>0&&addNodeUsers(n)}function addNodeUsers(n){var r,t,i;if($(n).is(".node")&&selectType!="Unit")for(r=$(n).closest("table").next("div").children("table"),i=0;i<r.length;i++)t=$(r[i]),t.next().is("div")?addNodeUsers(t.find("a:last")):addUsers(t.find("a:last").html());else addUsers($(n).html())}function addUsers(n,t){if($("#divUsers :checkbox[value='"+n+"']").length)t||ShowMsgPop(n+" 已存在于列表中！");else{var i="cb"+($("#divUsers :checkbox").length+1),r=$("<div />").append($('<input type="checkbox" id="'+i+'" />').val(n)).append('<label for="'+i+'">'+n+"<\/label>");$("#divUsers").append(r)}}function removeSelected(){$("#divUsers :checked").parent().remove()}function SelectOK(){var n=window.dialogArguments||opener,i,t;n&&(i="",$("#divUsers :checkbox").each(function(){i+="，"+this.value}),t=n.$f(srcTb),t&&(t.value=i.substr(1),n.fitTextbox&&n.fitTextbox(t)));back()}var selectType="User";$(function(){var i,n,r,t;if($("#tv a[href*='__doPostBack']").attr("href","###").dblclick(function(){addNodeUsers(this)}),$("#tdUsers").poshytip(),i=window.dialogArguments||opener,i&&(n=i.$f(srcTb),n&&n.value!=""))for(r=n.value.split(/[;；、,，]/),t=0;t<r.length;t++)addUsers(r[t],!0)})