DropDown = function( custOptions )
{
	this.options = {},
	
	this.init = function( custOptions )
	{
		var me = this,
			options = {
				container:		'#main_table',
				butSelector:	'.button',
				subSelector:	'.sub_panel'
			}
		;
		
		// extend with the passed in params
		jQuery.extend( options, custOptions );
		
		$(options.container).each( function() {
		
			$(this).bind( 'mouseenter', function() {
				me.tabOver( this );
			} ).bind( 'mouseleave', function() {
				me.tabOut( this );
			} );
		} );
		
		me.options = options;
	},
	
	this.tabOver = function( elem )
	{
		var me = this;
		
		if ( elem.removeTimeout ) clearTimeout( elem.removeTimeout );
		
		elem.isShown = true;
		$(elem).find(me.options.butSelector).addClass('active');
		$(elem).find(me.options.subSelector).show();
	},
	
	this.tabOut = function( elem, force )
	{
		var me = this;
		
		elem.removeTimeout = setTimeout( function() {
		
			$(elem).find(me.options.subSelector).hide();
			$(elem).find(me.options.butSelector).removeClass('active');
			elem.isShown = false;
			elem.forceClose = false;
			
		}, ( elem.forceClose ? 1 : 300 ) );
	}
	
	this.init( custOptions );
	
};
