function AutoFillEditor(senderDisplayElem, recipientDisplayElem, userID, builtID, leaseID, propertyID) { 
    this.SenderDisplayElem = senderDisplayElem;
    this.RecipientDisplayElem = recipientDisplayElem;
    this.UserID = userID;
    this.BuiltID = builtID;
    this.LeaseID = leaseID;
    this.PropertyID = propertyID;
    
    this.LoadingImage = new Image();
    this.LoadingImage.src = "/images/loading.gif";
    this.PositionInterval = null;

    this.SenderName = "";
    this.SenderCompany = "";
    this.SenderAddressLine1 = "";
    this.SenderAddressLine2 = "";
    this.SenderCity = "";
    this.SenderState = "";
    this.SenderZipCode = "";
    this.SenderPhoneNumber = "";
    this.SenderFaxNumber = "";
    this.SenderEmail = "";
    this.RecipientName = "";
    this.RecipientAddressLine1 = "";
    this.RecipientAddressLine2 = "";
    this.RecipientCity = "";
    this.RecipientState = "";
    this.RecipientZipCode = "";
}

/*
AutoFillEditor.prototype.SelectEditAddress = function() { 
    var dialog = this.ShowDialog();
    var e1, e2;
    var closureThis = this;
    
    e1 = document.createElement("div");
    e1.style.fontWeight = "bold";
    e1.style.fontSize = "16px";
    e1.appendChild(document.createTextNode("Select an Auto-Fill Address to Format"));
    dialog.appendChild(e1);
    dialog.appendChild(document.createElement("br"));
    
    e1 = document.createElement("div");
    e1.style.textAlign = "center";
    e1.style.margin = "75px auto 0 auto";
    
    e2 = document.createElement("a");
    e2.href = "#";
    e2.onclick = function() { closureThis.EditSender(); return false; };
    e2.appendChild(document.createTextNode("Edit the Sender's Address"));
    e1.appendChild(e2);
    e1.appendChild(document.createElement("br"));
    e1.appendChild(document.createElement("br"));
    e1.appendChild(document.createElement("br"));
    
    e2 = document.createElement("a");
    e2.href = "#";
    e2.onclick = function() { closureThis.EditRecipient(); return false; };
    e2.appendChild(document.createTextNode("Edit the Recipient's Address"));
    e1.appendChild(e2);
    
    dialog.appendChild(e1);
    e1 = null;
}
*/

