<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Solver for KenKen Puzzles" height="100">
    <Require feature="com.google.gadgets.analytics"/>
    <Require feature="views"/>
  </ModulePrefs>
  <Content type="html" view="home">
    <![CDATA[
	<script type="text/javascript">
	  function GoToCanvas()
	  {
	  	gadgets.views.requestNavigateTo(new gadgets.views.View("canvas"));
	  }
	</script>
	<p>Solve KenKen Puzzles!</p>
	<p><a href="javascript:GoToCanvas()">Click here to open the editor...</a></p>
    ]]>
  </Content>
  <Content type="html" view="canvas">
    <![CDATA[
  		<STYLE type="text/css">
			/* Basic Style */
			html {
				background:			white;
			}
			body {
				color:				black;
				font-size:			75%;
			}
			table {
				font-family:			serif;
				font-size:			12px;
			}

			/* Development Style */
			div.copy {
				position:			absolute;
				left:				1em;
				top:				1em;
				width:				24em;
			}
			div.field {
				position:			absolute;
				left:				25em;
				top:				1em;
				width:				41em;
				text-align:			center;
			}
			p.controls {
				padding-left:			4em;
			}
			input#solve {
				margin-left:			8em;
			}
			input#cage_value {
				margin-left:			2em;
				width:				5em;
				text-align:			right;
			}
			table {
				margin:			0px auto;
				border-collapse:	collapse;
			}
			td {
				width:				4em;
				height:				4em;
				border-width:		1px;
				padding:			0px;
				text-align:			center;
			}
			td.board_header {
				vertical-align:		center;
			}
			td.board_cell {
				vertical-align:		top;
			}
			td p {
				margin:				0px;
				border:				0px;
				padding:			0px;
			}
			td p.cage_header {
				height:				1.5em;
				text-align:			left;
			}
			td p.cage_header span {
				font-family:		Verdana;
				font-weight:		bold;
				font-size:			0.75em;
				padding-left:		0.5em;
			}
			td p.cell_data {
				text-align:			center;
			}
		</STYLE>
		<!--[if lt IE 6]>
			<P>We're sorry, but this application is not compatible with IE versions prior to 6.0; you'll need to
			<A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1E1550CB-5E5D-48F5-B02B-20B602228DE6&displaylang=en">upgrade</A>,
			or use another <A href="http://www.mozilla.com/en-US/firefox/">browser</A>.</P>
			<P>We apologize for the inconvenience.</P>
			<P>Return to the <A href="/">home page</A>.</P>
		<![endif]-->
		<DIV class="copy">
			<H4>Introduction</H4>
			<P>This is a solver for KenKen puzzles.</P>
			<P>Begin by selecting a template (either a blank NxN puzzle, or one of the demos) from the drop-down list over the playfield.</P>
			<P>Lay out the cages:</P>
			<UL>
				<LI>Click next to a highlighted cell to add the clicked cell to the highlighted cage.</LI>
				<LI>Click on a highlighted cell to remove the clicked cell from the highlighted cage.</LI>
				<LI>Click on any other cell to highlight the cage containing the clicked cell.</LI>
			</UL>
			<P>Use the inputs below the playfield to change the rules governing the highlighted cage.</P>
			<P>Click the "solve" button to search for and display a solution to the puzzle.</P>
		</DIV>
		<DIV class="field">
			<P class="controls">
				<SELECT id="load"><OPTION></OPTION></SELECT>
				<INPUT id="reset" type="button" value="Reset">
				<INPUT id="solve" type="button" value="Solve">
			</P>
			<DIV id="test_div"></DIV>
			<P class="controls">
				Highlighted cell(s) must
				<SELECT id="cage_type">
					<OPTION value="!">equal</OPTION>
					<OPTION value="+">produce a sum of</OPTION>
					<OPTION value="-">produce a difference of</OPTION>
					<OPTION value="*">produce a product of</OPTION>
					<OPTION value="/">produce a quotient of</OPTION>
				</SELECT>
				<INPUT id="cage_value" type="text">
			</P>
		</DIV>

		<SCRIPT type="text/javascript" src="http://www.house-o-games.com/neknek/gadgets/neknek/neknek.js"></SCRIPT>
		<SCRIPT type="text/javascript">
			gadgets.util.registerOnLoadHandler(function() { app.RenderCageControls(); });
		</SCRIPT>
		<SCRIPT type="text/javascript">
			var ga = new _IG_GA("UA-8180187-2");
			ga.reportPageview("/view/neknek_solver/canvas");
		</SCRIPT>
    ]]>
  </Content>
</Module>
