On load and reset a XML string representing the state of the board is created and loaded into xmlBoard. This is then transformed by xslBoard, the resulting HTML produces the starting board.
On dot click xmlBoard is transformed by xslChain, the resulting XML is then loaded into xmlBoard. xmlBoard now contains a representation of the chain about the clicked dot and the state of the board. The HTML representation of the board is done as onload, if a valid chain exist it is now highlighted.
On chain double click xmlBoard is transformed by xslRemoved, the resulting XML is then loaded into xmlBoard. xmlBoard now contains the new state of the board and the state of the board before the chain was removed, a copy of which is cached (xmlBack). The HTML representation of the new board is done as onload.
On undo click xmlBack is transformed by xslChain, the resulting XML is then loaded into xmlBoard. xmlBoard now contains a representation the state of the board. The HTML representation of the board is done as onload.
<ROOT>
<BALLS>
<BALL x="3" y="5" id="54" color="blue"/>
....
<BALL x="0" y="0" id="0" color="green"/>
</BALLS>
</ROOT>
Contact pw@interfootball.co.uk