define(["jquery",
        "config",
        "views/signupform",
        "views/signinform",
        "views/forgotpasswordform",
        "views/resetpasswordform",
        "views/errorreport",
        "views/selectdomain",
        "views/ideloader"
        ],

    function($,
        Config,
        SignupForm,
        SigninForm,
        ForgotPasswordForm,
        ResetPasswordForm,
        ErrorReport,
        SelectDomain,
        IDELoader){


        function modernize(){
            Modernizr.load({
                // HTML5 placeholder for input elements
                test : Modernizr.input.placeholder,
                nope : Config.placeholderPolyfillUrl,
                complete : function(){
                    if(typeof $.fn.placeholder !== 'undefined'){
                        $('input, textarea').placeholder();
                    }
                }
            });
        }

        return {
            run : function(){
                $(document).ready(function(){

                    modernize();


                    var signupForm = $(".signup-form"),
                        signinForm = $(".login-form"),
                        forgotPasswordForm = $(".forgotpassword-form"),
                        resetPasswordForm = $(".resetpassword-form"),
                        errorContainer = $(".error-container"),
                        domainSelector = $(".select-domain"),
                        loader = $(".loader");

                    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){
                                form.showMessage(d.message);
                            });

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

                        })();
                    }

                    if(resetPasswordForm.length !== 0){
                        (function(){

                            var form = ResetPasswordForm.get(resetPasswordForm),
                                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);
                            });

                            form.resolveUserEmail();

                        })();
                    }

                    if(domainSelector.length !== 0){
                        var selectdomain = new SelectDomain.get(domainSelector);
                    }

                    if(loader.length !== 0){
                        new IDELoader.IDELoader().on("ready",function(d){
                            window.location.href = d.url;
                        });
                    }

                });
            }
        };

    }
);

@@ -240,16 +240,45 @@
 eloader%22
+,%0A        %22views/contactform%22
 %0A       
@@ -469,16 +469,37 @@
 DELoader
+,%0A        ContactForm
 )%7B%0A%0A%0A   
@@ -1500,16 +1500,74 @@
 loader%22)
+,%0A                        contactForm = $(%22.contact-form%22)
 ;%0A%0A     
@@ -5020,32 +5020,632 @@
              %7D%0A%0A
+                    if(contactForm.length !== 0)%7B%0A                        (function()%7B%0A                            var form = ContactForm.get(contactForm),%0A                                errorReport = ErrorReport.get(errorContainer);%0A%0A                            form.on(%22submitting%22, function()%7B%0A                                errorReport.hide();%0A                            %7D);%0A%0A                            form.on(%22invalid%22, function(field,message)%7B%0A                                errorReport.show(message);%0A                            %7D);%0A%0A                        %7D)();%0A                    %7D%0A%0A
                 

integrate contact form