﻿function showSlideShow() {
    $(".slideShow").mbGallery({
        galleryMaxWidth: 0,
        galleryWidth: 700,
        galleryHeight: 480,
        galleryColor: "#000000",
        galleryFrameBorder: 0,
        thumbStripPos: "right",
        thumbStripWidth: 250,
        thumbSelectColor: "#fff",
        thumbOverColor: "#cccccc",
        thumbStripColor: "#333333",
        thumbsBorder: 6,
        thumbHeight: 70,
        headerOpacity: .8,
        labelColor: "#AAAAAA",
        labelColorDisactive: "#AAAAAA",
        labelTextColor: "#ffffff",
        labelTextSize: "14px",
        labelHeight: 20,
        startFrom: 0,
        fadeTime: 500,
        autoSlide: true,
        autoSize: false,
        slideTimer: 3000,
        iconFolder: themePath + "gallery_elements",
        startTimer: 0
    });
}

function attachFlashMenu() {
    var labels = new Array();
    var links = new Array();
    var selectedIndex = 0;
    $(".header .menu a").each(function(index) {
        var $anchor = $(this);
        var href = $anchor.attr("href");
        var text = $anchor.text();
        var rel = $anchor.attr("rel");
        if (rel == currentSectionId) {
            selectedIndex = index;
        }
        labels.push(text);
        links.push(href);
    });

    labels = labels.join("`");
    links = links.join("`");

    var flashvars = {
        labels: labels,
        links: links,
        selectedIndex: selectedIndex
    };

    var params = {
        swLiveConnect: "true",
        allowFullScreen: "false",
        scale: "noscale",
        menu: "false",
        quality: "best"
    };
    var attributes = {
        id: "header",
        name: "header"
    };
    swfobject.embedSWF("header.swf", "header", "980", "300", "9.0.0", "js/expressInstall.swf", flashvars, params, attributes);
}

$(document).ready(function() {    
    showSlideShow();
});