﻿// Uses jQuery
function toggleOutlining(id) {
    var strName1 = "#div_" + id;
    var strName2 = "#div_" + id + "_" + id;
    var strImgName = "#img_" + id;
    if ($(strName1).css('visibility') == 'visible') {
        $(strName1).css('visibility', 'hidden');
        $(strName1).css('position', 'absolute');
        $(strName1).css('top', 0);
        $(strName2).css('visibility', 'visible');
        $(strName2).css('position', 'static');
        $(strImgName).attr('src', '/images/tminus.gif');
    }
    else {
        $(strName2).css('visibility', 'hidden');
        $(strName2).css('position', 'absolute');
        $(strName2).css('top', 0);
        $(strName1).css('visibility', 'visible');
        $(strName1).css('position', 'static');
        $(strImgName).attr('src', '/images/tplus.gif');
    }
}

function AddToDocOnload(fnNew) {
    var oldevent = window.onload;
    if (typeof oldevent == "function") {
        window.onload = function() {
            if (oldevent) {
                oldevent();
            }
            fnNew();
        };
    }
    else {
        window.onload = fnNew;
    }
}

function GoToQuestion() {
    if (!isNaN(window.location.hash.substr(1))) {
        toggleOutlining(window.location.hash.substr(1));
    }
}

AddToDocOnload(GoToQuestion);
