SetupNamespaces("EZLF");EZLF.DocumentBuilding={Wizard:function(d,c){var h=this,q=d,s=c,f=null,r=null,b=null,t=null,l=null,j=null,k=new Image(),a=false,w=function(){r=new EZLF.Shared.ModalDialog();b=Elem("div");
r.Display(b,740,570);r.SetCloseButtonOnClick(function(){if(a||confirm("Are you sure you want to exit this wizard? Your document will not be created.")){r.CloseDialog()}return false});var y=Elem("h1");t=Elem("span");
y.style.lineHeight="29px";y.style.background="transparent url(/images/layout2009/forms/builder-wizard/bg_bar_39px_grey.gif) repeat-x scroll center top";y.style.borderBottom="1px solid #E5E5E5";y.appendChild(Text("Document Builder Wizard"));
t.style.marginLeft="10px";t.style.fontFamily="Arial, Helvetica, Sans-Serif";t.style.fontWeight="normal";t.style.color="#999999";t.style.fontSize="11px";t.style.lineHeight="14px";y.appendChild(t);b.appendChild(y);
l=Elem("div");l.style.position="relative";b.appendChild(l)},e=function(z){ClearElem(l);if(!z){z="Loading"}var y=Elem("div");y.style.position="absolute";y.style.zIndex=180;y.style.top="200px";y.style.left="310px";
y.style.padding="0 0 0 40px";y.style.fontSize="18px";y.style.lineHeight="32px";y.style.color="#171553";y.style.background="transparent url("+k.src+") no-repeat scroll center left";y.appendChild(Text(z+"&hellip;",true));
l.appendChild(y)},m=function(){ClearElem(l);var y=Elem("div");y.style.margin="200px auto 0 auto";y.style.fontSize="18px";y.style.lineHeight="32px";y.style.color="#B81818";y.style.textAlign="center";y.appendChild(Text("Error Contacting The Server"));
var z=Elem("a");z.style.display="block";z.style.margin="10px auto 0 auto";z.style.fontSize="12px";z.style.textAlign="center";z.href="#";z.onclick=function(){r.CloseDialog();h.StartWizard();return false
};z.appendChild(Text("Try Again"));l.appendChild(y);l.appendChild(z)},u=function(A,B,y,z){B=B-((B-y)*(z*0.5));if(B<y-1){A.style.marginTop=B+"px";setTimeout(function(){u(A,B,y,z+0.1)},50)}else{A.style.marginTop=y+"px"
}},i=function(Z){ClearElem(l);var J=[];var T=Z.split("\n");var H=T[0];propertySelectOnly=T[1].toLowerCase()=="true";var y=T[2];var O=Elem("div");O.style.height="500px";O.style.overflow="hidden";var U=Elem("div");
U.style.height="500px";U.style.marginTop="-500px";U.style.visibility="hidden";var C=Elem("h2");C.appendChild(Text(H));U.appendChild(C);U.innerHTML+=y;var P=Elem("div");P.className="documentList";for(var W=3;
W<T.length;W++){if(!T[W]||T[W].length<=0){continue}var I=T[W].split("[split]");var A=I[0];var N=I[1];var K=I[2];var X=I[3];var R=Elem("div");R.className="documentListItem";R.style.marginLeft="0px";var L=Elem("input");
L.id="InputSelectItem"+(propertySelectOnly?N:A);L.type="checkbox";L.style.verticalAlign="middle";L.style.marginRight="4px";L.value=propertySelectOnly?N:A;L.onclick=function(ac){this.blur();if(this.checked){this.parentNode.className="documentListItemActive"
}else{this.parentNode.className="documentListItem"}var aa=0;for(var ab=0;ab<J.length;ab++){aa+=J[ab].checked?1:0}S.disabled=aa>0?"":"disabled";B.style.display=aa>0?"none":"inline";if(!ac){var ac=window.event
}ac.cancelBubble=true;if(ac.stopPropagation){ac.stopPropagation()}};R.onclick=function(aa){return function(){J[aa].checked=!J[aa].checked;if(J[aa].checked){J[aa].parentNode.className="documentListItemActive"
}else{J[aa].parentNode.className="documentListItem"}var ab=0;for(var ac=0;ac<J.length;ac++){ab+=J[ac].checked?1:0}S.disabled=ab>0?"":"disabled";B.style.display=ab>0?"none":"inline"}}(J.length);var F=Elem("label");
F.onclick=function(){return false};F.htmlFor="InputSelectItem"+(propertySelectOnly?N:A);F.appendChild(Text(K.length>0?K:"(no property selected)"));if(!propertySelectOnly){F.appendChild(Text(X.length>0?" with tenants "+X:" with (no tenants selected)"))
}J.push(L);R.appendChild(L);R.appendChild(F);P.appendChild(R)}var Y=Elem("div");Y.className="documentListItem";Y.style.marginLeft="0px";Y.style.cursor="default";Y.style.border="1px solid #D2D2D2";Y.style.padding="6px 10px";
var E=Elem("a");E.href="#";E.onclick=function(){if(propertySelectOnly){window.open("/members/manageproperties.aspx?propertyID=NEW&pop=1","CreateProperty","width=740,height=480,resizable=no,scrollbars=yes,menubar=no,status=no");
RefreshToPropertyStep=function(){h.LoadPropertyTenantSelectionStep()}}else{window.open("/wizards/leases/basic.aspx?isNew=true&leaseID=NEW&createdoc="+s+"&pop=1","CreateBasicLease","width=740,height=480,resizable=no,scrollbars=yes,menubar=no,status=no");
LeasesListUpdated=function(){h.LoadPropertyTenantSelectionStep()}}return false};E.appendChild(Text("Click here to add a "+(propertySelectOnly?"property":"rental unit")));Y.appendChild(E);if(J.length>0){var V=Elem("div");
V.style.border="1px solid #D5D7E3";V.style.backgroundColor="#F4F7FF";V.style.color="#3366CC";V.style.fontSize="14px";V.style.fontWeight="bold";V.style.padding="8px 10px";V.style.margin="10px 0 1px 0";var G=Elem("div");
G.style.fontSize="11px";G.style.position="relative";if(typeof(G.style.cssFloat)!="undefined"){G.style.cssFloat="right"}else{G.style.styleFloat="right"}var M=Elem("a");M.href="#";M.onclick=function(){for(var aa=0;
aa<J.length;aa++){J[aa].checked=true;J[aa].parentNode.className="documentListItemActive"}return false};M.appendChild(Text("Select All"));var z=Elem("a");z.href="#";z.onclick=function(){for(var aa=0;aa<J.length;
aa++){J[aa].checked=false;J[aa].parentNode.className="documentListItem"}return false};z.appendChild(Text("Select None"));G.appendChild(M);G.appendChild(Text(" | "));G.appendChild(z);V.appendChild(G);V.appendChild(Text("Customize This Document For:"));
U.appendChild(V);P.appendChild(Y);U.appendChild(P);var D=Elem("div");D.style.margin="10px 0 0 0";D.style.textAlign="right";var S=Elem("input");S.className="Button";S.type="button";S.value="Continue";if(J.length!=1){S.disabled="disabled"
}S.onclick=function(){var aa=[];for(var ab=0;ab<J.length;ab++){if(J[ab].checked){aa.push(ParseInt(J[ab].value))}}if(aa.length<=0){alert("You did not select any "+(propertySelectOnly?"properties":"leases")+".  You must select at least one "+(propertySelectOnly?"property":"lease")+" to create a document for.")
}else{h.LoadDocumentSetupStep(H,propertySelectOnly,aa)}return false};var B=Elem("span");B.style.color="#999999";B.style.paddingRight="10px";B.appendChild(Text("Please select a "+(propertySelectOnly?"property":"lease")+" to continue."));
B.style.display=J.length!=1?"inline":"none";D.appendChild(B);D.appendChild(S);U.appendChild(D)}else{var Q=Elem("div");Q.style.fontWeight="bold";Q.style.color="#B81818";Q.style.margin="10px 0";Q.style.fontSize="14px";
Q.appendChild(Text("You do not have any "+(propertySelectOnly?"properties":"leases")+" on your account. "));Q.appendChild(E);U.appendChild(Q)}O.appendChild(U);l.appendChild(O);ClearElem(t);t.appendChild(Text("Step 1 of 3 - Select Rental Units"));
setTimeout(function(){if(J.length==1){J[0].checked=true}if(P.offsetHeight>340){P.style.position="relative";P.style.height="340px";P.style.overflow="auto"}U.style.visibility="visible";setTimeout(function(){u(U,-500,0,0.3)
},50)},1)},n=function(ag,aa,at){ClearElem(l);var ar=at.split("\n");var ad=ar[0];var C=ar[1].split("[break]");var Z=ar[2].split("[break]");var z=[];var S=[];var ac=Elem("div");ac.style.height="500px";ac.style.overflow="hidden";
var N=Elem("div");N.style.height="500px";N.style.marginTop="-500px";N.style.visibility="hidden";var H=Elem("h2");H.appendChild(Text(ag));N.appendChild(H);N.innerHTML+=ad;var E=Elem("div");E.style.border="1px solid #D5D7E3";
E.style.backgroundColor="#F4F7FF";E.style.color="#3366CC";E.style.fontSize="14px";E.style.fontWeight="bold";E.style.padding="8px 10px";E.style.margin="10px 0 1px 0";E.appendChild(Text("Your Requested Documents:"));
N.appendChild(E);var ah=Elem("div");for(var ax=0;ax<Z.length;ax++){if(!Z[ax]||Z[ax].length<=0){continue}var L=Z[ax].split("[split]");var ak=L[0];var aj=L[1];var M=L[2];var J=new AutoFillEditor("DivAutoFillSender_"+M,"DivAutoFillRecipient_"+M,q,M,ak,aj);
J.propertySelectOnly=aa;J.SenderName=L[3];J.SenderCompany=L[4];J.SenderAddressLine1=L[5];J.SenderAddressLine2=L[6];J.SenderCity=L[7];J.SenderState=L[8];J.SenderCountry=L[9];J.SenderZipCode=L[10];J.SenderPhoneNumber=L[11];
J.SenderFaxNumber=L[12];J.SenderEmail=L[13];J.RecipientName=L[14];J.RecipientAddressLine1=L[15];J.RecipientAddressLine2=L[16];J.RecipientCity=L[17];J.RecipientState=L[18];J.RecipientCountry=L[19];J.RecipientZipCode=L[20];
var Q=Elem("div");Q.style.background="transparent url(/images/layout2009/forms/builder-wizard/bg_bar_39px_grey.gif) repeat-x scroll center bottom";Q.style.border="1px solid #E5E5E5";if(ax!=0){Q.style.borderTopWidth=0
}Q.style.padding="6px 10px";var P=Elem("div");P.style.fontWeight="bold";P.style.fontSize="12px";var an=Elem("img");an.src="/images/create_icon.gif";an.width=16;an.height=16;an.alt="Auto-Fill Document";
an.align="absmiddle";var X=Elem("span");X.style.fontWeight="normal";X.appendChild(Text(" for:"));P.appendChild(an);P.appendChild(Text(" "+ag));P.appendChild(X);Q.appendChild(P);var B=Elem("div");var A=Elem("div");
var y=Elem("div");var au=function(ay){ay.style.marginLeft="10px";ay.style.position="relative";if(typeof(ay.style.cssFloat)!="undefined"){ay.style.cssFloat="right"}else{ay.style.styleFloat="right"}};au(A);
au(y);B.style.width="175px";A.style.width="175px";y.style.width="320px";var D=Elem("div");D.style.fontWeight="bold";D.style.color="#3366CC";D.style.margin="10px 0 0 0";D.appendChild(Text("Your Address:"));
var T=Elem("div");T.id="DivAutoFillSender_"+M;var I=Elem("div");I.style.fontWeight="bold";I.style.color="#3366CC";I.style.margin="10px 0 0 0";if(aa){I.appendChild(Text("Property Address:"))}else{I.appendChild(Text("Recipient's Address:"))
}var av=Elem("div");av.id="DivAutoFillRecipient_"+M;var K=Elem("div");var af=Elem("div");af.style.fontWeight="bold";af.style.color="#3366CC";af.style.margin="10px 0 0 0";af.appendChild(Text("Additional Information:"));
K.appendChild(af);var aw=0;for(var aq=0;aq<C.length;aq++){if(!C[aq]||C[aq].length<=0){continue}var Y=C[aq].split("[split]")[0];var V=C[aq].split("[split]")[1];var W=Elem("div");W.style.textAlign="right";
W.style.clear="both";var ab=Elem("input");ab.id="InputCustomPrompt_"+M+"_"+Y;ab.type="text";ab.style.width="165px";Pliner.Util.Display.SetInputPlaceholder(ab,"(please specify)");var O=Elem("div");O.style.width="145px";
O.style.textAlign="left";if(typeof(O.style.cssFloat)!="undefined"){O.style.cssFloat="left"}else{O.style.styleFloat="left"}O.innerHTML+=V+":&nbsp;";W.appendChild(O);W.appendChild(ab);K.appendChild(W);aw++;
S.push(ab);if(ax==0&&aq==0){setTimeout(function(ay){return function(){try{ay.focus()}catch(az){}}}(ab),750)}}if(aw>0){y.appendChild(K)}else{y.appendChild(Elem("br"))}B.appendChild(D);B.appendChild(T);A.appendChild(I);
A.appendChild(av);Q.appendChild(y);Q.appendChild(A);Q.appendChild(B);var R=Elem("div");R.style.clear="both";Q.appendChild(R);ah.appendChild(Q);z.push(J)}for(var ao=0;ao<S.length;ao++){if(ao<S.length-1){S[ao].onkeypress=function(ay){return function(az){Pliner.Util.Forms.CallbackOnEnterPressed(az,function(){S[ay+1].focus()
})}}(ao)}else{if(ao==S.length-1){S[ao].onkeypress=function(ay){Pliner.Util.Forms.CallbackOnEnterPressed(ay,function(){al.focus();al.onclick()})}}}}N.appendChild(ah);var F=new Date();var ae=Elem("div");
ae.style.border="1px solid #D5D7E3";ae.style.backgroundColor="#F4F7FF";ae.style.padding="8px 10px";ae.style.margin="1px 0 10px 0";ae.style.clear="both";var am=Elem("span");am.style.color="#3366CC";am.style.fontWeight="bold";
am.appendChild(Text("Document Date:&nbsp; ",true));ae.appendChild(am);ae.appendChild(Text("This date will appear on the document(s), indicating the date the document was signed and mailed. "));var U=Elem("div");
var G=Elem("input");G.id="InputCreationDate";G.value=(F.getMonth()+1)+"/"+F.getDate()+"/"+F.getFullYear();G.style.width="125px";U.style.marginLeft="95px";U.appendChild(Text("When will this document be mailed? "));
U.appendChild(G);ae.appendChild(U);N.appendChild(ae);var ai=Elem("div");ai.style.margin="10px 0 0 0";ai.style.textAlign="right";var ap=Elem("a");ap.style.display="block";ap.style.position="relative";if(typeof(ap.style.cssFloat)!="undefined"){ap.style.cssFloat="left"
}else{ap.style.styleFloat="left"}ap.href="#";ap.onclick=function(){h.LoadPropertyTenantSelectionStep();return false};ap.appendChild(Text("&laquo; Go Back",true));var al=Elem("input");al.className="Button";
al.type="button";al.value="Create Documents";al.onclick=function(){var ay=false;for(var az=0;az<S.length;az++){if(S[az].value==""||S[az].value=="(please specify)"){ay=true;break}}if(ay&&!confirm("You have left one or more important fields blank on this page.  \n\nIf you do not fill in the informational fields listed with each "+((aa)?"property":"lease")+", the created document may be incomplete.  \n\nClick 'Cancel' to continue working on this page, or click 'OK' to create the documents.")){return false
}g(ag,aa,C,z);return false};ai.appendChild(ap);ai.appendChild(al);N.appendChild(ai);ac.appendChild(N);l.appendChild(ac);ClearElem(t);t.appendChild(Text("Step 2 of 3 - Customize Your Documents"));setTimeout(function(){for(var ay=0;
ay<z.length;ay++){z[ay].DisplaySender();z[ay].DisplayRecipient()}if(ah.offsetHeight>300){ah.style.position="relative";ah.style.height="300px";ah.style.overflow="auto"}N.style.visibility="visible";setTimeout(function(){u(N,-500,0,0.3)
},50)},1)},g=function(z,D,B,H){var C="";for(var G=0;G<H.length;G++){var E="";C+=H[G].BuiltID+"[split]";C+=H[G].LeaseID+"[split]";C+=H[G].PropertyID+"[split]";for(var F=0;F<B.length;F++){if(!B[F]||B[F].length<=0){continue
}var I=B[F].split("[split]")[0];var y=Get("InputCustomPrompt_"+H[G].BuiltID+"_"+I).value;if(y=="(please specify)"){y=""}E+="[["+I+"]]"+y}C+=E+"[break]"}var A=new Pliner.Util.Ajax.Message("/wizards/documents/ajax/submitdocstobuild.aspx",0);
A.AddPostDataKey("document",s);A.AddPostDataKey("creationdate",Get("InputCreationDate").value);A.AddPostDataKey("data",C);A.AddOnCompletedEvent(function(J){e("Creating");p(z,D,H)});A.AddOnErrorEvent(function(J){m()
});e("Submitting");ajaxConnection.AddToQueue(A)},p=function(B,y,z){var A=new Pliner.Util.Ajax.Message("/documentprogressbar.aspx",0);A.AddOnCompletedEvent(function(C){x(B,y,z,C.responseText)});A.AddOnErrorEvent(function(C){p(B,y,z)
});ajaxConnection.AddToQueue(A)},x=function(B,z,A,y){progressDataLines=y.split("\n");if(progressDataLines.length<=0||!progressDataLines[0]||progressDataLines[0].length<=0||progressDataLines[0].indexOf("][")==-1){v(B,A)
}else{setTimeout(function(){p(B,z,A)},1000)}},v=function(B,z){e("Locating");var A=new Pliner.Util.Ajax.Message("/wizards/documents/ajax/loadprintinginfo.aspx",0);A.AddPostDataKey("documentName",B);A.AddPostDataKey("documentsCount",z.length);
for(var y=0;y<z.length;y++){A.AddPostDataKey("builtDocument"+y,z[y].BuiltID)}A.AddOnCompletedEvent(function(C){o(B,C.responseText)});A.AddOnErrorEvent(function(C){m()});ajaxConnection.AddToQueue(A)},o=function(E,B){a=true;
ClearElem(l);var D=Elem("div");D.style.height="500px";D.style.overflow="hidden";var A=Elem("div");A.style.height="500px";A.style.marginTop="-500px";A.style.visibility="hidden";var C=Elem("h2");C.appendChild(Text(E));
A.appendChild(C);var y=Elem("div");y.style.marginBottom="10px";y.appendChild(Text("Your documents are ready.  You can download them below."));A.appendChild(y);var z=Elem("div");z.style.position="relative";
z.style.height="440px";z.style.overflow="auto";z.innerHTML=B;A.appendChild(z);D.appendChild(A);l.appendChild(D);ClearElem(t);t.appendChild(Text("Step 3 of 3 - Download Your Documents"));setTimeout(function(){A.style.visibility="visible";
setTimeout(function(){u(A,-500,0,0.3)},50)},1)};h.StartWizard=function(){w();h.LoadPropertyTenantSelectionStep()};h.LoadPropertyTenantSelectionStep=function(){e();var y=new Pliner.Util.Ajax.Message("/wizards/documents/ajax/loadpropertiestenants.aspx",0);
y.AddPostDataKey("document",s);y.AddOnCompletedEvent(function(z){i(z.responseText)});y.AddOnErrorEvent(function(z){m()});ajaxConnection.AddToQueue(y)};h.LoadDocumentSetupStep=function(B,y,A){e();var D="";
for(var C=0;C<A.length;C++){if(D.length>0){D+=","}D+=A[C]}var z=new Pliner.Util.Ajax.Message("/wizards/documents/ajax/loaddoccustomization.aspx",0);z.AddPostDataKey("document",s);if(y){z.AddPostDataKey("properties",D)
}else{z.AddPostDataKey("leases",D)}z.AddOnCompletedEvent(function(E){n(B,y,E.responseText)});z.AddOnErrorEvent(function(E){m()});ajaxConnection.AddToQueue(z)};k.src="/images/ajax-loader.gif"}};var LeasesListUpdated,RefreshToPropertyStep;
