﻿$(document).ready(function () {

    $("li.asMenuItem").bind('click', function () {
        var gotoPage = $(this).attr("title");
        goThere(gotoPage);
    });


    $("li.asMenuItem").mouseover(function () {
        var currItemTitle = $(this).attr("title");
        var currMenuDetail = $("div.clsMenuItemDetail[title=" + currItemTitle + "]");
        var altMenuDetail = $("div.clsMenuItemDetail[title!=" + currItemTitle + "]");

        $("lblCurrentMenu").html(
            "<p>" + currItemTitle + "</p>"
        );

        altMenuDetail.hide();

        currMenuDetail.animate(
            { opacity: 'show', width: 'show' }
            , 'fast'
        );
    });

    $("ul.clsMenuItemList > li").click(function () {
        var pageNavigate = $(this).parents("div.clsMenuItemDetail").attr("title");
        var pageSection = "#" + $(this).attr("title");
        window.location =  pageNavigate + ".aspx" + pageSection;
    });
});



function goThere() 
{
    if (arguments.length == 1) {
        window.location = arguments[0] + ".aspx";
    } else if( arguments.length == 2)
    {
        window.location = arguments[0] + ".aspx" + arguments[1];
    }
};

