﻿//////////////////////////////////////////////////////////////////////////////////
//Logic for returning data from the GraphicDialog web service                   //
//////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
//Author:   Stephen Zsolnai                                                     //
//Date:     08/01/2010                                                          //
//////////////////////////////////////////////////////////////////////////////////




// This function is a test for the webservice.  
function EchoUserInput() {
    var echoElem = document.getElementById("EnteredValue");
    GraphicDialog.WebService.EchoInput(echoElem.value,
                    SucceededCallback);
}

//Highlight the clicked link and query the database to return a string containing formatted list of highlighted clients
function HighlighClientsByCategory(catID) {
    //Remove the clickable class from all the links as the relative ones will be added in after.
    $('#clientList div.clients ul li').children().each(
        function() {
            $(this).removeClass('clickable');
        }
    );
    GraphicDialog.WebService.retrieveClientList(catID, SucceededCallback);
}

// This is the callback function that
// processes the Web Service return value.
function SucceededCallback(result) {
    //console.log("returned result: " & result);
    $("#clientList div.clients").html(result);
    
}
  
