define(["jquery",
        "views/signupform",
        "views/signinform",
        "views/forgotpasswordform",
        "views/errorreport"],

    function($,SignupForm,SigninForm,ForgotPasswordForm,ErrorReport){


        return {
            run : function(){
                $(document).ready(function(){
                    var signupForm = $(".signup-form"),
                        signinForm = $(".login-form"),
                        forgotPasswordForm = $(".forgotpassword-form"),
                        errorContainer = $(".error-container");

                    if(signupForm.length !== 0){
                        (function(){
                            var form = SignupForm.get(signupForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(d){
                                window.location.href = d.url;
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });
                        })();
                    }

                    if(signinForm.length !== 0){
                        (function(){
                            var form = SigninForm.get(signinForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(){
                                alert("logged in");
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });
                        })();
                    }

                    if(forgotPasswordForm.length !== 0){
                        (function(){
                            var form = ForgotPasswordForm.get(forgotPasswordForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(d){
                                alert(d.message);
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });

                        })();
                    }

                });
            }
        };

    }
);

@@ -99,24 +99,59 @@
 swordform%22,%0A
+        %22views/resetpasswordform%22,%0A
         %22vie
@@ -184,16 +184,25 @@
 ction($,
+%0A        
 SignupFo
@@ -204,16 +204,25 @@
 nupForm,
+%0A        
 SigninFo
@@ -224,16 +224,25 @@
 ninForm,
+%0A        
 ForgotPa
@@ -252,16 +252,52 @@
 ordForm,
+%0A        ResetPasswordForm,%0A        
 ErrorRep
@@ -572,32 +572,102 @@
 assword-form%22),%0A
+                        resetPasswordForm = $(%22.resetpassword-form%22),%0A
                 
@@ -2950,32 +2950,807 @@
              %7D%0A%0A
+                    if(resetPasswordForm.length !== 0)%7B%0A                        (function()%7B%0A%0A                            var form = ResetPasswordForm.get(resetPasswordForm),%0A                                errorReport = ErrorReport.get(errorContainer);%0A%0A                            form.on(%22submitting%22, function()%7B%0A                                errorReport.hide();%0A                            %7D);%0A%0A                            form.on(%22success%22, function(d)%7B%0A                                window.location.href = d.url;%0A                            %7D);%0A%0A                            form.on(%22invalid%22, function(field,message)%7B%0A                                errorReport.show(message);%0A                            %7D);%0A%0A%0A                        %7D)();%0A                    %7D%0A%0A
                 

integrate reset password form