
	function oldControl()
	{
		if(document.oldControls == undefined) document.oldControls = [this]; else document.oldControls.push(this);
		this.index = document.oldControls.length - 1;
	}

	oldControl.prototype.destroy = function()
	{
		document.oldControls.splice(this.index, 1);
		for(var i = this.index; i < document.oldControls.length; i++)
			document.oldControls[i].index--;
	}

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

	oldControl.prototype.element;
	oldControl.prototype.index;

	oldControl.prototype.getTopZIndex = function()
	{
		var max = 10;
		for(var i = 0; i < document.oldControls.length; i++)
			if(document.oldControls[i].getZIndex() > max)
				max = document.oldControls[i].getZIndex();

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

		return max + 1;
	}

	oldControl.prototype.getZIndex = function()
	{
		return new Number(this.element.style.zIndex);
	}

	oldControl.prototype.setZIndex = function(index)
	{
		this.element.style.zIndex = index;
	}

	oldControl.prototype.show = function()
	{
		$(this.element).removeClass('hidden');
		this.setZIndex(this.getTopZIndex());
	}

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

	oldControl.prototype.hide = function()
	{
		$(this.element).addClass('hidden');
		this.setZIndex(0);
	}

