﻿$(document).ready(function () {
    $('.Frontpage-Slideshow').cycle({
        fx: 'fade',
        speed: 1000
    });

    //Default Action
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content").hide(); //Hide all content
    $(".Tab-Default").css("background-image", "url('/Assets/Images/Homepage/Tabs/DefaultTabHover.png')"); //Set a perminant arrow for the selected tab, get this arrow css from the hover
    $(".tab_content:first").show(); //Show first tab content

    //On Click Event
    $("ul.tabs li").click(function () {
        $("ul.tabs li").css("background-image", ""); //Remove any arrows from previously selected tabs
        $("ul.tabs li").removeClass("active"); //Remove any "active" class

        $(this).addClass("active"); //Add "active" class to selected tab
        $(".tab_content").hide(); //Hide all tab content

        var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content

        $(this).css("background-image", $(this).css("background-image")); //Set a perminant arrow for the selected tab, get this arrow css from the hover
        $(activeTab).fadeIn(); //Fade in the active content

        // call setPartyType(partyType);
        var strPartyType = $(this).attr("class").split(" ");
        strPartyType = strPartyType[0].split("-");
        strPartyType = strPartyType[1].toLowerCase();

        setPartyType(strPartyType);

        return false;
    });
});
