Array.prototype.shuffle = function (){
	for(var rnd, tmp, i=this.length; i; rnd=parseInt(Math.random()*i), tmp=this[--i], this[i]=this[rnd], this[rnd]=tmp);
};

qArray.shuffle();
quote_div = document.getElementById("quoteText");
auth_div = document.getElementById("quoteAuth");
var a=0;
var noch = false;
var counter = 0;

function change(ignore)
{
	var ignore = (ignore == null) ? "default" : ignore;

	if (counter == 1 || ignore)
	{
		quote_div.innerHTML = '&quot;' + qArray[a].text + '&quot;';
		auth_div.innerHTML = '<a href="user.php?id=' + qArray[a].id + '">' + qArray[a].name + '</a>';
		a = (a + 1) % qArray.length;
		counter++;
		setTimeout("if (counter == 1) {change();} counter--; ", 5000);

	}
}

function roll(direction)
{
	d = parseInt(direction);
	a = (a + d + qArray.length-1) % qArray.length;

	change(true);
}
change();