﻿		
function OpenDemo1(){
	dcsMultiTrack("DCS.dcssip", "www.microsoft.com", "DCS.dcsuri", "/dynamics/asmartmove/demo.html");
    window.open("demo.html", "_blank",'height=720,width=1024', false);
}

function OpenDemo2(){
	dcsMultiTrack("DCS.dcssip", "www.microsoft.com", "DCS.dcsuri", "/dynamics/asmartmove/demo2.html");
    window.open("demo2.html", "_blank",'height=720,width=1024', false);	
}

function OpenDemo3(){
	dcsMultiTrack("DCS.dcssip", "www.microsoft.com", "DCS.dcsuri", "/dynamics/asmartmove/demo3.html");
    window.open("demo3.html", "_blank",'height=720,width=1024', false);	
}

if (!window.SilverlightSite3)
	SilverlightSite3 = {};

SilverlightSite3.Page = function() 
{
}

SilverlightSite3.Page.prototype =
{
    handleLoad: function(control, userContext, rootElement) {
        this.control = control;

        this.intro1 = this.control.content.findName("intro1");
        this.page2 = this.control.content.findName("page2");
        this.page3 = this.control.content.findName("page3");
        this.page4 = this.control.content.findName("page4");

        this.player = this.player = new EmbeddedPlayer(this.control, this.control.content.findName("Page"), 0, 355, 200, this.control.id);

        this.videoPlayer = this.control.content.findName("VideoPlayer");

        this.watchCustomerVideoAnim = this.control.content.findName("WatchCustomerVideo");
        this.watchCustomerVideoAnim.addEventListener("Completed", Silverlight.createDelegate(this, this.WatchCustomerVideoAnim_Completed));

        this.smartMoveVO = this.control.content.findName("SmartMoveVO");
        this.hearFromVO = this.control.content.findName("HearFromVO");
        this.takeActionVO = this.control.content.findName("TakeActionVO");

        this.QB_ReplacerKitLink_Copy2 = this.control.content.findName("QB_ReplacerKitLink_Copy2");
        this.QB_ReplacerKitLink_Copy2.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.SmartMoveQBLink_Click));

        this.Peachtree_ReplacerKitLink_Copy2 = this.control.content.findName("Peachtree_ReplacerKitLink_Copy2");
        this.Peachtree_ReplacerKitLink_Copy2.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.Peachtree_ReplacerKitLink_Copy2_Click));

        this.smartMoveBusinessNeedsLink = this.control.content.findName("smartMoveBusinessNeedsLink");
        this.smartMoveBusinessNeedsLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.SmartMoveBusinessNeedsLink_Click));

        this.smartMoveEasyImplementationLink = this.control.content.findName("smartMoveEasyImplementationLink");
        this.smartMoveEasyImplementationLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.SmartMoveEasyImplementationLink_Click));

        this.smartMovePriceLink = this.control.content.findName("smartMovePriceLink");
        this.smartMovePriceLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.SmartMovePriceLink_Click));

        this.homePriceLink = this.control.content.findName("ShowPricingLink");

        this.demoLinks = this.control.content.findName("FlashDemoLinks");

        this.yellowLink = this.control.content.findName("YellowLink");

        this.purpleLink = this.control.content.findName("PurpleLink");

        this.redLink = this.control.content.findName("RedLink");

        this.takeActionButton = this.control.content.findName("TakeActionButton");
        this.takeActionButton.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.TakeAction_MouseEnter));

        this.takeActionCanvas = this.control.content.findName("take_action");
        this.takeActionCanvas.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.TakeActionCanvas_MouseLeave));

        this.qB_ReplacerKitLink_Copy3 = this.control.content.findName("QB_ReplacerKitLink_Copy3");
        this.qB_ReplacerKitLink_Copy3.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.SuccessStoriesLink_Click));

        this.peachtree_ReplacerKitLink_Copy3 = this.control.content.findName("Peachtree_ReplacerKitLink_Copy3");
        this.peachtree_ReplacerKitLink_Copy3.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.PeachtreeSuccessStoriesLink_Click));

        this.skipIntroButton = this.control.content.findName("SkipIntroButton");
        this.skipIntroButton.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.SkipIntroButton_Click));
        this.skipIntroButton.Visibility = "Visible";

        this.replayIntroButton = this.control.content.findName("ReplayIntroButton");
        this.replayIntroButton.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.ReplayIntroButton_Click));
        this.replayIntroButton.Visibility = "Collapsed";

        this.muteButton = this.control.content.findName("MuteButtonPage");
        this.muteButton.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.MuteButton_Click));
        this.muteButton.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.MuteButton_MouseEnter));
        this.muteButton.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.MuteButton_MouseLeave));

        this.muteButtonToolTip = this.control.content.findName("MuteButtonToolTip");


        this.introLiveDemoLink = this.control.content.findName("IntroLiveDemoLink");


        this.watchCustVideoLink = this.control.content.findName("WatchCustVideoLink");
        this.watchCustVideoLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.WatchCustVideoLink_Click));

        this.introChatNowLink = this.control.content.findName("IntroChatNowLink");


        this.qB_ReplacerKitLink_Copy1 = this.control.content.findName("QB_ReplacerKitLink_Copy1");
        this.qB_ReplacerKitLink_Copy1.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.QuickBooksReplacerLink_Click));

        this.peachtree_ReplacerKitLink_Copy1 = this.control.content.findName("Peachtree_ReplacerKitLink_Copy1");
        this.peachtree_ReplacerKitLink_Copy1.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.Peachtree_ReplacerKitLink_Click));

        this.takeActionDemosLink = this.control.content.findName("TakeActionDemosLink");
        this.takeActionDemosLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.LiveDemoLink_Click));

        this.takeActionChatLink = this.control.content.findName("TakeActionChatLink");
        this.takeActionChatLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.ChatNowLink_Click));

        this.qB_ReplacerKitLink = this.control.content.findName("QB_ReplacerKitLink");
        this.peachtree_ReplacerKitLink = this.control.content.findName("Peachtree_ReplacerKitLink");

        this.qB_ReplacerKitLink_Copy = this.control.content.findName("QB_ReplacerKitLink_Copy");
        this.qB_ReplacerKitLink_Copy.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.QuickBooksReplacerLink_Click));

        this.peachtree_ReplacerKitLink_Copy = this.control.content.findName("Peachtree_ReplacerKitLink_Copy");
        this.peachtree_ReplacerKitLink_Copy.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.Peachtree_ReplacerKitLink_Click));

        this.actionPageDemoLink = this.control.content.findName("ActionPageDemoLink");
        this.actionPageDemoLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.LiveDemoLink_Click));

        this.actionPageChatNowLink = this.control.content.findName("ActionPageChatNowLink");
        this.actionPageChatNowLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.ChatNowLink_Click));

        this.video_wmv = this.control.content.findName("video_wmv");
        this.video_wmv.addEventListener("MediaOpened", Silverlight.createDelegate(this, this.onMediaOpened));
        //this.video_wmv.Source = "mms://wm.microsoft.com/ms/business/dynamics/asmartmove/video.WMV";

        this.introAnimation = this.control.content.findname("img1Anim");
        this.introAnimation.addEventListener("Completed", Silverlight.createDelegate(this, this.Intro_Completed));


        var pageId = this.GetQueryString();
        if (pageId) {
            if (pageId == "1") {
                this.ChangePage("RedLink");
                this.LiveDemoLink_Click(this.control.content);
            }
            else if (pageId == "2") {
                this.ChangePage("YellowLink");
                this.SmartMovePriceLink_Click(this.control.content);
            }
            else {
                this.StartIntro();
            }
        }
        else {
            this.StartIntro();
        }
    },

    StartIntro: function() {
        this.video_wmv.Source = "http://mediadl.microsoft.com/MediaDL/WWW/D/dynamics/asmartmove/video.wmv";
        //this.control.content.findName("intro1").Visibility = "Visible";
        //this.introAnimation.Begin();
    },

    onMediaOpened: function(sender, eventArgs) {
        sender.findName("intro1").Visibility = "Visible";
        sender.Play();
        this.introAnimation.Begin();
        sender.removeEventListener("MediaOpened", 0);
    },

    PageLink_Click: function(sender, eventArgs) {
        this.ChangePage(sender.Name);
    },

    ChangePage: function(name) {
        this.video_wmv.Stop();
        this.introAnimation.Stop();
        this.smartMoveVO.Stop();
        this.hearFromVO.Stop();
        this.takeActionVO.Stop();
        this.ResetHearFromPage();
        this.CloseAllPanels();

        switch (name) {
            case "YellowLink":
                this.intro1.Visibility = "Collapsed";
                this.page3.Visibility = "Collapsed";
                this.page4.Visibility = "Collapsed";
                this.page2.Visibility = "Visible";
                this.takeActionCanvas.Visibility = "Visible";
                this.smartMoveVO.Play();
                dcsMultiTrack("DCS.dcssip", "www.microsoft.com", "DCS.dcsuri", "/dynamics/asmartmove/whymakeasmartmove.html");
                break;

            case "PurpleLink":
                this.intro1.Visibility = "Collapsed";
                this.page2.Visibility = "Collapsed";
                this.page4.Visibility = "Collapsed";
                this.page3.Visibility = "Visible";
                this.takeActionCanvas.Visibility = "Visible";
                this.hearFromVO.Play();
                dcsMultiTrack("DCS.dcssip", "www.microsoft.com", "DCS.dcsuri", "/dynamics/asmartmove/hearfromotherslikeyou.html");
                break;

            case "RedLink":
                this.intro1.Visibility = "Collapsed";
                this.page2.Visibility = "Collapsed";
                this.page3.Visibility = "Collapsed";
                this.page4.Visibility = "Visible";
                this.takeActionCanvas.Visibility = "Collapsed";
                this.takeActionVO.Play();
                dcsMultiTrack("DCS.dcssip", "www.microsoft.com", "DCS.dcsuri", "/dynamics/asmartmove/takeaction.html");
                break;
        }
    },

    TakeAction_MouseEnter: function(sender, eventArgs) {
        //if(document.getElementById("BusinessNeeds").style.display != "block" && document.getElementById("Assets").style.display != "block" && document.getElementById("EasyImplementation").style.display != "block" && document.getElementById("Pricing").style.display != "block" && document.getElementById("CaseStudies").style.display != "block"){
        this.CloseAllPanels();
        sender.findName("TakeActionLinks").Visibility = "Visible";
        sender.findName("take_action")["Canvas.ZIndex"] = 1000;
        sender.findName("takeAction").Begin();
        //}  

    },

    TakeActionCanvas_MouseLeave: function(sender, eventArgs) {
        sender.findName("takeActionCollapse").Begin();
        sender.findName("TakeActionLinks").Visibility = "Collapsed";
        sender.findName("take_action")["Canvas.ZIndex"] = 0;
    },

    SuccessStoriesLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        sender.findName("CaseStudiesPanel").Visibility = "Visible";
        sender.findName("window").Begin();
        document.getElementById("CaseStudies").style.display = "block";
    },

    PeachtreeSuccessStoriesLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        sender.findName("PeachtreeCaseStudiesPanel").Visibility = "Visible";
        sender.findName("peachtreewindow").Begin();
        document.getElementById("PeachtreeCaseStudies").style.display = "block";
    },

    CaseStudiesPanelClose_Click: function(sender, eventArgs) {
        var panel = this.control.content.findName("CaseStudiesPanel");

        if (document.getElementById("CaseStudies"))
            document.getElementById("CaseStudies").style.display = "none";

        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
        this.control.content.findName("arrow1_Copy1").renderTransform.children.getItem(0).ScaleX = 1;
    },

    PeachtreeCaseStudiesPanelClose_Click: function(sender, eventArgs) {
        var panel = this.control.content.findName("PeachtreeCaseStudiesPanel");

        if (document.getElementById("PeachtreeCaseStudies"))
            document.getElementById("PeachtreeCaseStudies").style.display = "none";

        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
        this.control.content.findName("arrow1_Copy1").renderTransform.children.getItem(0).ScaleX = 1;
    },

    SkipIntroButton_Click: function(sender, eventArgs) {
        this.introAnimation.Seek("0:5:0");
        this.video_wmv.Stop();
        this.skipIntroButton.Visibility = "Collapsed";
    },

    MuteButton_Click: function(sender, eventArgs) {
        if (this.video_wmv.Volume > 0) {
            sender.findName("MuteButton_On").Begin();
            this.video_wmv.Volume = 0;
            this.smartMoveVO.Volume = 0;
            this.hearFromVO.Volume = 0;
            this.takeActionVO.Volume = 0;
        }
        else {
            sender.findName("MuteButton_Off").Begin();
            this.video_wmv.Volume = 0.5;
            this.smartMoveVO.Volume = 0.5;
            this.hearFromVO.Volume = 0.5;
            this.takeActionVO.Volume = 0.5;
        }
    },

    MuteButton_MouseEnter: function(sender, eventArgs) {
        this.muteButtonToolTip.Visibility = "Visible";
    },

    MuteButton_MouseLeave: function(sender, eventArgs) {
        this.muteButtonToolTip.Visibility = "Collapsed";
    },

    LiveDemoLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        this.TakeActionCanvas_MouseLeave(sender, eventArgs);
        sender.findName("WebCastDemoPanel").Visibility = "Visible";
        sender.findName("webcastPanelShow").Begin();
        document.getElementById("WebCastDemos").style.display = "block";
    },

    WebCastDemoPanelClose_Click: function() {
        var panel = this.control.content.findName("WebCastDemoPanel");

        if (document.getElementById("WebCastDemos"))
            document.getElementById("WebCastDemos").style.display = "none";

        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
    },

    PricingPanelClose_Click: function() {
        var panel = this.control.content.findName("PricingPanel");
        this.control.content.findName("arrow3_Copy").RenderTransform.Children.GetItem(0).ScaleX = 1;

        if (document.getElementById("Pricing"))
            document.getElementById("Pricing").style.display = "none";

        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
    },

    AssetsPanelClose_Click: function() {
        var panel = this.control.content.findName("AssetsPanel");
        this.control.content.findName("arrow1_Copy").RenderTransform.Children.GetItem(0).ScaleX = 1;

        if (document.getElementById("Assets"))
            document.getElementById("Assets").style.display = "none";
        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
    },

    PeachtreeAssetsPanelClose_Click: function() {
        var panel = this.control.content.findName("PeachtreeAssetsPanel");
        this.control.content.findName("arrow1_Copy").RenderTransform.Children.GetItem(0).ScaleX = 1;

        if (document.getElementById("PeachtreeAssets"))
            document.getElementById("PeachtreeAssets").style.display = "none";
        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
    },

    BusinessNeedsPanelClose_Click: function() {
        var panel = this.control.content.findName("BusinessNeedsPanel");
        this.control.content.findName("arrow1_Copy2").RenderTransform.Children.GetItem(0).ScaleX = 1;

        if (document.getElementById("BusinessNeeds"))
            document.getElementById("BusinessNeeds").style.display = "none";
        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
    },

    EasyImplementationPanelClose_Click: function() {
        var panel = this.control.content.findName("EasyImplementationPanel");
        this.control.content.findName("arrow1_Copy3").RenderTransform.Children.GetItem(0).ScaleX = 1;

        if (document.getElementById("EasyImplementation"))
            document.getElementById("EasyImplementation").style.display = "none";
        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
    },

    WatchCustVideoLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        this.videoPlayer.Visibility = "Visible";
        this.watchCustomerVideoAnim.Begin();
    },

    SmartMoveQBLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        sender.findName("AssetsPanel").Visibility = "Visible";
        sender.findName("AssetsPanelShow").Begin();
        document.getElementById("Assets").style.display = "block";
    },

    Peachtree_ReplacerKitLink_Copy2_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        sender.findName("PeachtreeAssetsPanel").Visibility = "Visible";
        sender.findName("PeachtreeAssetsPanelShow").Begin();
        document.getElementById("PeachtreeAssets").style.display = "block";
    },

    SmartMoveBusinessNeedsLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        sender.findName("BusinessNeedsPanel").Visibility = "Visible";
        sender.findName("BusinessNeedsPanelShow").Begin();
        document.getElementById("BusinessNeeds").style.display = "block";
    },

    SmartMoveEasyImplementationLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        sender.findName("EasyImplementationPanel").Visibility = "Visible";
        sender.findName("EasyImplementationPanelShow").Begin();
        document.getElementById("EasyImplementation").style.display = "block";
    },

    SmartMoveDemoLink_MouseEnter: function(sender, eventArgs) {
        this.CloseAllPanels();
        this.demoLinks.Visibility = "Visible";
        sender.findName("FlashDemoLinksShow").Begin();
    },

    SmartMovePriceLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        sender.findName("PricingPanel").Visibility = "Visible";
        sender.findName("PricePanelShow").Begin();
        document.getElementById("Pricing").style.display = "block";
    },

    WhyMSDynamicsLink_Click: function(sender, eventArgs) {
        OpenDemo1();
        this.smartMoveVO.Stop();
    },



    SuperiorLink_Click: function(sender, eventArgs) {
        OpenDemo2();
        this.smartMoveVO.Stop();
    },

    UpAndRunningLink_Click: function(sender, eventArgs) {
        OpenDemo3();
        this.smartMoveVO.Stop();
    },

    FlashDemoLinks_Leave: function(sender, eventArgs) {
        sender.findName("FlashDemoLinksShow").Stop();
        sender.findName("arrow2_Copy").RenderTransform.Children.GetItem(0).ScaleX = 1;
        this.demoLinks.Visibility = "Collapsed";
    },

    ChatNowLink_Click: function(sender, eventArgs) {
        this.CloseAllPanels();
        this.TakeActionCanvas_MouseLeave(sender, eventArgs);
				window.open("https://dynamicsgptestdrive.com/systemcheck.aspx?exercise=1", "_blank",'', false);
    },

    ChatNowPanelClose_Click: function() {
        var panel = this.control.content.findName("ChatNowPanel");

        if (document.getElementById("ChatNow"))
            document.getElementById("ChatNow").style.display = "none";

        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
    },

    FreeKitTandCLink_Click: function() {
        this.CloseAllPanels();
        this.control.content.findName("FreeKitTandCPanel").Visibility = "Visible";
        this.control.content.findName("FreeKitTandCPanelShow").Begin();
        document.getElementById("FreeKitTandC").style.display = "block";
    },

    FreeKitTandCPanelClose_Click: function() {
        var panel = this.control.content.findName("FreeKitTandCPanel");

        if (document.getElementById("FreeKitTandC"))
            document.getElementById("FreeKitTandC").style.display = "none";

        panel.Opacity = "0";
        panel.Visibility = "Collapsed";
    },

    QuickBooksReplacerLink_Click: function(sender, eventArgs) {
        var qbKitLink = "https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1221262969&rver=5.0.3265.0&wp=MCMBI&wreply=https:%2F%2Fprofile.microsoft.com%2FRegSysProfileCenter%2Fwizard.aspx%3Fwizid%3D59ea21c3-1a01-42f7-ad4a-44b4df9344df%26lcid%3D1033%26fu%3Dhttp%253A%2F%2Fwww.microsoft.com%2Fclick%2Fservices%2FRedirect.aspx%253Fmode%253D2%2526wid%253D59ea21c3-1a01-42f7-ad4a-44b4df9344df%2526CR_TC%253D9GRU9MDXQQ71SSM%2526status%253D1%2526fwd%253Dhttp%25253A%2F%2Fwww.microsoft.com%2Fdynamics%2Fasmartmove%2Fqb-upgrade-finish.aspx%25253FCR_ID%25253D-1%252526CR_TC%25253D9GRU9MDXQQ71SSM%26cu%3Dhttp%253A%2F%2Fwww.microsoft.com%2Fclick%2Fservices%2FRedirect.aspx%253Fmode%253D2%2526wid%253D59ea21c3-1a01-42f7-ad4a-44b4df9344df%2526CR_TC%253D9GRU9MDXQQ71SSM%2526status%253D2%2526fwd%253Dhttp%25253A%2F%2Fwww.microsoft.com%2Fdynamics%2Fasmartmove%2Fqb-upgrade-finish.aspx%25253FCR_ID%25253D-1%252526CR_TC%25253D9GRU9MDXQQ71SSM%26CR_ID%3D-1%26CR_TC%3D9GRU9MDXQQ71SSM&lc=1033&cb=LCID%3D1033%26WizID%3D59ea21c3-1a01-42f7-ad4a-44b4df9344df%26brand%3DMicrosoft%2BDynamics&id=74335";

        var crid = querySt("CR_ID");
        var crtc = querySt("CR_TC");
        var segment = (querySt("Segment") || querySt("segment"));

        if (crid != undefined && crtc != undefined && (segment == 'sb' || segment == 'mm')) {
            if (segment == 'sb') {
                qbKitLink = "http://www.microsoft.com/click/services/Redirect.aspx?mode=1&CR_ID=" + crid + "&CR_TC=" + crtc + "&fwd=https%3A//profile.microsoft.com/RegSysProfileCenter/wizard.aspx%3Fwizid%3Dd23b9a9a-9533-4a86-802a-8de76cac0d10%26lcid%3D1033%26fu%3Dhttp%253A//www.microsoft.com/click/services/Redirect.aspx%253Fmode%253D2%2526wid%253Dd23b9a9a-9533-4a86-802a-8de76cac0d10%2526CR_TC%253D" + crtc + "%2526status%253D1%2526fwd%253Dhttp%25253A//www.microsoft.com/dynamics/asmartmove/qb-upgrade-finish.aspx%25253FCR_ID%25253D" + crid + "%252526CR_TC%25253D" + crtc + "%26cu%3Dhttp%253A//www.microsoft.com/click/services/Redirect.aspx%253Fmode%253D2%2526wid%253Dd23b9a9a-9533-4a86-802a-8de76cac0d10%2526CR_TC%253D" + crtc + "%2526status%253D2%2526fwd%253Dhttp%25253A//www.microsoft.com/dynamics/asmartmove/qb-upgrade-finish.aspx%25253FCR_ID%25253D" + crid + "%252526CR_TC%25253D" + crtc;
            }
            if (segment == 'mm') {
                qbKitLink = "http://www.microsoft.com/click/services/Redirect.aspx?mode=1&CR_ID=" + crid + "&CR_TC=" + crtc + "&fwd=https%3A//profile.microsoft.com/RegSysProfileCenter/wizard.aspx%3Fwizid%3Dfb75af42-955c-4ba7-8bb8-8f8d33ce626a%26lcid%3D1033%26fu%3Dhttp%253A//www.microsoft.com/click/services/Redirect.aspx%253Fmode%253D2%2526wid%253Dfb75af42-955c-4ba7-8bb8-8f8d33ce626a%2526CR_TC%253D" + crtc + "%2526status%253D1%2526fwd%253Dhttp%25253A//www.microsoft.com/dynamics/asmartmove/qb-upgrade-finish.aspx%25253FCR_ID%25253D" + crid + "%252526CR_TC%25253D" + crtc + "%26cu%3Dhttp%253A//www.microsoft.com/click/services/Redirect.aspx%253Fmode%253D2%2526wid%253Dfb75af42-955c-4ba7-8bb8-8f8d33ce626a%2526CR_TC%253D" + crtc + "%2526status%253D2%2526fwd%253Dhttp%25253A//www.microsoft.com/dynamics/asmartmove/qb-upgrade-finish.aspx%25253FCR_ID%25253D" + crid + "%252526CR_TC%25253D" + crtc;
            }
        }
        window.open(qbKitLink, "_blank");
    },

    Peachtree_ReplacerKitLink_Click: function(sender, eventArgs) {
        var qbKitLink = "https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1221262969&rver=5.0.3265.0&wp=MCMBI&wreply=https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=7ea70a6c-c5b6-42de-adf9-0b7672dd4d2b&lcid=1033&fu=http%3A//www.microsoft.com/click/services/Redirect.aspx%3Fmode%3D2%26wid%3D7ea70a6c-c5b6-42de-adf9-0b7672dd4d2b%26CR_TC%3D9GRU9MDXXQ9SSPS%26status%3D1%26fwd%3Dhttp%253A//www.microsoft.com/dynamics/asmartmove/pt-upgrade-finish.aspx%253FCR_ID%253D-1%2526CR_TC%253D9GRU9MDXXQ9SSPS&cu=http%3A//www.microsoft.com/click/services/Redirect.aspx%3Fmode%3D2%26wid%3D7ea70a6c-c5b6-42de-adf9-0b7672dd4d2b%26CR_TC%3D9GRU9MDXXQ9SSPS%26status%3D2%26fwd%3Dhttp%253A//www.microsoft.com/Dynamics/asmartmove/default.mspx%253FCR_ID%253D-1%2526CR_TC%253D9GRU9MDXXQ9SSPS";
        var qbKitLink = "https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=7ea70a6c-c5b6-42de-adf9-0b7672dd4d2b&lcid=1033&fu=http%3A//www.microsoft.com/click/services/Redirect.aspx%3Fmode%3D2%26wid%3D7ea70a6c-c5b6-42de-adf9-0b7672dd4d2b%26CR_TC%3D9GRU9MDXXQ9SSPS%26status%3D1%26fwd%3Dhttp%253A//www.microsoft.com/dynamics/asmartmove/pt-upgrade-finish.aspx%253FCR_ID%253D-1%2526CR_TC%253D9GRU9MDXXQ9SSPS&cu=http%3A//www.microsoft.com/click/services/Redirect.aspx%3Fmode%3D2%26wid%3D7ea70a6c-c5b6-42de-adf9-0b7672dd4d2b%26CR_TC%3D9GRU9MDXXQ9SSPS%26status%3D2%26fwd%3Dhttp%253A//www.microsoft.com/Dynamics/asmartmove/default.mspx%253FCR_ID%253D-1%2526CR_TC%253D9GRU9MDXXQ9SSPS";
        //        var crid = querySt("CR_ID");
        //        var crtc = querySt("CR_TC");
        //        var segment = (querySt("Segment") || querySt("segment"));

        //        if (crid != undefined && crtc != undefined && (segment == 'sb' || segment == 'mm')) {
        //            if (segment == 'sb') {
        //                qbKitLink = "http://www.microsoft.com/click/services/Redirect.aspx?mode=1&CR_ID=" + crid + "&CR_TC=" + crtc + "&fwd=https%3A//profile.microsoft.com/RegSysProfileCenter/wizard.aspx%3Fwizid%3Dd23b9a9a-9533-4a86-802a-8de76cac0d10%26lcid%3D1033%26fu%3Dhttp%253A//www.microsoft.com/click/services/Redirect.aspx%253Fmode%253D2%2526wid%253Dd23b9a9a-9533-4a86-802a-8de76cac0d10%2526CR_TC%253D" + crtc + "%2526status%253D1%2526fwd%253Dhttp%25253A//www.microsoft.com/dynamics/asmartmove/qb-upgrade-finish.aspx%25253FCR_ID%25253D" + crid + "%252526CR_TC%25253D" + crtc + "%26cu%3Dhttp%253A//www.microsoft.com/click/services/Redirect.aspx%253Fmode%253D2%2526wid%253Dd23b9a9a-9533-4a86-802a-8de76cac0d10%2526CR_TC%253D" + crtc + "%2526status%253D2%2526fwd%253Dhttp%25253A//www.microsoft.com/dynamics/asmartmove/qb-upgrade-finish.aspx%25253FCR_ID%25253D" + crid + "%252526CR_TC%25253D" + crtc;
        //            }
        //            if (segment == 'mm') {
        //                qbKitLink = "http://www.microsoft.com/click/services/Redirect.aspx?mode=1&CR_ID=" + crid + "&CR_TC=" + crtc + "&fwd=https%3A//profile.microsoft.com/RegSysProfileCenter/wizard.aspx%3Fwizid%3Dfb75af42-955c-4ba7-8bb8-8f8d33ce626a%26lcid%3D1033%26fu%3Dhttp%253A//www.microsoft.com/click/services/Redirect.aspx%253Fmode%253D2%2526wid%253Dfb75af42-955c-4ba7-8bb8-8f8d33ce626a%2526CR_TC%253D" + crtc + "%2526status%253D1%2526fwd%253Dhttp%25253A//www.microsoft.com/dynamics/asmartmove/qb-upgrade-finish.aspx%25253FCR_ID%25253D" + crid + "%252526CR_TC%25253D" + crtc + "%26cu%3Dhttp%253A//www.microsoft.com/click/services/Redirect.aspx%253Fmode%253D2%2526wid%253Dfb75af42-955c-4ba7-8bb8-8f8d33ce626a%2526CR_TC%253D" + crtc + "%2526status%253D2%2526fwd%253Dhttp%25253A//www.microsoft.com/dynamics/asmartmove/qb-upgrade-finish.aspx%25253FCR_ID%25253D" + crid + "%252526CR_TC%25253D" + crtc;
        //            }
        //        }
        window.open(qbKitLink, "_blank");
    },

    ResetHearFromPage: function() {
        this.watchCustomerVideoAnim.Stop();
        this.control.content.findName("image1").Opacity = 100;
        this.control.content.findName("orb2_Copy").Opacity = 100;
        this.control.content.findName("textBlock7_Copy1").Opacity = 100;
        this.control.content.findName("textBlock_Copy1").Opacity = 100;
        this.control.content.findName("videoScreenImg").Opacity = 0;
        this.control.content.findName("imgMan3").Opacity = 0;
        this.control.content.findName("arrow2_Copy1").RenderTransform.Children.GetItem(0).ScaleX = 1;
        this.videoPlayer.Opacity = 0;
        this.videoPlayer.Visibility = "Collapsed";
        this.player.Stop();
    },

    CloseAllPanels: function() {
        this.FreeKitTandCPanelClose_Click();
        this.ChatNowPanelClose_Click();
        this.PricingPanelClose_Click();
        this.PeachtreeAssetsPanelClose_Click();
        this.AssetsPanelClose_Click();
        this.CaseStudiesPanelClose_Click();
        this.PeachtreeCaseStudiesPanelClose_Click();
        this.WebCastDemoPanelClose_Click();
        this.ResetHearFromPage();
        this.BusinessNeedsPanelClose_Click();
        this.EasyImplementationPanelClose_Click();
    },

    GetQueryString: function() {
        var qs = window.location.search;
        if (qs.length > 1)
            qs = qs.substring(1, qs.length);
        else
            qs = null;

        var keyValuePairs = new Array();
        if (qs) {
            for (var i = 0; i < qs.split("&").length; i++) {
                keyValuePairs[i] = qs.split("&")[i];
            }

            if (keyValuePairs[0].split("=")[0] == "pageId") {
                return keyValuePairs[0].split("=")[1];
            }
        }

        return null;
    },

    Intro_Completed: function(sender, eventArgs) {
        this.skipIntroButton.Visibility = "Collapsed";
        this.replayIntroButton.Visibility = "Visible";
        this.AddIntroPageEventListeners();
    },

    ReplayIntroButton_Click: function(sender, eventArgs) {
        window.location = "default.mspx";
    },

    WatchCustomerVideoAnim_Completed: function(sender, eventArgs) {
        this.player.ChangeVideo("http://mediadl.microsoft.com/MediaDL/WWW/D/dynamics/asmartmove/OCC_GP_300k.wmv");
    },

    AddIntroPageEventListeners: function() {
        this.yellowLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.PageLink_Click));
        this.yellowLink.Cursor = "Hand";
        this.purpleLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.PageLink_Click));
        this.purpleLink.Cursor = "Hand";
        this.redLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.PageLink_Click));
        this.redLink.Cursor = "Hand";
        this.introLiveDemoLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.LiveDemoLink_Click));
        this.introLiveDemoLink.Cursor = "Hand";
        this.qB_ReplacerKitLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.QuickBooksReplacerLink_Click));
        this.qB_ReplacerKitLink.Cursor = "Hand";
        this.peachtree_ReplacerKitLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.Peachtree_ReplacerKitLink_Click));
        this.peachtree_ReplacerKitLink.Cursor = "Hand";
        this.introChatNowLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.ChatNowLink_Click));
        this.introChatNowLink.Cursor = "Hand";
        this.homePriceLink.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.SmartMovePriceLink_Click));
        this.homePriceLink.Cursor = "Hand";
    }

}