AutoFillEditor.prototype.EditSender = function() { 
    var dialog = this.ShowDialog();
    var e1, e2, e3, e4, input, inputName, inputAddress1, inputAddress2, inputCity, inputState, inputZip, inputPhone, inputFax, inputEmail;
    var closureThis = this;
    
    e1 = document.createElement("div");
    e1.style.fontWeight = "bold";
    e1.style.fontSize = "16px";
    e1.appendChild(document.createTextNode("Format the Landlord's Auto-Fill Address"));
    dialog.appendChild(e1);
    e1 = document.createElement("div");
    e2 = document.createElement("a");
    e2.style.fontSize = "12px";
    e2.style.color = "#FF0000";
    e2.href = "#";
    e2.onclick = function() { closureThis.EditRecipient(); return false; };
    e2.appendChild(document.createTextNode("Switch to the Tenant's Auto-Fill Address"));
    e1.appendChild(document.createTextNode("   » "));
    e1.appendChild(e2);
    dialog.appendChild(e1);
    dialog.appendChild(document.createElement("br"));

    e1 = document.createElement("div");
    e2 = document.createElement("img");
    e2.src = "/images/information.gif";
    e2.width = 16;
    e2.height = 16;
    e2.align = "absmiddle";
    e1.appendChild(e2);
    e2 = document.createElement("strong");
    e2.style.color = "#4464DC";
    e2.style.fontStyle = "italic";
    e2.appendChild(document.createTextNode("Tip:"));
    e1.appendChild(e2);
    e2 = document.createElement("a");
    e2.href = "/members/settings.aspx";
    e2.target = "_blank";
    e2.appendChild(document.createTextNode("here"));
    e3 = document.createElement("span");
    e3.style.fontSize = "11px";
    e3.style.color = "#666666";
    e3.appendChild(document.createTextNode(" Use this form to format the Auto-Fill Information on this document.  Updating the formatting here will not make any changes to the actual address information stored for your leases, properties, or on your account profile.  You can change the stored address information "));
    e3.appendChild(e2);
    e3.appendChild(document.createTextNode("."));
    e1.appendChild(e3);
    dialog.appendChild(e1);
    dialog.appendChild(document.createElement("br"));    
    
    e1 = document.createElement("table");
    e1.align = "center";
    e1.cellpadding = "1";
    e1.cellspacing = "0";
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputName = document.createElement("input");
    inputName.type = "text";
    inputName.maxlength = "150";
    inputName.value = this.SenderName;
    inputName.style.width = "250px";
    e3.appendChild(document.createTextNode("Name: "));
    e4.appendChild(inputName);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputAddress1 = document.createElement("input");
    inputAddress1.type = "text";
    inputAddress1.maxlength = "128";
    inputAddress1.value = this.SenderAddressLine1;
    inputAddress1.style.width = "250px";
    e3.appendChild(document.createTextNode("Street Address: "));
    e4.appendChild(inputAddress1);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputAddress2 = document.createElement("input");
    inputAddress2.type = "text";
    inputAddress2.maxlength = "128";
    inputAddress2.value = this.SenderAddressLine2;
    inputAddress2.style.width = "250px";
    e3.appendChild(document.createTextNode("Apt./Unit Number: "));
    e4.appendChild(inputAddress2);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputCity = document.createElement("input");
    inputCity.type = "text";
    inputCity.maxlength = "128";
    inputCity.value = this.SenderCity;
    inputCity.style.width = "150px";
    inputState = document.createElement("input");
    inputState.type = "text";
    inputState.maxlength = "2";
    inputState.value = this.SenderState;
    inputState.style.width = "30px";
    inputZip = document.createElement("input");
    inputZip.type = "text";
    inputZip.maxlength = "12";
    inputZip.value = this.SenderZipCode;
    inputZip.style.width = "70px";
    e3.appendChild(document.createTextNode("City/State/Zip: "));
    e4.appendChild(inputCity);
    e4.appendChild(document.createTextNode(" "));
    e4.appendChild(inputState);
    e4.appendChild(document.createTextNode(" "));
    e4.appendChild(inputZip);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputPhone = document.createElement("input");
    inputPhone.type = "text";
    inputPhone.maxlength = "32";
    inputPhone.value = this.SenderPhoneNumber;
    inputPhone.style.width = "250px";
    e3.appendChild(document.createTextNode("Phone: "));
    e4.appendChild(inputPhone);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputFax = document.createElement("input");
    inputFax.type = "text";
    inputFax.maxlength = "32";
    inputFax.value = this.SenderFaxNumber;
    inputFax.style.width = "250px";
    e3.appendChild(document.createTextNode("Fax: "));
    e4.appendChild(inputFax);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputEmail = document.createElement("input");
    inputEmail.type = "text";
    inputEmail.maxlength = "128";
    inputEmail.value = this.SenderEmail;
    inputEmail.style.width = "250px";
    e3.appendChild(document.createTextNode("E-mail: "));
    e4.appendChild(inputEmail);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e3.colSpan = 2;
    e3.style.textAlign = "center";
    input = document.createElement("input");
    input.type = "button";
    input.value = "Update";
    input.onclick = function() { closureThis.SaveSender(dialog, input, inputName.value, inputAddress1.value, inputAddress2.value, inputCity.value, inputState.value, inputZip.value, inputPhone.value, inputFax.value, inputEmail.value); return false; };
    e3.appendChild(input);
    
    dialog.appendChild(e1);
    
    e1 = e2 = e3 = e4 = null;
}

