﻿$(document).ready(function () {

    var start = window.location.pathname.lastIndexOf('/') + 1;
    var file = window.location.pathname.substring(start, window.location.pathname.length);

    if (file == "AboutDemo.aspx") {
        pageLoc = 1;
    }
    else if (file == "GeoHeatmap.aspx" || file == "GeoViewDemo.aspx") {
        pageLoc = 2;
    }
    else if (file == "GeoMetricsDemo.aspx") {
        pageLoc = 3;
    }
    else if (file == "CalendarViewDemo.aspx") {
        pageLoc = 4;
    }
    else if (file == "TeamDashboardFull.aspx") {
        pageLoc = 5;
    }
    else {
        pageLoc = 1;
    }

    $('#' + pageLoc).parent().toggleClass('selected');
    if (pageLoc == 1)
        $("#toggle").css("display", "none");

    $('.toggleButton').click(function () {
        $('#toggle').slideToggle('medium', function () {
        });
    });

//    $(function () {
//        $('#gallery a.lightbox').lightBox();
//    });
});

// RadHtmlPlaceHolder insists on rendering in an absolutely positioned div, so we have to override it to get the
// div to move around the page when expanding/collapsing the info div
function SetSilverlightDivPosition() {
    setTimeout("$('#Form1 + div').addClass('report');", 200);
    $("#Form1 + div").addClass("report");
}
