Type.registerNamespace('hexagon.web.Controls.Home');

hexagon.web.Controls.Home.CompanyBrowserBehavior = function(element) 
{
    hexagon.web.Controls.Home.CompanyBrowserBehavior.initializeBase(this, [element]);
    
	this._CurrentSelection = null;
	
	this._deselectTimer = null;
}

hexagon.web.Controls.Home.CompanyBrowserBehavior.prototype = 
{

    get_CurrentSelection : function() 
    {
        return this._CurrentSelection;
    },

    set_CurrentSelection : function(value) 
    {
        this._CurrentSelection = value;
    },

    initialize : function() 
    {
        hexagon.web.Controls.Home.CompanyBrowserBehavior.callBaseMethod(this, 'initialize');		
				
		this.preLoadImages();
    },
    
    setCurrent : function(newSelection) 
    {
		if(this._CurrentSelection && this._CurrentSelection != newSelection)
		{
			this._CurrentSelection.showNormalImage();
			this._CurrentSelection.hidePanel();
		}
		if(newSelection == null)
		{
			$("#ci_pan_help").show();
		}
		else
		{
			$("#ci_pan_help").hide();
			newSelection.showHoverImage();
			newSelection.showPanel();
		}
		this._CurrentSelection = newSelection;
    },

	preLoadImages : function() 
	{
//		$(window).bind('load', function() {
//			$(this._selector).each(function(key, elm) {
//				$('').attr('src', $(this).attr('src').replace('.jpg','-active.jpg#hover'));
//			});
//		});
	},

    dispose : function() 
    {
        hexagon.web.Controls.Home.CompanyBrowserBehavior.callBaseMethod(this, 'dispose');
    }
}

hexagon.web.Controls.Home.CompanyBrowserBehavior.registerClass('hexagon.web.Controls.Home.CompanyBrowserBehavior', AjaxControlToolkit.BehaviorBase);