AutoFillEditor.prototype.EditRecipient = function() { 
    var dialog = this.ShowDialog();
    var e1, e2, e3, e4, input, inputName, inputAddress1, inputAddress2, inputCity, inputState, inputZip, inputPhone, inputFax, inputEmail;
    var closureThis = this;
    
    e1 = document.createElement("div");
    e1.style.fontWeight = "bold";
    e1.style.fontSize = "16px";
    e1.appendChild(document.createTextNode("Format the Tenant's Auto-Fill Address"));
    dialog.appendChild(e1);
    e1 = document.createElement("div");
    e2 = document.createElement("a");
    e2.style.fontSize = "12px";
    e2.style.color = "#FF0000";
    e2.href = "#";
    e2.onclick = function() { closureThis.EditSender(); return false; };
    e2.appendChild(document.createTextNode("Switch to the Landlord's Auto-Fill Address"));
    e1.appendChild(document.createTextNode("   » "));
    e1.appendChild(e2);
    dialog.appendChild(e1);
    dialog.appendChild(document.createElement("br"));
    
    e1 = document.createElement("div");
    e2 = document.createElement("img");
    e2.src = "/images/information.gif";
    e2.width = 16;
    e2.height = 16;
    e2.align = "absmiddle";
    e1.appendChild(e2);
    e2 = document.createElement("strong");
    e2.style.color = "#4464DC";
    e2.style.fontStyle = "italic";
    e2.appendChild(document.createTextNode("Tip:"));
    e1.appendChild(e2);
    e2 = document.createElement("a");
    e2.href = "/members/settings.aspx";
    e2.target = "_blank";
    e2.appendChild(document.createTextNode("here"));
    e3 = document.createElement("span");
    e3.style.fontSize = "11px";
    e3.style.color = "#666666";
    e3.appendChild(document.createTextNode(" Use this form to format the Auto-Fill Information on this document.  Updating the formatting here will not make any changes to the actual address information stored for your leases, properties, or on your account profile.  You can change the stored address information "));
    e3.appendChild(e2);
    e3.appendChild(document.createTextNode("."));
    e1.appendChild(e3);
    dialog.appendChild(e1);
    dialog.appendChild(document.createElement("br"));    
    
    e1 = document.createElement("table");
    e1.align = "center";
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputName = document.createElement("input");
    inputName.type = "text";
    inputName.maxlength = "150";
    inputName.value = this.RecipientName;
    inputName.style.width = "250px";
    e3.appendChild(document.createTextNode("Name: "));
    e4.appendChild(inputName);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputAddress1 = document.createElement("input");
    inputAddress1.type = "text";
    inputAddress1.maxlength = "128";
    inputAddress1.value = this.RecipientAddressLine1;
    inputAddress1.style.width = "250px";
    e3.appendChild(document.createTextNode("Street Address: "));
    e4.appendChild(inputAddress1);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputAddress2 = document.createElement("input");
    inputAddress2.type = "text";
    inputAddress2.maxlength = "128";
    inputAddress2.value = this.RecipientAddressLine2;
    inputAddress2.style.width = "250px";
    e3.appendChild(document.createTextNode("Apt./Unit Number: "));
    e4.appendChild(inputAddress2);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e4 = e2.insertCell(e2.cells.length);
    inputCity = document.createElement("input");
    inputCity.type = "text";
    inputCity.maxlength = "128";
    inputCity.value = this.RecipientCity;
    inputCity.style.width = "150px";
    inputState = document.createElement("input");
    inputState.type = "text";
    inputState.maxlength = "2";
    inputState.value = this.RecipientState;
    inputState.style.width = "30px";
    inputZip = document.createElement("input");
    inputZip.type = "text";
    inputZip.maxlength = "12";
    inputZip.value = this.RecipientZipCode;
    inputZip.style.width = "70px";
    e3.appendChild(document.createTextNode("City/State/Zip: "));
    e4.appendChild(inputCity);
    e4.appendChild(document.createTextNode(" "));
    e4.appendChild(inputState);
    e4.appendChild(document.createTextNode(" "));
    e4.appendChild(inputZip);
    
    e2 = e1.insertRow(e1.rows.length);
    e3 = e2.insertCell(e2.cells.length);
    e3.colSpan = 2;
    e3.style.textAlign = "center";
    input = document.createElement("input");
    input.type = "button";
    input.value = "Update";
    input.onclick = function() { closureThis.SaveRecipient(dialog, input, inputName.value, inputAddress1.value, inputAddress2.value, inputCity.value, inputState.value, inputZip.value); return false; };
    e3.appendChild(input);
    
    dialog.appendChild(e1);
    
    e1 = e2 = e3 = e4 = null;
}

