var MyCompleter = Class.create(Ajax.Autocompleter, {

    initialize: function($super, id_search, id_list, url, options) {
        $super(id_search, id_list, url, options);
    },

    onComplete: function(response) {
        var text = response.responseText;
        
        if (text.isJSON()) {
        	//console.log(text);
             this.handleJSON(text.evalJSON([sanitize=true]));
        }
       
        // else do nothing
    },
    
    
 
    

    handleJSON: function(json) {
        var htmlStr = '<ul>';
        
      	// each item

		//console.log(json)      
      
        
        json.each(function(item) {
        //	alert('huh');
            htmlStr += '<li>';
            htmlStr += item.FirstName + ' ' + item.LastName + " <span class='informal'>(" + item.DisplayName + ")</span>";
            htmlStr += "<input type='hidden' id='counselorID' name='counselorID' value='" + item.ID + "' />";
            htmlStr += '</li>';
            
 
        });
        htmlStr += '</ul>';
        this.updateChoices(htmlStr);
        //console.log(htmlStr);
    }

});
