
function updateSearch(id)
{
    var searchField;
    searchField = document.getElementById(id);
    
    if (searchField.value == "") {
        searchField.value = "Search";
    } else if (searchField.value == "Search") {
        searchField.value = "";
    }
}
/**
 * Lawrence 4/17/2008: Perform search redirect when ENTER is pressed.
 * TN_Search_JS must exist as an HTML textfield on the page.
 * Assumes that a global variable called 'globalFullSubStoreUrl' is already set.
 */
function runSearchForField(eventObj, id)
{
    if ((eventObj.which == 13) || (eventObj.keyCode == 13)) 
    {
        var searchTerm = escape(document.getElementById(id).value); // must use escape() function to urlencode search term to avoid issues with '&' and '=' symbols
        var url = location.protocol + '//' + globalFullSubStoreUrl + '/Category/CategoryListNoCache.aspx?category_id=0&search_term=' + searchTerm;
        window.location = url;
        return false;
    }
    return true;
}
/**
 * Lawrence 4/17/2008: Perform search redirect.
 * TN_Search_JS must exist as an HTML textfield on the page.
 * Assumes that a global variable called 'globalFullSubStoreUrl' is already set.
 */
function runSearchForButton(id)
{
    var searchTerm = escape(document.getElementById(id).value); // must use escape() function to urlencode search term to avoid issues with '&' and '=' symbols
    var url = location.protocol + '//' + globalFullSubStoreUrl + '/Category/CategoryListNoCache.aspx?category_id=0&search_term=' + searchTerm;
    window.location = url;
}
