function movePiece(cbNumber, name, source, dest, squareSize, take)
{
	document.getElementById('cb' + cbNumber + 'p' + name).style.left	=  ((dest.charCodeAt(0) - 'a'.charCodeAt(0)) * squareSize + squareSize/2) + "px";
	document.getElementById('cb' + cbNumber + 'p' + name).style.top		=  ((8 - dest.charAt(1))                     * squareSize + squareSize/2) + "px";
	if(take == 1)
	{
		takenPieces[nTakenPieces] = chessArray[(dest.charCodeAt(0) - 'a'.charCodeAt(0)) + (8 - dest.charAt(1)) * 8];
		document.getElementById('cb' + cbNumber + 'p' + chessArray[(dest.charCodeAt(0) - 'a'.charCodeAt(0)) + (8 - dest.charAt(1)) * 8]).style.visibility = 'hidden';
		++nTakenPieces;
	}
	chessArray[(dest.charCodeAt(0) - 'a'.charCodeAt(0)) + (8 - dest.charAt(1)) * 8] = name;
	if(take == -1)
	{
		document.getElementById('cb' + cbNumber + 'p' + takenPieces[nTakenPieces -1]).style.visibility = 'visible';
		chessArray[(source.charCodeAt(0) - 'a'.charCodeAt(0)) + (8 - source.charAt(1)) * 8] = takenPieces[nTakenPieces - 1];
		--nTakenPieces;
	}
}

function movePieceB(cbNumber, name, source, dest, squareSize, take)
{
	document.getElementById('cb' + cbNumber + 'p' + name).style.left	=  ((7 - (dest.charCodeAt(0) - 'a'.charCodeAt(0))) * squareSize + squareSize/2) + "px";
	document.getElementById('cb' + cbNumber + 'p' + name).style.top		=  ((dest.charAt(1) - 1)                     * squareSize + squareSize/2) + "px";
	if(take == 1)
	{
		takenPieces[nTakenPieces] = chessArray[(dest.charCodeAt(0) - 'a'.charCodeAt(0)) + (8 - dest.charAt(1)) * 8];
		document.getElementById('cb' + cbNumber + 'p' + chessArray[(dest.charCodeAt(0) - 'a'.charCodeAt(0)) + (8 - dest.charAt(1)) * 8]).style.visibility = 'hidden';
		++nTakenPieces;
	}
	chessArray[(dest.charCodeAt(0) - 'a'.charCodeAt(0)) + (8 - dest.charAt(1)) * 8] = name;
	if(take == -1)
	{
		document.getElementById('cb' + cbNumber + 'p' + takenPieces[nTakenPieces -1]).style.visibility = 'visible';
		chessArray[(source.charCodeAt(0) - 'a'.charCodeAt(0)) + (8 - source.charAt(1)) * 8] = takenPieces[nTakenPieces - 1];
		--nTakenPieces;
	}
}