﻿
App.Account.Login = function() {

    /* Private */

    /* Properties */

    var cmp = {};





    /* Methods */

    var init = function() {

        /* Constructor */
        
        cmp.mcnLogInForm = new TVI.Form({
        
            ID: 'mcnLogInForm',
            url: TVI.handlers + 'App.Account.aspx/logIn',
            success: function(d){
                        
                window.location.href = App.redirect !== undefined ? App.redirect : '/my';
            
            }
        
        });

        //handle login event
        TVI.addListener('accountChanged', function(d) {

            window.location.href = App.redirect !== undefined ? App.redirect : '/my';

        });

    };





    /* Public */

    TVI.apply(cmp, {

        /* Properties */

        /* Methods */

    });


    TVI.ready(init);


    return cmp;


} ();
