function addSelected(){var n=$("#tv a.selected");n.length>0&&addNodeUsers(n)}function addNodeUsers(n){var i,r,t;if($(n).is(".node")&&selectType!="Unit")for(i=$(n).closest("table").next("div").children("table"),t=0;t<i.length;t++)r=$(i[t]),r.next().is("div")||addUsers(r.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()})