AutoFillEditor.prototype.SaveSender = function(dialog, saveButton, senderName, senderAddressLine1, senderAddressLine2, senderCity, senderState, senderZipCode, senderPhoneNumber, senderFaxNumber, senderEmail) { 
    this.SenderName = senderName;
    this.SenderCompany = senderName;
    this.SenderAddressLine1 = senderAddressLine1;
    this.SenderAddressLine2 = senderAddressLine2;
    this.SenderCity = senderCity;
    this.SenderState = senderState;
    this.SenderZipCode = senderZipCode;
    this.SenderPhoneNumber = senderPhoneNumber;
    this.SenderFaxNumber = senderFaxNumber;
    this.SenderEmail = senderEmail;
    
    var closureThis = this;
    var loadingDiv = document.createElement("div");
    var loadingImg = document.createElement("img");
    
    loadingImg.src = this.LoadingImage.src;
    loadingImg.width = 16;
    loadingImg.height = 16;
    loadingImg.align = "absmiddle";
    
    loadingDiv.style.textAlign = "center";
    loadingDiv.style.fontWeight = "bold";
    loadingDiv.style.color = "#12167D";
    loadingDiv.appendChild(loadingImg);
    loadingDiv.appendChild(document.createTextNode(" Saving Your Changes"));
    
    dialog.appendChild(loadingDiv);
    saveButton.disabled = true;
    
    var msg = new Pliner.Util.Ajax.Message("/wizards/ajax/saveautofillprofile.aspx?bid=" + escape(this.BuiltID) + "&lid=" + escape(this.LeaseID) + "&pid=" + escape(this.PropertyID) + "&sname=" + escape(this.SenderName) + "&sa1=" + escape(this.SenderAddressLine1) + "&sa2=" + escape(this.SenderAddressLine2) + "&scity=" + escape(this.SenderCity) + "&sstate=" + escape(this.SenderState) + "&szip=" + escape(this.SenderZipCode) + "&sphone=" + escape(this.SenderPhoneNumber) + "&sfax=" + escape(this.SenderFaxNumber) + "&semail=" + escape(this.SenderEmail) + "&rname=" + escape(this.RecipientName) + "&ra1=" + escape(this.RecipientAddressLine1) + "&ra2=" + escape(this.RecipientAddressLine2) + "&rcity=" + escape(this.RecipientCity) + "&rstate=" + escape(this.RecipientState) + "&rzip=" + escape(this.RecipientZipCode), 0);
    msg.AddOnCompletedEvent(function(msg) { closureThis.SenderSaved(msg.responseText) });
    ajaxConnection.AddToQueue(msg);
    
    dialog = null;
}

AutoFillEditor.prototype.SenderSaved = function(response) { 
    this.HideDialog();
    this.DisplaySender();
}

