﻿// Will be done differently as a jsgui control.

RegisterBox.ResidentialOrder = function(container) {
    this.container = container;
    this.init(0);
}
var p = RegisterBox.ResidentialOrder.prototype;
p.inheritFrom(CDiv);

p.init = function(depth) {
    // A box at the top that shows the addresses, once they have been entered.
    //var d = this.createMyDiv();
    
    this.superInit(0);
    
    var divAddressEntry = nD();
    setClass(divAddressEntry, 'divAddressEntry');
    
    var spanTitle = nS();
    setClass(spanTitle, 'spanTitle');
    spanTitle.innerHTML = 'Residential Order';
    this.el.appendChild(spanTitle);
    
    var divAddressesDisplay = document.getElementById('divAddressesDisplay');
    
    //this.divAddressEntry = divAddressEntry;
    //this.div.appendChild(divAddressEntry);
    //AddressEntry = function(div, container, addressType) {
    var addressEntry = new AddressEntry(this, 'contact', false);
    this.addressEntry = addressEntry;
    
    btnAddressOK = nBtn('OK');
    this.el.appendChild(btnAddressOK);
    btnAddressOK.onclick = function() {this.control.btnAddressOK_click();};
    btnAddressOK.control = this;
    
    this.numbersEntry = new RegisterBox.NumbersEntry(this);
    
    this.addMyDiv();
}
p.btnAddressOK_click = function() {
    //alert ('ok');
    // check the address is valid.
    
    // hide the address editor
    this.addressEntry.hide();
    // show the numbers input
    
}
