var newWin = null;
function popUp(strURL, strType, strHeight, strWidth) {
    if (newWin != null && !newWin.closed)
        newWin.close();
    var strOptions = "";
    if (strType == "console")
        strOptions = "resizable,height=" +
	     strHeight + ",width=" + strWidth;
    if (strType == "fixed")
        strOptions = "status,height=" +
	     strHeight + ",width=" + strWidth;
    if (strType == "elastic")
        strOptions = "toolbar,menubar,scrollbars," +
	     "resizable,location,height=" +
	     strHeight + ",width=" + strWidth;
    if (strType == "stave")
        strOptions = "resizable,height=" +
	     strHeight + ",width=" + strWidth;
    newWin = window.open(strURL, 'newWin', strOptions);
    newWin.focus();
}

var staveWin = null;
function largeStave(strURL, strType, strHeight, strWidth) {
    if (staveWin != null && !staveWin.closed)
        staveWin.close();
    var strOptions = "";
    if (strType == "stave")
        strOptions = "resizable,height=" +
	     strHeight + ",width=" + strWidth;
    staveWin = window.open(strURL, 'staveWin', strOptions);
    staveWin.focus();
}

var glossWin = null;
function glossPopup(strURL, strType, strHeight, strWidth) {
    if (glossWin != null && !glossWin.closed)
        glossWin.close();
    var strOptions = "";
    if (strType == "elastic")
        strOptions = "scrollbars," +
	     "resizable,height=" +
	     strHeight + ",width=" + strWidth;
    glossWin = window.open(strURL, 'glossWin', strOptions);
    glossWin.focus();
}

var tvTranscriptWin = null;
function tvTranscriptPopup(strURL, strType, strHeight, strWidth) {
    if (tvTranscriptWin != null && !tvTranscriptWin.closed)
        tvTranscriptWin.close();
    var strOptions = "";
    if (strType == "elastic")
        strOptions = "scrollbars," +
	     "resizable,height=" +
	     strHeight + ",width=" + strWidth;
    tvTranscriptWin = window.open(strURL, 'tvTranscriptWin', strOptions);
    tvTranscriptWin.focus();
}

var tvWin = null;
function tvPopup(strURL, strType, strHeight, strWidth) {
    if (tvWin != null && !tvWin.closed)
        tvWin.close();
    var strOptions = "";
    if (strType == "elastic")
        strOptions = "resizable,height=" +
	     strHeight + ",width=" + strWidth;
    tvWin = window.open(strURL, 'tvWin', strOptions);
    tvWin.focus();
}


$(document).ready(function () {
    $("#btBookmark").click(function () {
        $("#bookmarks").fadeToggle();
        return false;
    });

    $("#bookmarks").mouseleave(function () {
        $("#bookmarks").fadeOut();
    });
});

