﻿SMU.PeopleDirectory = function()
{
    Ext.onReady(this.Initialize.createDelegate(this));
}

Ext.extend(SMU.PeopleDirectory, Ext.util.Observable,
{
    Initialize : function()
    {
        this.addEvents({"onData": true});
    },
    
    PeopleSearch : function(s)
    {
        SMU.AjaxAPI.PeopleDirectory.PersonSearch(s, this.PeopleSearch_Process.createDelegate(this));
    },
    PeopleSearch_Process : function(response)
    {
        if (response.error)
        {
            alert(response.error.Message);
        }
        else
        {
            //alert('ok');
            var divMC = Ext.get("divMC");
            var a = Ext.DomQuery.selectNode('data', response.value);
            divMC.update(a.firstChild.nodeValue);
            
        }
    }    
});
    