// JavaScript Document
function swapdiv(div1id, div2id)
{
	this.animator1 = new animatedcollapse(div1id, 500, false, 'block');
	this.animator2 = new animatedcollapse(div2id, 500, false, 'contract');

        this.idx = 1;
	this.inProgress = false;
}

swapdiv.prototype.swap = function()
{
	if (!this.inProgress)
	{
		this.inProgress = true;

		if (this.idx == 1)
		{
			this.animator1.slideup();
		}
		else
		{
			this.animator2.slideup();
		}

		var thisobj=this;
		setTimeout(function(){thisobj._open()}, 550);
	}
}

swapdiv.prototype._open = function()
{
	if (this.idx == 1)
	{
		this.animator2.slidedown();
		this.idx = 2;
	}
	else
	{
		this.animator1.slidedown();
		this.idx = 1;
	}

	var thisobj=this;
	setTimeout(function(){thisobj.inProgress = false}, 500);
}