AutoFillEditor.prototype.SaveRecipient = function(dialog, saveButton, recipientName, recipientAddressLine1, recipientAddressLine2, recipientCity, recipientState, recipientZipCode) { 
    this.RecipientName = recipientName;
    this.RecipientAddressLine1 = recipientAddressLine1;
    this.RecipientAddressLine2 = recipientAddressLine2;
    this.RecipientCity = recipientCity;
    this.RecipientState = recipientState;
    this.RecipientZipCode = recipientZipCode;
    
    var closureThis = this;
    var loadingDiv = document.createElement("div");
    var loadingImg = document.createElement("img");
    
    loadingImg.src = this.LoadingImage.src;
    loadingImg.width = 16;
    loadingImg.height = 16;
    loadingImg.align = "absmiddle";
    
    loadingDiv.style.textAlign = "center";
    loadingDiv.style.fontWeight = "bold";
    loadingDiv.style.color = "#12167D";
    loadingDiv.appendChild(loadingImg);
    loadingDiv.appendChild(document.createTextNode(" Saving Your Changes"));
    
    dialog.appendChild(loadingDiv);
    saveButton.disabled = true;
    
    var msg = new Pliner.Util.Ajax.Message("/wizards/ajax/saveautofillprofile.aspx?bid=" + escape(this.BuiltID) + "&lid=" + escape(this.LeaseID) + "&pid=" + escape(this.PropertyID) + "&sname=" + escape(this.SenderName) + "&sa1=" + escape(this.SenderAddressLine1) + "&sa2=" + escape(this.SenderAddressLine2) + "&scity=" + escape(this.SenderCity) + "&sstate=" + escape(this.SenderState) + "&szip=" + escape(this.SenderZipCode) + "&sphone=" + escape(this.SenderPhoneNumber) + "&sfax=" + escape(this.SenderFaxNumber) + "&semail=" + escape(this.SenderEmail) + "&rname=" + escape(this.RecipientName) + "&ra1=" + escape(this.RecipientAddressLine1) + "&ra2=" + escape(this.RecipientAddressLine2) + "&rcity=" + escape(this.RecipientCity) + "&rstate=" + escape(this.RecipientState) + "&rzip=" + escape(this.RecipientZipCode), 0);
    msg.AddOnCompletedEvent(function(msg) { closureThis.RecipientSaved(msg.responseText) });
    ajaxConnection.AddToQueue(msg);
    
    dialog = null;
}

AutoFillEditor.prototype.RecipientSaved = function(response) { 
    this.HideDialog();
    this.DisplayRecipient();
}

AutoFillEditor.prototype.ShowDialog = function() { 
    clearInterval(this.PositionInterval);

    var curtain = Get("DivAutoFillCurtain");
    var dialogOuter = Get("DivAutoFillDialog");
    var dropbox = Get("ElementDropBox");
    var pageHeight = Math.max(document.documentElement.clientHeight, ((document.height) ? document.height : document.body.offsetHeight) + 20);
    var pageWidth = Math.max(document.body.clientWidth + 20, 980);
    
    if (curtain == null) { 
        curtain = document.createElement("div");
        curtain.id = "DivAutoFillCurtain";
        dropbox.appendChild(curtain);
        
        curtain.style.height = Math.ceil(pageHeight) + "px";
        curtain.style.width = Math.ceil(pageWidth) + "px";
        curtain.style.margin = "0px auto";
        curtain.style.backgroundColor = "#FFFFFF";
        curtain.style.zIndex = 200;
        curtain.style.opacity = 0.8;
        curtain.style.filter  = "alpha(opacity=80)";
        curtain.style.position = "absolute";
        curtain.style.top = "0";
        curtain.style.left = "0";
        curtain.appendChild(document.createTextNode(" "));
    }
    
    if (dialogOuter == null) { 
        var closeLink = document.createElement("a");
        var dialogInner = document.createElement("div");
        var closureThis = this;
    
        dialogOuter = document.createElement("div");
        dialogOuter.id = "DivAutoFillDialog";
        dropbox.appendChild(dialogOuter);
        
        dialogOuter.style.zIndex = 200;
        dialogOuter.style.textAlign = "left";
        dialogOuter.style.color = "#111133";
        dialogOuter.style.padding = "10px";
        dialogOuter.style.border = "2px solid #111133";
        dialogOuter.style.height = "350px";
        dialogOuter.style.width = "566px";
        dialogOuter.style.position = "absolute";
        dialogOuter.style.background = "#FFFFFF url(/images/doclib/doc_blue_bg.jpg) repeat-x scroll center top";
        
        closeLink.className = "CloseLink";
        closeLink.href = "#";
        closeLink.onclick = function() { closureThis.HideDialog(); return false; };
        closeLink.appendChild(document.createTextNode("Close"));
        dialogOuter.appendChild(closeLink);
        
        dialogInner.id = "DivAutoFillDialogContents";
        dialogOuter.appendChild(dialogInner);
        
        dialogInner = closeLink = null;
        
        this.PositionDialog();
    }
    else 
        ClearChildNodes(Get("DivAutoFillDialogContents"));
    
    curtain.style.display = "block";
    dialogOuter.style.display = "block";
    
    dropbox = curtain = null;
    
    var closureThis = this;
    this.PositionInterval = setInterval(function() { closureThis.PositionDialog(); }, 250);
    return Get("DivAutoFillDialogContents");
}

