<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs
height="420"
scrolling="true"
title="Conway's game of life" 
directory_title="Conway's game of life"
description="From wikipedia: The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is the best-known example of a cellular automaton. One interacts with the Game of Life by creating an initial configuration and observing how it evolves."
title_url="http://www.gingagadgets.com/hub.php?caller=life"
screenshot="http://hosting.gmodules.com/ig/gadgets/file/109859150862124727573/screenshot_life.png"
thumbnail="http://hosting.gmodules.com/ig/gadgets/file/109859150862124727573/thumbnail_life.png"
singleton="false" author="Ginga"
author_email="ginga.gadgets@gmail.com" author_location="USA"
author_photo="http://ginga.gadgets.googlepages.com/authorphoto.png"
author_aboutme="Restless"
author_quote="Tra-la-laa-rific!"
author_link="http://gingagadgets.com"
author_affiliation="ginga gadgets" category="funandgames" category2="lifestyle">

<Require feature="dynamic-height"/> 
<Require feature="minimessage"/>
<Require feature="analytics" /> 

</ModulePrefs>

<UserPref 
name="size" 
display_name="Cell size"
default_value="11"
datatype="enum">
<EnumValue value="11" display_value="Big" />
<EnumValue value="5" display_value="Small" />
</UserPref>

<Content type="html"><![CDATA[

	 <!-- Anchor everything -->
	 <div id="msg_div"></div>
	 <div id="content_div" align="center"></div>

	 <!-- Dynamic content -->
	 <script type="text/javascript">

	 // PREFERENCES
	 var prefs = new _IG_Prefs();
	 var size = prefs.getString("size");
	 
	 _IG_Analytics("UA-2621463-1", "/life");

	 // Run onload
	 _IG_RegisterOnloadHandler(init);

	 // Called on startup !
	 function init() {
 	   display();
	 }

	 var msg = new _IG_MiniMessage(__MODULE_ID__,_gel("msg_div"));

	 _IG_FetchContent('http://www.gingagadgets.com/lib/message_center.php?caller=life', function (responseText) {
	   msgStatus = msg.createDismissibleMessage(responseText,resize);
	   msgStatus.style.backgroundColor = "white";
	   _IG_AdjustIFrameHeight();
	 });
	 
	 function resize() {
	   _IG_AdjustIFrameHeight();
	 }

	 function display() {
	   var html = '<applet code="org.bitstorm.gameoflife.GameOfLife.class" codebase="http://www.gingagadgets/gameoflife/" archive="http://gingagadgets.com/gameoflife/gameoflife.jar" width=320 height=400><param name="cellsize" value="' + size + '"><param name="cellcols" value="32"><param name="cellrows" value="40"><p>To see John Conways Game of Life, you need to have Java installed.	   And of course Java-support has to be turned on.</p>	   <ul>   <li><a href="http://www.java.com/en/download/">Download Java now</a>	   </ul>   </applet><a target="_blank" href="http://en.wikipedia.org/wiki/Conway\'s_Game_of_Life"><span style="font-size:x-small">Wiki: Game of life</span></a>';

	   _gel('content_div').innerHTML = html;
	   
	   resize();
	 }

	 </script>

]]></Content>
</Module>

