function Cell(board,numberImage)
{
	this.board=board;
    this.numberImage = numberImage;
    this.connectors = [null,null,null,null];
    this.openConnections = 0;
	this.lit = false;
	this.section = -1;
    this.update = function()
    {
        document.getElementById(this.numberImage).src = "images/jsconnect/" + 
			themes.getCurrent().path + 
			String(this.openConnections) +
			((this.lit)?("lit"):("")) + 
			((properties.options.colorDeadEndChainsDifferently)?((this.board.sectionTallies[this.section]>1)?(""):("deadend")):("deadend")) +
			".png";
    }
	this.clear = function()
	{
		this.openConnections = 0;
	}
	this.light = function()
	{
		if(this.lit) return;
		this.lit = true;
		for(var index=0;index<properties.map.directions.count;++index)
		{
			if(this.connectors[index]!=null)
			{
				this.connectors[index].light();
			}
		}
	}
	this.paint = function(section)
	{
		if(this.section!=-1) return;
		this.section = section;
		this.board.sectionTallies[section]+=this.openConnections;
		for(var index=0;index<properties.map.directions.count;++index)
		{
			if(this.connectors[index]!=null)
			{
				this.connectors[index].paint(section);
			}
		}
	}
}
