﻿function OpenWin(browseUrl, windowName, features) {
    window.open(browseUrl, windowName, features);
}

function OpenLink(browseUrl) {
    window.opener.location.href = browseUrl;
    this.close();
}

function ExecutePageFunctions() {
    // check if user is on search page - if so call SearchBoxFocus()
    if (window.location.href.toLowerCase().indexOf("searchpage.aspx") > -1) {
        SearchBoxFocus();
    }
}

// Set focus in search textbox
function SearchBoxFocus() {
    var theForm = document.getElementById("aspnetForm");
    var arrInputs = theForm.getElementsByTagName("input");
    
    for (i = 0; i < arrInputs.length; i++) {
        if (arrInputs[i].type == "text") {
            if (arrInputs[i].id.indexOf("searchTerms") > -1) {
                arrInputs[i].focus();
                break;
            }            
        }
    }
}

