var required = { 'nlForm':{ 'email':'Your Email Address','zipcode':'Postal Code' } };

$(function() {
  $('#contentbar').corner();

  $('#informedLink a').click( function() {
    $.scrollTo($('#nlForm'),{duration:800});
    return(false);
  });

  $('#nlForm').bind('submit',function() {
    if (validate(this)) {
      var formdata = new Object();
      $('input:text',this).each(function() {
        formdata[this.name] = this.value;
      });
      $.ajax({
        dataType:'json',
        url:'/cgi-bin/nlsignup.pl',
        data:formdata,
        type:'post',
        success:function(sdata) {
          $('#nlForm').fadeOut(300,function() {
            $(this).html('<h5 class="formmsg">'+((sdata.status)?'Thank you! You are now subscribed.':'There was a problem. Please check your information & try again.')+'</h5>').fadeIn(300);
          });
        }
      });        
    }
    return(false);
  });
});
