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