﻿/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />

/// <reference path="jquery-1.2.6-vsdoc.js"/>

SCOTT.CSC.AboutScottCallout = function(clientId)
{
    this.ClientID = clientId;
    this.Initialize();
}

SCOTT.CSC.AboutScottCallout.prototype =
{
    Name: 'SCOTT.CSC.AboutScottCallout',
    __typeName: 'SCOTT.CSC.AboutScottCallout',
    __class: true,
    AttachEvents: function() {
        var __app = this;
        var context = $(this.Selector);

        __app.ShowSection(window.location.hash.substr(1));

        $(".HistoryNavItem", context).children("a").click(function(e) {
            __app.ShowSection($(this).attr('href').substr(1));
        });
    },
    ShowSection: function(sectionName) {
        var __app = this;
        var context = $(this.Selector);

        $("#History-1879-1930", context).hide();
        $("#History-1931-1956", context).hide();
        $("#History-1957-1964", context).hide();
        $("#History-1966-1986", context).hide();
        $("#History-1991-1995", context).hide();
        $("#History-1996-1999", context).hide();
        $("#History-2000-2003", context).hide();
        $("#History-2004-Present", context).hide();

        var newSection = null;
        var arrowXCoord = "20px";
        
        switch (sectionName) {
            case "1879-1930":
                newSection = $("#History-1879-1930", context);
                arrowXCoord = "20px";
                break;
            case "1931-1956":
                newSection = $("#History-1931-1956", context);
                arrowXCoord = "90px";
                break;
            case "1957-1964":
                newSection = $("#History-1957-1964", context);
                arrowXCoord = "161px";
                break;
            case "1966-1986":
                newSection = $("#History-1966-1986", context);
                arrowXCoord = "231px";
                break;
            case "1991-1995":
                newSection = $("#History-1991-1995", context);
                arrowXCoord = "301px";
                break;
            case "1996-1999":
                newSection = $("#History-1996-1999", context);
                arrowXCoord = "370px";
                break;
            case "2000-2003":
                newSection = $("#History-2000-2003", context);
                arrowXCoord = "442px";
                break;
            case "2004-Present":
                newSection = $("#History-2004-Present", context);
                arrowXCoord = "518px";
                break;
            default:
                newSection = $("#History-1879-1930", context);
                arrowXCoord = "30px";
                break;
        }

        newSection.show();

        //        newSection.children(".AboutScottCalloutContent").children(".AboutScottCalloutContentArrowContainer").animate(
        //            { left: arrowXCoord },
        //            { duration: 2000 }
        //        );

        newSection.children(".AboutScottCalloutContent").children(".AboutScottCalloutContentArrowContainer").css("left", arrowXCoord);
    }
}

SCOTT.CSC.Extend(SCOTT.CSC.AboutScottCallout, SCOTT.CSC.UserControl);

