<?xml version="1.0" encoding="UTF-8"?>
<Module>
	<ModulePrefs 
		directory_title="__MSG_titdir__"
		title="__MSG_tit__"
		title_url="http://www.badosa.com/np/?l=__MSG_lang__"
		author="Xavier Badosa"
		author_email="badosa.feedback+np@gmail.com"
		author_location="Barcelona"
		author_affiliation="Inlibris.com"
		description="__MSG_desc__"
		screenshot="http://www.badosa.com/api/gg/np/np__MSG_lang__.png"
		thumbnail="http://www.badosa.com/api/gg/np/np__MSG_lang__-thm.png"
		height="100"
		>
		<Locale messages="http://www.badosa.com/api/gg/np/ALL_ALL.xml"/>
		<Locale lang="es" messages="http://www.badosa.com/api/gg/np/es_ALL.xml"/>
		<Locale lang="ca" messages="http://www.badosa.com/api/gg/np/ca_ALL.xml"/>
		<Preload href="http://www.badosa.com/api/?o=np&amp;f=xml&amp;l=__MSG_lang__&amp;0"/>
		<Require feature="dynamic-height"/>
		<Require feature="analytics"/>
	</ModulePrefs>
	<UserPref name="lang" display_name="__MSG_language__" default_value="__MSG_lang__" datatype="enum" >
		<EnumValue value="es" display_value="__MSG_es__"/>
		<EnumValue value="ca" display_value="__MSG_ca__"/>
	</UserPref> 
<Content type="html">
<![CDATA[
	<style type="text/css">
		#content_div {padding: 5px;}
		#logo {border: 0; position: absolute; top:5px; left:5px; width: 83px; height: 15px;}
		#frase {font-family: Georgia,serif; line-height: 1.3; font-size: 75%; margin:10px 0 0 0; padding:0;}
		#frase a:link, #frase a:visited, #mes a:link, #mes a:visited { text-decoration: none;}
		#content_div #frase a:link, #content_div #frase a:visited {color: #000;}
		#mes {font-family:verdana,sans-serif;font-size:85%;font-weight:bold;text-align:right; margin:0;padding:0;line-height:1;}
		small {font-size: 80%;font-weight:normal;}
	</style>

	<div id="content_div"></div>
	<script type="text/javascript"> 
		var prefs = new _IG_Prefs();
		var lang=prefs.getString("lang");
		_IG_Analytics("UA-3753530-1", "/gadget_np"+lang);

		function np(s) {
			if (s==null || s>=5) s=0; //per evitar caché
			var url = "http://www.badosa.com/api/?o=np&f=xml&l="+lang+"&"+s;

			_IG_FetchXmlContent(url, function (response) {
				if (response == null || typeof(response) != "object" || response.firstChild == null) {
					_gel("content_div").innerHTML="<em>__MSG_na__</em>";
					return;
				}

				if(response.getElementsByTagName("status")[0].firstChild.nodeValue!="OK"){
					_gel("content_div").innerHTML="<em>__MSG_err__</em>";
					return;
				}

				s++;
				var ini="<a title=\"__MSG_prev__\" href=\"javascript:np("+(s-2)+");\">&laquo;</a>";
				var fi="<a title=\"__MSG_next__\" href=\"javascript:np("+s+");\">&raquo;</a>";
				if (s==1) ini="";
				if (s==5) fi="";
				_gel("content_div").innerHTML = "<a target=\"_blank\" href=\"http://www.badosa.com/np/?l="+lang+"\"><img id=\"logo\" alt=\"Badosa.com\" title=\"__MSG_more__\" src=\"http://www.badosa.com/img/sbadosacom.gif\" /></a><div id=\"mes\">"+ini+" <small>"+s+"/5</small> "+fi+"</div><div id=\"frase\">&laquo;"+response.getElementsByTagName("q")[0].firstChild.nodeValue+"&raquo;</div>";
				var links = document.getElementById("frase").getElementsByTagName("a");
				for (var i=0; i < links.length; i++) {
					links[i].setAttribute("title", "__MSG_visit__");
					links[i].setAttribute("target", "_blank");
				}

				_IG_AdjustIFrameHeight();
			},{ refreshInterval: (3600) }); //cada hora refrescar
		}
		_IG_RegisterOnloadHandler(np);
	</script>
]]>
</Content>
</Module>