
	function control(element)
	{
		this.element = element;
		element.control = this;
		$(element).addClass('control');
	}

	control.prototype.getType = function()
	{
		return 'control';
	}

	control.prototype.element;
	control.prototype.index;

	control.prototype.bringOnTop = function()
	{
		var zIndex = 0;
		var controls = $('body > .control').get();
		for(var i = 0; i < controls.length; i++)
			if(new Number($(controls[i]).css('z-index')) > zIndex) zIndex = new Number($(controls[i]).css('z-index'));

		$(this.element).css('z-index', zIndex + 1);
	}

	control.prototype.inheriteOptions = function(options, defaultOptions)
	{
		if(options == undefined) options = defaultOptions;
		for(var option in defaultOptions)
		if(options[option] == undefined) options[option] = defaultOptions[option];
		return options;
	}

	control.prototype.show = function()
	{
		$(this.element).fadeIn('normal');
	}

	control.prototype.isHidden = function()
	{
		return $(this.element).is(':hidden');
	}

	control.prototype.hide = function()
	{
		$(this.element).fadeOut('fast');
	}

