/**
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//\\\       \\\\\\\\|
//\\\ @@    @@\\\\\\| Hot Toddy User Registration
//\\ @@@@  @@@@\\\\\|
//\\\@@@@| @@@@\\\\\|
//\\\ @@ |\\@@\\\\\\| http://www.hframework.com
//\\\\  ||   \\\\\\\| (c) Copyright 2009 Richard York, All rights Reserved
//\\\\  \\_   \\\\\\|
//\\\\\        \\\\\| Use and redistribution are subject to the terms of the license.
//\\\\\  ----  \@@@@| http://www.hframework.com/license
//@@@@@\       \@@@@|
//@@@@@@\     \@@@@@|
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/

$$.extend({
  Register : {
    Ready : function() {
    
      $('div#hUserRegister input').blur(
        function() {
          $$.Register.Save();
        }
      );
    },

    Save : function()
    {
      var $post = '';
  
      $('div#hUserRegister input').each(
        function() {
          $post += '&' + this.name + '=' + encodeURIComponent(this.value);
        }
      );

      $('div#hUserRegister textarea').each(
        function() {
          $post += '&' + this.name + '=' + encodeURIComponent(this.value);
        }
      );
  
      $('div#hUserRegister select').each(
        function() {
          $post += '&' + this.name + '=' + encodeURIComponent(this.value);
        }
      );

      // Save data as it is entered, so that it doesn't have to be entered again if 
      // the user leaves the current location and returns.
      $.post(
        $$.Path('/plugins/hUser/hUserRegister/save'),
        $post,
        function() {
        }
      );
    }
  }
});

$(document).ready(
  function() {
    $$.Register.Ready();
  }
);