var trace = function (txt)
{
    //if (window.console) console.log(txt);
}

/*
 * Fisher-Yates algorithm to shuffle arrays
 */
Array.prototype.shuffle = function ()
{
    var i = this.length;
    var j;
    var temp;
    if ( i == 0 ) return;
    while ( --i ) {
        j = Math.floor( Math.random() * ( i + 1 ) );
        temp = this[i];
        this[i] = this[j];
        this[j] = temp;
    }
};
