﻿function PageLoad() {
    document.getElementById('SearchForm').onkeypress = function (e) {
        if (!e) e = window.event;
        if (e.keyCode == '13') {
            SubmitSearch();
            return false;
        }
    }
    if (QueryString("q")) {
        document.getElementById("SearchTerms").value = QueryString("q");
    }
}
function SubmitSearch() {
    window.location.href = urlRoot + "MusicLibrary/MusicSearch.aspx?q=" + document.getElementById("SearchTerms").value;
}
function GoHome() {
    window.location.href = urlRoot + "home.aspx";
}
function QueryString(item) {
    var hu = window.location.search.substring(1);
    var gy = hu.split("&");
    for (i = 0; i < gy.length; i++) {
        ft = gy[i].split("=");
        if (ft[0] == item) {
            return decodeURI(ft[1]);
        }
    }
}
