/**
 * responsible for handling view count actions.
 * @param {Cobalt.Core.Sandbox} sandbox
 */

Cobalt.Website.Results.ViewModule = function(sandbox)
{
    var viewComponentId;
	var handleSelectionChanged = function(e)
    {
        viewComponentId = sandbox.dom(e.target).attr("id");
        sandbox.raise(null, Cobalt.Website.Common.Events.ContentChanged, viewComponentId);
    };

    return {
        init:function()
        {
            var jquerySelector = sandbox.getUIElementSelectorsForModule(Cobalt.Website.Results.ResultsApplication.Modules.ViewModule);
            for (var i=0; i<jquerySelector.length; ++i)
            {
                sandbox.dom(jquerySelector[i]).listenLive("change", handleSelectionChanged);
            }
        },
        destroy:function()
        {
            //TODO: handle destroy
        }
    };
};

