Jaml.register('modal_box', function() {
  div({cls: 'background_overlay', style: 'display: none;'});
  div({cls: 'modal_box_wrap', style: 'display: none;'},
    a({cls: 'close', href: '#'}, '&times;'),
    Jaml.render('contact_form')
    // div({cls: 'modal_box'},
    //   h2('Welcome to e-resistible!'),
    //   p('You can use this website to order from Fu Garden over the internet. To start, please enter your postcode so we can check that Fu Garden can deliver to you. If not, we will show you a list of other nearby restaurants:'),
    //   p('If you do not know your postcode or would like to use a map instead, click here.    ')
    // )
  );
});

Jaml.register('contact_form', function() {
  div({cls: 'contact_form'},
    h2('E-mail us'),
    div({cls: 'left'},
      form({action: '/contact', method: 'POST'},
        div({cls: 'row'},
          label('Subject'),
          select({name: 'contact[subject]'},
            option('Please select...'),
            option('A problem with my order'),
            option('Sign up my Restaurant'),
            option('Become an Affiliate'),
            option('General enquiry')
          )
        ),
        div({cls: 'row'},
          label('Your name:'),
          input({type: 'text', name: 'contact[name]', cls: 'txt'})
        ),
        div({cls: 'row'},
          label('Email address:'),
          input({type: 'text', name: 'contact[email]', cls: 'txt'})
        ),
        div({cls: 'row'},
          label('Message:'),
          textarea({name: 'contact[message]'})
        ),
        div({cls: 'row'},
          label('&nbsp;'),
          input({type: 'submit', value: 'Send'})
        )
      )      
    )
  )
})
