﻿
$(document).ready(function () {

    $('#mensData tr.fifties').hide();
    $('#mensData tr.sixties').hide();
    $('#mensData tr.seventies').hide();
    $('#womensData tr.fifties').hide();
    $('#womensData tr.sixties').hide();
    $('#womensData tr.seventies').hide();
    $('#mensData tr.forties').show();
    $('#womensData tr.forties').show();
});

function hideShowDecade(decade, gender) {

    // note: tablerow is like "#womensData tr.seventies".
    var tablerow40 = "";
    var tablerow50 = "";
    var tablerow60 = "";
    var tablerow70 = "";
    if (gender == 'men') {
        tablerow40 = "#mensData tr.forties";
        tablerow50 = "#mensData tr.fifties";
        tablerow60 = "#mensData tr.sixties";
        tablerow70 = "#mensData tr.seventies";
    }
    else {
        tablerow40 = "#womensData tr.forties";
        tablerow50 = "#womensData tr.fifties";
        tablerow60 = "#womensData tr.sixties";
        tablerow70 = "#womensData tr.seventies";
    }


    if (decade == 40) {

        $(tablerow50).hide();
        $(tablerow60).hide();
        $(tablerow70).hide();
        $(tablerow40).show();

        //show issue age bottom border
        $(".productChart table th").css("border-bottom-style", "solid");
        $(".productChart2 table th").css("border-bottom-style", "solid");

    }

    if (decade == 50) {

        $(tablerow40).hide();
        $(tablerow60).hide();
        $(tablerow70).hide();
        $(tablerow50).show();

        //hide issue age bottom border
        $(".productChart table th").css("border-bottom-style", "none");
        $(".productChart2 table th").css("border-bottom-style", "none");


    }

    if (decade == 60) {

        $(tablerow40).hide();
        $(tablerow50).hide();
        $(tablerow70).hide();
        $(tablerow60).show();

        //hide issue age bottom border
        $(".productChart table th").css("border-bottom-style", "none");
        $(".productChart2 table th").css("border-bottom-style", "none");
    }

    if (decade == 70) {

        $(tablerow40).hide();
        $(tablerow50).hide();
        $(tablerow60).hide();
        $(tablerow70).show();

        //hide issue age bottom border
        $(".productChart table th").css("border-bottom-style", "none");
        $(".productChart2 table th").css("border-bottom-style", "none");
    }

    // to keep the product select in footer from 'sticking' in IE7
    $(".productSelect").animate({ 'top': '-=1px' }, 'fast');
    $(".productSelect").animate({ 'top': '+=1px' }, 'fast');

}
