var Nn={b:"timelimitexceeded",H:"communicationerror",S:"authenticationerror",V:"namingerror",D:"ldapserver",r:"unknown"};function CH(b){this.q=b.getAttribute("name");this.d=b.getAttribute("resourceID");this.S=b.getAttribute("type");var V=b.getElementsByTagName("header");if(V!=null){this.V=new Array(V.length);for(var D=0;D<V.length;D++){var r=V.item(D);this.V[D]=new vi(r);}}}function H1(){return this.V;}CH.prototype.e=H1;function JY(V){return this.V[V];}CH.prototype.b=JY;function R6(b){if(b==null||this.V==null){return null;}for(var V=0;V<this.V.length;V++){var D=this.V[V];if(b==D.l()){return D;}}return null;}CH.prototype.o=R6;function Xm(){return this.q;}CH.prototype.D=Xm;function V5(){return this.d;}CH.prototype.H=V5;function YK(){return this.S;}CH.prototype.l=YK;function vr(b,V,D,r,H){if(H==null){H=false;}var S=new X2.S(nW("contacts"),b,ps(this,this.h),ps(this,this.r));var h=S.D("search",ax);S.b.add("onSuccessFn",D);S.b.add("onErrorFn",r);S.b.add("isAdvanced",H);h.D("select",this.q);h.D("messageClass","IPM.Contact");h.D("search",V);S.V.d();}CH.prototype.f=vr;function iB(b,V){var D=V.item("onSuccessFn");var r=V.item("onErrorFn");var H=V.item("isAdvanced");var S=b.D();var l=S.getElementsByTagName("search_results").item(0);var o=l.getAttribute("error");if(o!=null){if(r){r(this,o);}return ;}var q=null;var e=null;if(!H){var d=this.o("name");q=(d!=null)?d.h():null;d=this.o("email");e=(d!=null)?d.h():null;}var f=new Object();var N=S.getElementsByTagName("dir_entries").item(0);var p=N.getAttribute("partialResultSet");f.partialResultSet=(p=="true");f.data=new Array();var B=l.getElementsByTagName("entry");for(var K=0;K<B.length;K++){var C=B[K];var W=new MS(this.S,C);if(!H){W.e("Name",q);W.e("Email",e);}IZ.b(f.data,W);}if(q!=null){function t(h,Y){var a=h.h(q);var Z=Y.h(q);if(a>=Z){return 1;}else{if(a<Z){return -1;}else{return 0;}}}f.data.sort(t);}if(D){var o;try{D(this,f);}catch(o){}}}CH.prototype.h=iB;function Gj(b,V){var D=V.item("onErrorFn");if(D){var H;try{D(this,Nn.r);}catch(H){}}}CH.prototype.r=Gj;function vi(b){this.S=b.getAttribute("attribute");this.b=b.text;this.H=b.getAttribute("resourceID");this.D=b.getAttribute("type");}function eZ(){return this.S;}vi.prototype.V=eZ;function xM(){return this.b;}vi.prototype.h=xM;function pb(){return this.H;}vi.prototype.r=pb;function fj(){return this.D;}vi.prototype.l=fj;function MS(b,V){this.H=b;var D=V.getAttribute("type");this.S=D;if(D=="distributionList"){this.D=new Array(3);this.D["Name"]=V.getAttribute("name");this.D["Email"]=V.getAttribute("mail");this.D["omAddress"]=V.getAttribute("omAddress");this.D["omDirectRef"]=V.getAttribute("omDirectRef");var r=V.getElementsByTagName("addr");this.D["members"]=new Array(r.length);for(var H=0;H<r.length;H++){var S=r.item(H);this.D["members"][H]=S.getAttribute("display");}}else{var h=V.getElementsByTagName("attribute");this.D=new Array(h.length);this.V=new Array(h.length);for(var H=0;H<h.length;H++){var l=h.item(H);var o=l.childNodes;var q=l.getAttribute("resourceID");var e=o[0].text;var d=o[1].text;this.D[e]=d;this.V[e]=q;}}}function eE(b,V){if(this.D[V]){this.D[b]=this.D[V];}}MS.prototype.e=eE;function qI(b){return this.D[b];}MS.prototype.h=qI;function Fr(){return this.H;}MS.prototype.l=Fr;function qO(){var b="";var V=this.D["Address 1"];var D=this.D["Address 2"];var r=this.D["Address 3"];var H=this.D["Address 4"];var S=this.D["Address 5"];var h=false;var l=false;var q=false;if(V.strip()!=""){b+=V+"<br>";}if(D.strip()!=""){h=true;b+=D;}if(r.strip()!=""){if(h){b+=" ";}b+=r;l=true;}if(H.strip()!=""){if(h||l){b+=", ";}b+=H;q=true;}if(h||l||q){b+="<br>";}else{b+="&nbsp;<br>";}if(S!=null&&S.strip()!=""){b+=S;}else{b+="&nbsp;";}return b;}MS.prototype.o=qO;function du(b){return this.V[b];}MS.prototype.r=du;function Sl(){return this.S;}MS.prototype.q=Sl;function jV(){var V="";for(var D in this.D){V+="\t_values["+D+"]="+this.D[D]+"\n";}return V;}MS.prototype.b=jV;