/**
 * This function will take the category id and process the selection on the
 * current category tree.  If more depth/detail is required in the category tree
 * the category selector will get updated with the new choices.
 */
function updateCategory(categoryId)
{
    var ebay_catupdate_handler = function(response){updateArea(response, 'categorySelector');};
    query = 'categoryId=' + categoryId;
    var myConn = new XHConn();
    if (!myConn)
    {
        return;
    }
    myConn.connect('/buyersvcs/admin/checkCategoryTree.do', 'GET', query, ebay_catupdate_handler);
}

/**
 * This function will switch the category tree based on the price version (ebay
 * or nonebay) and update the category selector with the new root node
 */
function switchCategoryTree(priceVersion)
{
    var ebay_vender_handler = function(response){updateArea(response, 'categorySelector');};
    query = 'priceVersion=' + priceVersion
    var myConn = new XHConn();
    if (!myConn)
    {
        return;
    }
    myConn.connect('/buyersvcs/admin/switchCategoryTree.do', 'GET', query, ebay_vender_handler);
}

function updateSTCategory(categoryId)
{
    var nonebay_catupdate_handler = function(response){updateArea(response, 'categorySelector');};
    query = 'categoryId=' + categoryId;
    var myConn = new XHConn();
    if (!myConn)
    {
        return;
    }
    myConn.connect('/buyersvcs/updateSTCategory.do', 'GET', query, nonebay_catupdate_handler);
}

function updateNonEbayCategoryJBoss(nodeId)
{
    jQuery.get("nonEbayCategorySelector.action?nodeId=" + nodeId,
            function(data){
                document.getElementById('selector').innerHTML = data;
                st_utilities.callParentIFrameOnload();
            });
}


