/**
Logging API only wants to know if the person is a member or not.
Convert actual UCS member status to 'nmbr' or '1'
**/
function getCustomerStatusLogging() {
    var customerStatus = getCustomerStatus();
    var customerStatusLogging = 'nmbr';
    if (customerStatus > 1)
        customerStatusLogging = '1';
    return customerStatusLogging;
}

/**
Logging API requires a 0 be passed in as the customer number if
they are not a customer.
**/
function getCustomerNumberLogging() {
    var customerNumber = getCustomerNumber();
    if (customerNumber == 'Unknown') {
        customerNumber = 0;
    }
    return customerNumber;
}

/**
Builds up the search logging tag and inserts the image pixel ping into the code.
This function is called onLoad() for search.pd as well as on products_search.pd
when the results are being paged through.
**/
function buildLoggingTag() {
    var query = "";
    query += "report=" + report;
    query += "&session_id=" + sessionid;
    query += "&data_source=A";
    query += "&" + Math.floor(Math.random()*999999999);
    var imageUrl = ahost + "/logensearch.pd?" + query;
    var cached_logging = document.getElementById("cached_logging");
    if (cached_logging != null)
        cached_logging.innerHTML = "<img src='" + imageUrl + "' width=1 height=1 border=0>";
}
