﻿Wipfli.Solutions = function()
{
    var m_ddlIndustry;
    var m_ddlTopic;
    Ext.onReady(this.Initialize.createDelegate(this));
}

Ext.extend(Wipfli.Solutions, Ext.util.Observable,
{
    Initialize : function()
    {
        this.addEvents({"onData": true});
    
        this.m_ddlIndustry = document.getElementById("ddlIndustry"); 
        this.m_ddlTopic = document.getElementById("ddlTopic");
    },
    
    SubmitSolutionsLandingSearch : function()
    {
        Wipfli.AjaxAPI.WipfliAjax.SolutionsSearch(this.m_ddlIndustry.value, this.m_ddlTopic.value, this.SubmitSolutionsSearch_Process.createDelegate(this));
    },
    SubmitSolutionsSearch_Process : function(response)
    {
        if (response.error)
        {
            alert(response.error.Message);
        }
        else
        {
            var divMC = Ext.get("divSolutionMC");
            var a = Ext.DomQuery.selectNode('data', response.value);
            divMC.update(a.firstChild.nodeValue);
        }    
    }    
});