$(function () {
    var NowUrl = document.location.href;
    var UrlArr = NowUrl.split("/");
    var NowFile = UrlArr[UrlArr.length - 1];
    var NowFileWithoutPar = NowFile.split('?')[0].toLowerCase();
    
    $(".menulinks li a").each(function () {
        if ($(this).attr("href").toLowerCase() == NowFileWithoutPar) {
            $(this).css("background-color", "#82C81A");
            $(this).addClass("sta");
        }
    });
    $(".menulinks li a").hover(function () {
        $(this).css("background-color", "#82C81A");
    }, function () {
        if (!$(this).is(".sta")) {
            $(this).css("background-color", "#33BBEE");
        }
    });
    var menuNowHiehgt = $(".menu").css("height").replace("px", "") - 0;
    var rightcontentNowHiehgt = $("#rightcontent").css("height").replace("px", "") - 0;
    if (menuNowHiehgt < rightcontentNowHiehgt) {
        $(".menu").css("height", $("#rightcontent").css("height"));
    } else if (menuNowHiehgt > rightcontentNowHiehgt) {
        $("#rightcontent").css("height", $(".menu").css("height"));
    }
});