﻿$(document).ready(function() {



   

    $(".sidemenu a").each(function(i) {

        if (!$(this).parent().hasClass("sub")) {
            var link = $(this).attr("href");
            if (link == "./" || link == "../../../" || link == window.location.pathname)
            { $(this).parent().attr("class", "selected"); }
        }
    });




 $(".btn-slide").click(function() {
        $("#products").slideToggle("slow");
        $(this).toggleClass("active"); return false;
    });




});

$("nav a").each(function(i) {

    var link = $(this).attr("href");
    if (link.indexOf(".aspx") > -1)
        link = link.substring(0, (link.length - 5));

    if (link == "/") {
        if (window.location.href.toLowerCase() == "http://timber.jumpmediainternet.co.uk/")
        { $(this).attr("class", "active"); }
    }
    else {
        if (window.location.href.toLowerCase().indexOf(link.toLowerCase()) > -1)
        { $(this).attr("class", "active"); }
    }
});
