﻿$(document).ready(function() {
    //Tabs now have their own URLs to this is not needed PRA
    //initMediaPage();
});

function initMediaPage() {
    //Add a click event to the tabs
    $("#mediaPage .contentTabsNav li:nth-child(1)").click(function() { changeView("picture"); });
    $("#mediaPage .contentTabsNav li:nth-child(2)").click(function() { changeView("video"); });

    //Hide the video content until its tab is clicked
    $("#mediaVideo").hide();
}

function changeView(what) {
    //Turn all tabs off
    $("#mediaPage .contentTabsNav li").removeClass("active");

    switch (what) {
        case "picture":
            $("#mediaPage .contentTabsNav li:nth-child(1)").addClass("active");
            $("#mediaVideo").hide();
            $("#mediaPicture").show();
            break;
        case "video":
            $("#mediaPage .contentTabsNav li:nth-child(2)").addClass("active");
            $("#mediaPicture").hide();
            $("#mediaVideo").show();
            break;
    }
}
