﻿function MyRealbook() {
	document.forms[0].acode.value = "m";
	document.forms[0].submit();
}
function LogIn()
{
    document.forms[0].acode.value = "n";
    document.forms[0].submit();
}

function LogOut()
{
    document.forms[0].acode.value = "o";
    document.forms[0].submit();
}

function pchart(idname, song)
{
    document.forms[0].acode.value = "p";
    postkey(document.getElementById(idname), song);
}

function printit()
{
    window.print();
}

function songs()
{
    document.forms[0].acode.value = "s";
    document.forms[0].submit();
}

function home()
{
    document.forms[0].acode.value = "h";
    document.forms[0].submit();
}

function asetkey(idname, song)
{
    setkey(document.getElementById(idname), song);
}

function setkey(obj, song)
{
    document.forms[0].acode.value = "k";
    postkey(obj, song);
}

function postkey(obj, song)
{
    var id = obj.selectedIndex; 

    document.forms[0].songid.value = song;
    document.forms[0].newkey.value = obj.options[id].value;
    document.forms[0].submit();
}

function notification(idname, msg)
{
    var work;
    //Restore html brackets that may have been filtered out by .NET
    work = msg;
    work = work.replace(/&lt;/g,"<");
    work = work.replace(/&gt;/g,">");
    document.getElementById(idname).innerHTML = work;
}

