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());resizeBox()}function addUsers(n,t){$("#ddlUsers option[value='"+n+"']").length>0?t||ShowMsgPop(n+" 已存在于列表中！"):$("<option value='"+n+"'>"+n+"<\/option>").appendTo("#ddlUsers")}function removeSelected(){var n=$("#ddlUsers");n.find("option:selected").remove();resizeBox()}function SelectOK(){var n=window.dialogArguments||opener,i,t;n&&(i="",$("#ddlUsers option").each(function(){i+="，"+this.text}),t=n.$f(srcTb),t&&(t.value=i.substr(1),n.fitTextbox&&n.fitTextbox(t)));top.close()}function resizeBox(){$("#main,#tdTree,#tdBtns,#tdUsers,.autoScroll,#ddlUsers").height($("#up").innerHeight());var n=$("#ddlUsers");n.width(n.parent().innerWidth())}var selectType="User";$(function(){var i,n,r,t;if($("#tv a[href*='__doPostBack']").attr("href","###").dblclick(function(){addNodeUsers(this)}),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);resizeBox();$(window).resize(resizeBox)})