﻿DependFlash.HomeSlideshow = function(serverVars) {
    this.ServerVars = serverVars;
    this.Initialize();
};
DependFlash.HomeSlideshow.prototype = {
    Initialize: function() {
        if (expressInstallAvailable()) {

            $('#' + serverVars.slideshowContainer).flash({
                swf: "/Media/HomeSlideshow.swf",
                width: 686,
                height: 263,
                hasVersion: 8,
                expressInstaller: "/Media/ExpressInstaller.swf",
                flashvars: {
                    config: "HomeSlideshow_Config.xml"
                },
                params: {
                    base: "/Media/",
                    wmode: "opaque",
                    allowScriptAccess: "sameDomain"
                }
            });

        } else {
            displayFlashUpdateMessage();
        }

        function expressInstallAvailable() {
            // Vista requires 9.0.28 for expressInstall, all others 6.0.65
            if (navigator.userAgent.indexOf("Windows NT 6.0") != -1) {
                return $.hasFlashPlayerVersion("9.0.28");
            } else {
                return $.hasFlashPlayerVersion("6.0.65");
            }
        }

        function displayFlashUpdateMessage() {
            $(".NoFlash").css("text-indent", 0);
        }
    }
};
Depend.Extend(DependFlash.HomeSlideshow, Depend.Core);