AutoFillEditor.prototype.HideDialog = function() { 
    clearInterval(this.PositionInterval);

    var curtain = Get("DivAutoFillCurtain");
    var dialog = Get("DivAutoFillDialog");
    
    if (curtain != null) curtain.style.display = "none";
    if (dialog != null) dialog.style.display = "none";
    
    dialog = curtain = null;
}

AutoFillEditor.prototype.PositionDialog = function() { 
    var dialog = Get("DivAutoFillDialog");
    dialog.style.top = GetScreenCenteredY(350) + "px";
    dialog.style.left = GetScreenCenteredX(566) + "px"
    dialog = null;
}

AutoFillEditor.prototype.DisplaySender = function() { 
    var displayElem = Get(this.SenderDisplayElem);
    ClearChildNodes(displayElem);
    
    var addrLine = document.createElement("div");
    if (this.SenderCompany != null && this.SenderCompany.length > 0)
        addrLine.appendChild(document.createTextNode(this.SenderCompany));
    else if (this.SenderName != null && this.SenderName.length > 0)
        addrLine.appendChild(document.createTextNode(this.SenderName));
    else
        addrLine.appendChild(FormatError("Name?"));
    displayElem.appendChild(addrLine);
    
    addrLine = document.createElement("div");
    if (this.SenderAddressLine1 != null && this.SenderAddressLine1.length > 0)
        addrLine.appendChild(document.createTextNode(this.SenderAddressLine1));
    else
        addrLine.appendChild(FormatError("Address?"));
    displayElem.appendChild(addrLine);
    
    if (this.SenderAddressLine2 != null && this.SenderAddressLine2.length > 0) { 
        addrLine = document.createElement("div");
        addrLine.appendChild(document.createTextNode(this.SenderAddressLine2));
        displayElem.appendChild(addrLine);
    }
    
    addrLine = document.createElement("div");
    if (this.SenderCity != null && this.SenderCity.length > 0)
        addrLine.appendChild(document.createTextNode(this.SenderCity));
    else
        addrLine.appendChild(FormatError("City?"));
    addrLine.appendChild(document.createTextNode(" "));
    if (this.SenderState != null && this.SenderState.length > 0)
        addrLine.appendChild(document.createTextNode(this.SenderState));
    else
        addrLine.appendChild(FormatError("State?"));
    addrLine.appendChild(document.createTextNode(", "));
    if (this.SenderZipCode != null && this.SenderZipCode.length > 0)
        addrLine.appendChild(document.createTextNode(this.SenderZipCode));
    else
        addrLine.appendChild(FormatError("Zip?"));
    displayElem.appendChild(addrLine);
    
    addrLine = document.createElement("div");
    addrLine.style.height = "4px";
    displayElem.appendChild(addrLine);
    
    if (this.SenderPhoneNumber != null && this.SenderPhoneNumber.length > 0) { 
        addrLine = document.createElement("div");
        addrLine.appendChild(document.createTextNode("Phone: "));
        addrLine.appendChild(document.createTextNode(this.SenderPhoneNumber));
        displayElem.appendChild(addrLine);
    }
    
    if (this.SenderFaxNumber != null && this.SenderFaxNumber.length > 0) { 
        addrLine = document.createElement("div");
        addrLine.appendChild(document.createTextNode("Fax: "));
        addrLine.appendChild(document.createTextNode(this.SenderFaxNumber));
        displayElem.appendChild(addrLine);
    }
    
    if ((this.SenderPhoneNumber != null && this.SenderPhoneNumber.length > 0) || (this.SenderFaxNumber != null && this.SenderFaxNumber.length > 0)) { 
        addrLine = document.createElement("div");
        addrLine.style.height = "4px";
        displayElem.appendChild(addrLine);
    }
        
    addrLine = document.createElement("div");
    addrLine.appendChild(document.createTextNode("E-mail: "));
    addrLine.appendChild(document.createTextNode(this.SenderEmail));
    displayElem.appendChild(addrLine);
    
    addrLine = document.createElement("div");
    addrLine.style.padding = "4px 0 0 0";
    var editLink = document.createElement("a");
    var editImg = document.createElement("img");
    var closureThis = this;
    editLink.style.textDecoration = "none";
    editImg.src = "/images/edit_icon.gif";
    editImg.width = 16;
    editImg.height = 16;
    editImg.alt = "Edit";
    editImg.align = "absmiddle";
    editLink.appendChild(editImg);
    editLink.appendChild(document.createTextNode(" Edit Auto-fill Info"));
    editLink.href = "#";
    editLink.onclick = function() { closureThis.EditSender(); return false; }
    addrLine.appendChild(editLink);
    displayElem.appendChild(addrLine);
    
    editImg = editLink = addrLine = displayElem = null;
}

