properties.inputs.menuCaption=
{
	"tag":"div",
	"attributes":
	{
	},
	"styles":
	{
		"position":"absolute",
		"width":"100%",
		"left":"0px",
		"top":"0px",
		"text-align":"center",
		"background-color":"#404040",
		"color":"#ffffff"
	},
	"content":"Main Menu"
};
properties.inputs.btnNewGame=
{
	"tag":"button",
	"attributes":
	{
		"id":"btnNewGame"
	},
	"styles":
	{
		"position":"absolute",
		"left":"10%",
		"width":"80%",
		"top":"30px",
		"height":"24px"
	},
	"content":"New Game"
};
properties.inputs.btnInstructions=
{
	"tag":"button",
	"attributes":
	{
		"id":"btnInstructions"
	},
	"styles":
	{
		"position":"absolute",
		"left":"10%",
		"width":"80%",
		"top":"60px",
		"height":"24px"
	},
	"content":"Instructions"
};
properties.inputs.btnTipsAndTricks=
{
	"tag":"button",
	"attributes":
	{
		"id":"btnTipsAndTricks"
	},
	"styles":
	{
		"position":"absolute",
		"left":"10%",
		"width":"80%",
		"top":"90px",
		"height":"24px"
	},
	"content":"Tips and Tricks"
};
properties.inputs.btnOptions=
{
	"tag":"button",
	"attributes":
	{
		"id":"btnOptions"
	},
	"styles":
	{
		"position":"absolute",
		"left":"10%",
		"width":"80%",
		"top":"120px",
		"height":"24px"
	},
	"content":"Options"
};
properties.inputs.btnTheme=
{
	"tag":"button",
	"attributes":
	{
		"id":"btnTheme"
	},
	"styles":
	{
		"position":"absolute",
		"left":"10%",
		"width":"80%",
		"top":"150px",
		"height":"24px"
	},
	"content":"Change Theme"
};
properties.inputs.btnAbout=
{
	"tag":"button",
	"attributes":
	{
		"id":"btnAbout",
		"src":"images/jsconnect/menu/about.png"
	},
	"styles":
	{
		"position":"absolute",
		"left":"10%",
		"width":"80%",
		"top":"180px",
		"height":"24px"
	},
	"content":"About Connect!"
};
properties.inputs.btnResume=
{
	"tag":"button",
	"attributes":
	{
		"id":"btnResume",
		"src":"images/jsconnect/menu/resume.png"
	},
	"styles":
	{
		"position":"absolute",
		"left":"10%",
		"width":"80%",
		"top":"210px",
		"height":"24px"
	},
	"content":"Resume Game"
};
properties.frames.menu=
{
	"tag":"div",
	"attributes":
	{
		"id":"frmMenu"
	},
	"styles":
	{
		"position":"absolute",
		"visibility":"hidden",
		"left":"0px",
		"top":"0px",
		"width":"256px",
		"height":"256px",
		"background-color":"#c0c0c0",
		"border":"solid 1px #808080"
	},
	"getWidth":function(){return(256);},
	"getHeight":function(){return(256);}
};
function MenuFrame(id,parent)
{
	this.parent = parent;
	this.frame = document.getElementById(id);
	var temp="";
	temp+=htmlGenerator.createTag(properties.inputs.menuCaption);
	temp+=htmlGenerator.createTag(properties.inputs.btnNewGame);
	temp+=htmlGenerator.createTag(properties.inputs.btnInstructions);
	temp+=htmlGenerator.createTag(properties.inputs.btnTipsAndTricks);
	temp+=htmlGenerator.createTag(properties.inputs.btnOptions);
	temp+=htmlGenerator.createTag(properties.inputs.btnTheme);
	temp+=htmlGenerator.createTag(properties.inputs.btnAbout);
	temp+=htmlGenerator.createTag(properties.inputs.btnResume);
	this.frame.innerHTML=temp;
	document.getElementById("btnNewGame").onclick=function(){mainFrame.menuFrame.onNewGame();}
	document.getElementById("btnInstructions").onclick=function(){mainFrame.menuFrame.onInstructions();}
	document.getElementById("btnTipsAndTricks").onclick=function(){mainFrame.menuFrame.onTipsAndTricks();}
	document.getElementById("btnAbout").onclick=function(){mainFrame.menuFrame.onAbout();}
	document.getElementById("btnResume").onclick=function(){mainFrame.menuFrame.onResume();}
	document.getElementById("btnOptions").onclick=function(){mainFrame.menuFrame.onOptions();}
	document.getElementById("btnTheme").onclick=function(){mainFrame.menuFrame.onTheme();}
	this.update=function()
	{
		this.frame.style.left=(properties.map.getWidth()-properties.frames.menu.getWidth())/2;
		this.frame.style.top=(properties.map.getHeight()-properties.frames.menu.getHeight())/2;
	};
	this.onNewGame=function()
	{
		mainFrame.newGameFrame.show();
		this.hide();
	};
	this.onInstructions=function()
	{
		mainFrame.instructionsFrame.subFrame.innerHTML=
		"<h3>How To Play Connect!</h3>"+
		"<p>The goal of Connect! is to connect all of the individual nodes into a single maze pattern with no isolated chains, no unused connections, and no short circuit loops.</p>"+
		"<p>At the beginning of a game, each cell has a number in it.  This number specifies how many of the neighboring cells connect to it. You click between two cells to add a connection if one is not present, or to remove an existing connection between cells.</p>"+
		"<p>An group of connected cells is called a chain. A cell or chain with only one unused connection is a dead end chain or cell.  They are colored differently than chains or cell that have more than one unused connection</p>"+
		"<p>The upper left cell is &quot;lit&quot;, and the &quot;light&quot; extends to all cells in the same chain as the upper left cell.  The goal of the game is to get all cells on the board &quot;lit&quot;.  A dead end lit chain is colored differently from a non-dead end lit chain.</p>"+
		"<p>The game will not allow short circuit loops, but it will allow isolated chains.</p>";
		mainFrame.instructionsFrame.show();
		this.hide();
	};
	this.onTipsAndTricks=function()
	{
		mainFrame.instructionsFrame.subFrame.innerHTML=
		"<h3>Tips and Tricks</h3>"+
		"<p>When starting out a game, solve the &quot;obvious&quot; cells first.  Cells with 4 unused connections, cells with 3 connections on the edge of the board, and cells with 2 connections in the corners must be connected to all of their neighbors.</p>"+
		"<p>The game will not allow short circuit loops, so this can be used as a tool to rule out certain connections.</p>"+
		"<p>With the exception of the very last move of the game, two chains or cells with 1 unused connection each will not be joined together, as they would create an isolated chain.</p>"+
		"<p>Similarly, a 2 cell with two neightbors that are 1s and one neighbor that is a 2 or more will definitely connect to the 2 or more, and only to one of the 1s.</p>"+
		"<p>Often, deduction will only get you so far in solving a maze, and you will find yourself needing to speculate.  Make good use of marking the state where you &quot;know&quot; that you are correct, and go back to it later if you need to.</p>"+
		"<p>Many times, there is more than one solution to a maze, although the multiples will often vary only slightly.</p>";
		mainFrame.instructionsFrame.show();
		this.hide();
	};
	this.onAbout=function()
	{
		mainFrame.instructionsFrame.subFrame.innerHTML=
		"<h3>About Connect!</h3>"+
		"<p>Copyright &copy; 2008 <a href=\"http://www.playdeez.com\">PlayDeez Games</a>.</p>"+
		"<p>Provided \"AS IS\" with no warranty of fitness for a particular purpose.</p>";
		mainFrame.instructionsFrame.show();
		this.hide();
	};
	this.onResume=function()
	{
		this.hide();
	};
	this.onOptions=function()
	{
		mainFrame.optionsFrame.show();
		this.hide();
	};
	this.onTheme=function()
	{
		mainFrame.themeFrame.show();
		this.hide();
	};
	this.hide=function()
	{
		this.frame.style.visibility="hidden";
	}
	this.show=function()
	{
		this.frame.style.visibility="visible";
	}
}