(function($){
    $.fn.LostPassWizard = function()
    {
        var wizard = new wizardMaker(this);

        wizard.addSlide('lostpass_page1');
        wizard.setInitialSlide('lostpass_page1');
        wizard.setSlideOptions('lostpass_page1', {
            'action' : 'slides/lostpass_page1',
            'width' : 500,
            'height' : 300,
            'onLoad' : lostpassPage1Load
        });

        wizard.addSlide('lostpass_page2');
        wizard.setSlideOptions('lostpass_page2', {
            'action' : 'slides/lostpass_page2',
            'width' : 500,
            'height' : 300,
            'onLoad' : lostpassPage2Load,
            'dataNeeded' : 'page2'
        });



/*********************************LOADS*******************************************************/

       function lostpassPage1Load()
       {
           $('#wizard_lostpass_page1 .next').click(function(){

              $('#wizard_lostpass_page1 .error').html("");$

              $.post(absoluteFilepath('actions/lostPassword'),
              {
                  'email' : $('#wizard_lostpass_page1 .email').val(),
              },
              function(results){
                 if(results == "success")
                 {
                     wizard.setData('page2', {'email' : $('#wizard_lostpass_page1 .email').val()})

                     wizard.activate({
                        'sendTo' : 'lostpass_page2'
                     });
                 }
                 else
                 {
                     $('#wizard_lostpass_page1 .error').html(results);
                 }
              });

              
           });
       }

       function lostpassPage2Load()
       {
           
       }
        
/*********************************FUNCTIONS*******************************************************/

    }
})(jQuery);



