﻿/// <reference path="jquery-1.4.1-vsdoc.js" />

$(document).ready(function () {
    $('.test:eq(0)>div.collapse').hide();

    $('.test:eq(0)>h2.atthead').click(function () {
        $(this).next().slideToggle('slow');
        $(this).toggleClass("down");
    });

    var $tabs = $("ul.tabs li a");
    var video_path = $("#video_path").val();
    var $videos = $(".videos");
    function tab_clicked() {
        var targetid = this.rel;
        $tabs.removeClass("selected").each(function () {
            if ($(this.rev).css("display") != "none" && this.rev != targetid) { $(this.rev).slideUp(); }
        });
        $(this.rev).slideDown();
        $(this).addClass("selected");

        if (this.rel && swfobject && typeof (swfobject.embedSWF) == "function" && video_path) {
            $videos.slideUp('normal', function () { $(this).slideDown(); });
            swfobject.embedSWF(video_path + "/" + this.rel, "flash_video", "240", "196", "9.0.0", "../assets/scripts/expressInstall.swf");
        }
    }
    $tabs.click(tab_clicked);
    $("ul.tabs li a.selected").each(tab_clicked);
});
