<?xml version="1.0" encoding="UTF-8" ?>
<Module>
	<ModulePrefs title="__MSG_optical_illusion_of_the_day__"
		title_url="http://www.moillusions.com/"
		category="funandgames"
		category2="news"
		height="256" 
     		author="Barun Vurdlak"
		author_location="Zagreb, Croatia"
		author_affiliation="Aheront d.o.o."
     		author_email="vurdlak@gmail.com"
		description="__MSG_desc__" 
		screenshot="http://www.moillusions.com/igoogle-illusion/__MSG_loca__.png" 
		thumbnail="http://www.moillusions.com/igoogle-illusion/thumbnail.png">
		<Locale messages="http://www.moillusions.com/igoogle-illusion/ALL_ALL.xml"/>
		<Locale lang="ar" messages="http://www.moillusions.com/igoogle-illusion/ar_ALL.xml" language_direction="rtl"/>
		<Locale lang="bg" messages="http://www.moillusions.com/igoogle-illusion/bg_ALL.xml"/>
		<Locale lang="ca" messages="http://www.moillusions.com/igoogle-illusion/ca_ALL.xml"/>
		<Locale lang="cs" messages="http://www.moillusions.com/igoogle-illusion/cs_ALL.xml"/>
		<Locale lang="da" messages="http://www.moillusions.com/igoogle-illusion/da_ALL.xml"/> 
		<Locale lang="de" messages="http://www.moillusions.com/igoogle-illusion/de_ALL.xml"/>
		<Locale lang="el" messages="http://www.moillusions.com/igoogle-illusion/el_ALL.xml"/>
		<Locale lang="es" messages="http://www.moillusions.com/igoogle-illusion/es_ALL.xml"/>
		<Locale lang="fi" messages="http://www.moillusions.com/igoogle-illusion/fi_ALL.xml"/>
		<Locale lang="fr" messages="http://www.moillusions.com/igoogle-illusion/fr_ALL.xml"/>
		<Locale lang="hi" messages="http://www.moillusions.com/igoogle-illusion/hi_ALL.xml"/>
		<Locale lang="he" messages="http://www.moillusions.com/igoogle-illusion/iw_ALL.xml" language_direction="rtl"/>
		<Locale lang="hr" messages="http://www.moillusions.com/igoogle-illusion/hr_ALL.xml"/>
		<Locale lang="it" messages="http://www.moillusions.com/igoogle-illusion/it_ALL.xml"/>
		<Locale lang="iw" messages="http://www.moillusions.com/igoogle-illusion/iw_ALL.xml" language_direction="rtl"/>
		<Locale lang="lt" messages="http://www.moillusions.com/igoogle-illusion/lt_ALL.xml"/>
		<Locale lang="nl" messages="http://www.moillusions.com/igoogle-illusion/nl_ALL.xml"/>
		<Locale lang="no" messages="http://www.moillusions.com/igoogle-illusion/no_ALL.xml"/>
		<Locale lang="pl" messages="http://www.moillusions.com/igoogle-illusion/pl_ALL.xml"/>
		<Locale lang="pt-br" messages="http://www.moillusions.com/igoogle-illusion/pt-br_ALL.xml"/>
		<Locale lang="pt-pt" messages="http://www.moillusions.com/igoogle-illusion/pt-pt_ALL.xml"/>
		<Locale lang="ro" messages="http://www.moillusions.com/igoogle-illusion/ro_ALL.xml"/>
		<Locale lang="ru" messages="http://www.moillusions.com/igoogle-illusion/ru_ALL.xml"/>
		<Locale lang="sl" messages="http://www.moillusions.com/igoogle-illusion/sl_ALL.xml"/>
		<Locale lang="sr" messages="http://www.moillusions.com/igoogle-illusion/sr_ALL.xml"/>
		<Locale lang="sv" messages="http://www.moillusions.com/igoogle-illusion/sv_ALL.xml"/>
		<Locale lang="sk" messages="http://www.moillusions.com/igoogle-illusion/sk_ALL.xml"/>
		<Locale lang="tr" messages="http://www.moillusions.com/igoogle-illusion/tr_ALL.xml"/>
		<Locale lang="zh-cn" messages="http://www.moillusions.com/igoogle-illusion/zh-cn_ALL.xml"/>
		<Locale lang="zh-tw" messages="http://www.moillusions.com/igoogle-illusion/zh-tw_ALL.xml"/>
		<Require feature="analytics" /> 
	</ModulePrefs>
	<UserPref name="displayEntryNum" display_name="__MSG_en_num__" default_value="1" datatype="enum">
		<EnumValue value="1" />
		<EnumValue value="2" />
		<EnumValue value="3" />
		<EnumValue value="4" />
		<EnumValue value="5" />
	</UserPref>

	<Content type="html">
		<![CDATA[
		<!-- ALm6fM0Wqhp9Rv84UEzOra2_FLXn-NghjSrKHCRWTu2GgOGgqGSe9qwYkghxA9M2ZSsw2CEHTwDmowpd3qCM1OznWDF8cvTC_XU2WuXROzd3TV-annOj6tF8kPPahro6uqyXk0vOKUFg -->
			<div id="content___MODULE_ID__" style="text-align: center;"></div>
  
			<style type="text/css"> 
				a {text-decoration: underline;  font-size: 14px;}
				a:hover { color: #FF0000; text-decoration: underline;}
				a#more {text-decoration: none; color: #008000; font-size: 12px;}
				a#more:hover {text-decoration: underline;}
			</style>
  
  			<script type="text/javascript">
				gadgets.util.registerOnLoadHandler(onLoad);
				
				function _IG_FetchXmlContent(url, callback, opt_params) {
                   		 var params = opt_params || {};
                   		 params["CONTENT_TYPE"] = gadgets.io.ContentType.DOM;
                      
                     		 	gadgets.io.makeRequest(url, function(obj) {
                      		  	callback(obj.data);
                     		 	}, params);
				}			
				
				function onLoad() {
					var url = 'http://feedproxy.google.com/OpticalIllusions';
					_IG_FetchXmlContent(url, parse);
				}
				
				function parse(response) {
					var prefs = new gadgets.Prefs(__MODULE_ID__);
					if (response == null || typeof(response) != "object" || response.firstChild == null) {
						document.getElementById("content___MODULE_ID__").innerHTML = "<i>Invalid data.</i>";
						return;
					}
					var entry = response.getElementsByTagName('entry').item(prefs.getString("displayEntryNum") - 1);
					title = entry.getElementsByTagName('title').item(0).firstChild.nodeValue;
					var link, links = entry.getElementsByTagName('link');
					for(var i = 0; i < links.length; i++) {
						if(links.item(i).getAttribute('rel') == 'alternate') {
							link = links.item(i).getAttribute('href');
							break;
						}
					}
					var img = entry.getElementsByTagName('content').item(0).firstChild.nodeValue.split(' src="')[1].split('"')[0];
					document.getElementById('content___MODULE_ID__').innerHTML = '<a href="' + link + '" target="_blank"><img src="' + img + '" height="215" title="Click to see in full size, view explanation, and read comments" alt="' + title + '"/></a><br />' 
					+ '<a href="' + link + '" target="_blank">' + title + '</a>' + ' ' + '<a href="' + link + '" id="more" target="_blank">' + '__MSG_more__' + '&raquo;'+ '</a>';
				}

  				// Track this gadget using Google Analytics.
  				_IG_Analytics("UA-11682749-1", "/illusion_ig_gadget");
  			</script>
		]]>
	</Content>

</Module>
