﻿/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />
/// <reference path="jquery.intellisense.js"/>
/// <reference path="jquery.validate.js"/>

/// <reference path="Kleenex.Core.js"/>

Kleenex.MyAccount = function(clientId)
{
    this.ClientID = clientId;
    this.Selector = "#" + clientId;
    this.Initialize();
};
Kleenex.MyAccount.prototype =
{
    Name : 'Kleenex.MyAccount',
    __typeName : 'Kleenex.MyAccount',
    __class : true,
    AttachEvents : function()
    {
        var __app = this;
        var context = $(this.Selector);
        
        var handleCollapseAll = function()
        {
            $('.MyAccountCardListing', context).slideUp(350);
            $('.cardStateToggle', context).text('View');
        };
        
        var handleExpandAll = function()
        {
            $('.MyAccountCardListing', context).slideDown(350);
            $('.cardStateToggle', context).text('Close');
        };
        
        var handleCreateCardClick = function()
        {
            Kleenex.ShowModal(Kleenex.Variables.LIOCardCreationUrl, true);
        };
        
        $('#hrefCloseAll', context).click(handleCollapseAll);
        $('#hrefViewAll', context).click(handleExpandAll);
        $('#userModeCardCreation', context).click(handleCreateCardClick);
    },
    Display : function()
    {
        var __app = this;
    }
};

Kleenex.Extend(Kleenex.MyAccount, Kleenex.UserControl);