AutoFillEditor.prototype.DisplayRecipient = function() { 
    var displayElem = Get(this.RecipientDisplayElem);
    ClearChildNodes(displayElem);
    
    var addrLine = document.createElement("div");
    if (this.RecipientName != null && this.RecipientName.length > 0)
        addrLine.appendChild(document.createTextNode(this.RecipientName));
    else
        addrLine.appendChild(FormatError("Name?"));
    displayElem.appendChild(addrLine);
    
    addrLine = document.createElement("div");
    if (this.RecipientAddressLine1 != null && this.RecipientAddressLine1.length > 0)
        addrLine.appendChild(document.createTextNode(this.RecipientAddressLine1));
    else
        addrLine.appendChild(FormatError("Address?"));
    displayElem.appendChild(addrLine);
    
    if (this.RecipientAddressLine2 != null && this.RecipientAddressLine2.length > 0) { 
        addrLine = document.createElement("div");
        addrLine.appendChild(document.createTextNode(this.RecipientAddressLine2));
        displayElem.appendChild(addrLine);
    }
    
    addrLine = document.createElement("div");
    if (this.RecipientCity != null && this.RecipientCity.length > 0)
        addrLine.appendChild(document.createTextNode(this.RecipientCity));
    else
        addrLine.appendChild(FormatError("City?"));
    addrLine.appendChild(document.createTextNode(" "));
    if (this.RecipientState != null && this.RecipientState.length > 0)
        addrLine.appendChild(document.createTextNode(this.RecipientState));
    else
        addrLine.appendChild(FormatError("State?"));
    addrLine.appendChild(document.createTextNode(", "));
    if (this.RecipientZipCode != null && this.RecipientZipCode.length > 0)
        addrLine.appendChild(document.createTextNode(this.RecipientZipCode));
    else
        addrLine.appendChild(FormatError("Zip?"));
    displayElem.appendChild(addrLine);
    
    addrLine = document.createElement("div");
    addrLine.style.padding = "4px 0 0 0";
    var editLink = document.createElement("a");
    var editImg = document.createElement("img");
    var closureThis = this;
    editLink.style.textDecoration = "none";
    editImg.src = "/images/edit_icon.gif";
    editImg.width = 16;
    editImg.height = 16;
    editImg.alt = "Edit";
    editImg.align = "absmiddle";
    editLink.appendChild(editImg);
    editLink.appendChild(document.createTextNode(" Edit Auto-fill Info"));
    editLink.href = "#";
    editLink.onclick = function() { closureThis.EditRecipient(); return false; }
    addrLine.appendChild(editLink);
    displayElem.appendChild(addrLine);
    
    editImg = editLink = addrLine = displayElem = null;
}

function FormatError(text) {
    var error = Elem("div");
    error.style.color = "#B81818";
    error.appendChild(Text(text));
    return error;
}