Array.prototype.swap = function (i,j)
{	
	var temp = this[i];
	this[i] = this[j];
	this[j] = temp;
}
Array.prototype.permute = function ()
{
	var n = this.length;
	for ( var i = n - 1; i > 0; i--) 
	{
	    var j = Math.floor(Math.random() * (i + 1));
	    this.swap ( i,j );
	}
}
