var random_content_c = function()
{
	this.content_a = new Array();
};

	random_content_c.prototype.setContent = function(id_s, mutant_s, content_u)
	{
		this.content_a[id_s] = new Array();

		this.content_a[id_s]['mutant'] = mutant_s;
		this.content_a[id_s]['content'] = content_u;
	};

	random_content_c.prototype.getContent = function()
	{
		return this.content_a;
	};

/**/

var random_c = function(prefix_s)
{
	this.prefix_s = prefix_s;

	this.content_a = new Array();
};

random_c.prototype.setContent = function(random_content_o)
{
	this.content_a[this.content_a.length] = random_content_o;
};

/**/

random_c.prototype.getRandomInt = function(min_i, max_i)
{
	return Math.floor(Math.random() * (max_i - min_i + 1)) + min_i;
};

random_c.prototype.setMutation = function(id_s, mutant_s, content_u)
{
	var current_de = document.getElementById(id_s);

	eval('current_de.' + mutant_s + '= "' + content_u + '";');
};

random_c.prototype.setContentSelection = function()
{
	/* <hack id="1"> */

	var cookie_o = new cookie_c();
		cookie_o.setName('catcher_index');

	var old_index_i = cookie_o.getValue();
	var new_index_i = 0;
	var unique_b = false;

	while (!unique_b)
	{
		new_index_i = this.getRandomInt(0, (this.content_a.length - 1));
		unique_b = (new_index_i != old_index_i);
	}

	var expire_o = new Date();
		expire_o.setTime(expire_o.getTime() + (1000 * 60 * 10));

	cookie_o.setValue(new_index_i);
	cookie_o.setExpire(expire_o);
	cookie_o.setCookie();

	/* </hack id="1"> */

	var content_o = this.content_a[new_index_i];
	var content_a = content_o.getContent();

	for (var index_s in content_a)
		this.setMutation(this.prefix_s + index_s, content_a[index_s]['mutant'], content_a[index_s]['content']);
};

/**/

random_c.prototype.setDisplay = function()
{
	this.setContentSelection();
};