function game() {
  //  Array to hold the bgImgs
  this.bgImgs = new Array();
    this.bgImgs[0] = 'http://www.earn-web-cash.com/wp-content/uploads/2008/02/tttcircle.png';
    this.bgImgs[1] = 'http://www.earn-web-cash.com/wp-content/uploads/2008/02/tttcross.png';
			
  this.currentPlayer = 0;
  this.players = new Array();
    this.players[0] = "Player One";
    this.players[1] = "Player Two";

	
  this.changePlayer = function () {
    if (this.currentPlayer == 0) {
      this.currentPlayer = 1;
    } else {
      this.currentPlayer = 0;
    }

    var box = document.getElementById('message');
    var msg = "It is " + this.players[this.currentPlayer] + "'s turn.";
    var txt = document.createTextNode(msg);

    while (box.hasChildNodes()) {
      box.removeChild(box.lastChild);
    }

    box.appendChild(txt);
  }
	
  this.changeBackground = function (boxId) {
    var box = document.getElementById('box-' + boxId);
    box.style.background = 'transparent url(' + this.bgImgs[this.currentPlayer] + ') top left no-repeat';
    	
    box.removeAttribute('onClick');

    this.changePlayer();
  }
	
  return true;
}

