﻿//Simple class for toggling registration details

var registrationForm = {

    //right panels
    sun_Welcome: ".sun_Welcome",
    sun_Register: ".sun_Register",

    //left panels
    sun_ForgotPass: ".sun_ForgotPass",
    sun_Login: ".sun_Login",
    sun_ForgotPassInputPanel: ".sun_ForgotPassInputPanel",
    sun_ForgotPassStatus: ".sun_ForgotPassStatus",

    sun_DefaultFade: 200,

    ToggleRegister: function(doShow, timeout) {
        if (timeout == null)
            timeout = this.sun_DefaultFade;
        var _this = this;
        if (doShow) {
            $(this.sun_Welcome).fadeOut(timeout,
            function() {
                $(_this.sun_Welcome).hide();
                $(_this.sun_Register).fadeIn(timeout).show();
            });
        }
        else {

            $(this.sun_Register).fadeOut(timeout,
            function() {
                $(_this.sun_Register).hide();
                $(_this.sun_Welcome).fadeIn(timeout).show();
            });
        }

    },

    ToggleForgotPassword: function(doShow, timeout) {
        if (this.timeout == null)
            this.timeout = this.sun_DefaultFade;
        var _this = this;
        if (doShow) {
            $(this.sun_Login).fadeOut(timeout,
            function() {
                $(_this.sun_Login).hide();
                $(_this.sun_ForgotPass).fadeIn(timeout).show();
                $(_this.sun_ForgotPassInputPanel).show();
                $(_this.sun_ForgotPassStatus).hide();
            });
        }
        else {
            $(this.sun_ForgotPass).fadeOut(timeout,
            function() {
                $(_this.sun_ForgotPass).hide();
                $(_this.sun_Login).fadeIn(timeout).show();
            });
        }
    }

}