﻿/* Subnav Tabs Selected Based on index of URL */
$(function () {
    var str = location.href.toLowerCase();
    $('#subnav ul li a').each(function () {
        if (str.indexOf(this.href.toLowerCase()) > -1) {
            $(this).attr("class", "current"); 
        }
    });
});

/* What Is SWD Folder Highlighted for Subnav */
$(function () {
    var str = location.pathname;
    $('li.nav1 a').each(function () {
        if (str == "/shift-work-disorder.aspx") {
            $(this).attr("class", "current"); 
        }
        else if (str == "/consequences-of-swd.aspx") {
            $(this).attr("class", "current"); 
        }
    });
});

/* The Facts About SWD Folder Highlighted for Subnav */
$(function () {
    var str = location.pathname;
    $('li.nav2 a').each(function () {
        if (str == "/facts-about-swd.aspx") {
            $(this).attr("class", "current"); 
        }
        else if (str == "/useful-resources.aspx") {
            $(this).attr("class", "current"); 
        }
    });
});

/* Who Is At Risk Folder Highlighted for Subnav */
$(function () {
    var str = location.pathname;
    $('li.nav3 a').each(function () {
        if (str == "/whos-at-risk.aspx") {
            $(this).attr("class", "current"); 
        }
        else if (str == "/coping-with-swd.aspx") {
            $(this).attr("class", "current"); 
        }
        else if (str == "/talking-to-your-doctor.aspx") {
            $(this).attr("class", "current"); 
        }
    });
});

/* The Wake-Up Squad Folder Highlighted for Subnav */
$(function () {
    var str = location.pathname;
    $('li.nav4 a').each(function () {
        if (str == "/wake-up-squad-live.aspx") {
            $(this).attr("class", "current"); 
        }
        else if (str == "/event-map.aspx") {
            $(this).attr("class", "current"); 
        }
        else if (str == "/letter-from-the-chair.aspx") {
            $(this).attr("class", "current"); 
        }
    });
});

/* Toggle Video and Blanket Overlay On and Off */
function changeClass() {
    $(function () {
        $(".videoplayer").toggle();
        $("#blanket").toggle();
        $("#video_close").toggle();
    });
}


