function sliderGroup()
{
	// Constructs
		this.objects = new Array();
		
		this.objectToOpen = null;
		this.objectToClose = null;
		
		this.slideTotalSteps = 10;
		this.slideCurrentStep = 0;
		
		this.timerId = null;
		this.timeoutSpeed = 30;
}

sliderGroup.prototype.add = function(object)
{
	object.hideNow();
	object.setSlideTotalSteps(this.slideTotalSteps);
	this.objects.push(object);
}

sliderGroup.prototype.setSlideTotalSteps = function(mySlideTotalSteps)
{
	this.slideTotalSteps = mySlideTotalSteps;
	for (var obj_key in this.objects)
		this.objects[obj_key].setSlideTotalSteps(mySlideTotalSteps);
}

sliderGroup.prototype.hideAllNow = function()
{
	for(var obj_key in this.objects)
		this.objects[obj_key].hideNow();
}

sliderGroup.prototype.openAllButNow = function(object)
{
        this.hideAllNow();
	
	object.showNow();
	this.objectToOpen = object;
}

sliderGroup.prototype.openAllBut = function(object)
{
	if (this.objectToOpen == null)
	{
		alert("VS Group: Please open an object first!");
		return false;
	}
	if (this.objectToOpen == object)
	{
		// alert("VS Group: Object already opened!");
		return false;
	}
	
	if (this.running()) return false;
	
	this.slideCurrentStep = 0;
	this.objectToClose = this.objectToOpen;
	this.objectToOpen = object;
	
	this.start();
}

sliderGroup.prototype.openAllBut_old = function(object)
{
	var obj_key;
	for (obj_key in this.objects)
	{
		//alert(this.objects[obj]);
		if (this.objects[obj_key].containerId != object.containerId)
		{
			this.objects[obj_key].className = this.defaultCssClassName;
			this.objects[obj_key].hide();
		}
		else
		{
			this.objects[obj_key].className = this.selectedCssClassName;
			this.objects[obj_key].show();
		}
	}
}

sliderGroup.prototype.sliding = function()
{
	if (this.slideCurrentStep < this.slideTotalSteps)
	{
		// Please use stepOpen and stepCLose instead of this
		// Although the code below fixes the firefox flickering problem
		
		// Prepare Open
		this.objectToOpen.containerCurrentHeight += this.objectToOpen.scrollSpeed;
		if (this.objectToOpen.containerCurrentHeight > this.objectToOpen.containerHeight)
			this.objectToOpen.containerCurrentHeight = this.objectToOpen.containerHeight;
			
		// Prepare Close
		this.objectToClose.containerCurrentHeight -= this.objectToClose.scrollSpeed;
		if (this.objectToClose.containerCurrentHeight < this.objectToClose.minHeight)
			this.objectToClose.containerCurrentHeight = this.objectToClose.minHeight;
			
		/*
		var sum = this.objectToClose.containerCurrentHeight
					+ this.objectToOpen.containerCurrentHeight;
		alert("close="+this.objectToClose.containerCurrentHeight+"\r\n"
				+"open="+this.objectToOpen.containerCurrentHeight+"\r\n\r\n"
				+"sum="+sum);
		*/
		
		// Update (as closely as possible)
		this.objectToOpen.containerObj.style.height = this.objectToOpen.containerCurrentHeight;
		this.objectToClose.containerObj.style.height = this.objectToClose.containerCurrentHeight;
		
		// Reommended way to do it
		// this.objectToOpen.stepOpen();
		// this.objectToClose.stepClose();
		
		this.slideCurrentStep++;
	}
	else
	{
		this.stop();
	}
}

sliderGroup.prototype.start = function()
{
	if (this.running())
	{
		alert('VS Group already running!');
		return false;
	}
	var _this = this;
	this.timerId = window.setInterval(	function(){ _this.sliding(); },
										_this.timeoutSpeed);
}

sliderGroup.prototype.stop = function()
{
	if (this.running())
		window.clearInterval(this.timerId);
	this.timerId = null;
}

sliderGroup.prototype.running = function()
{
	return this.timerId!=null ? true : false;
}