<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Oroscopo del giorno" description="Oroscopo del giorno: ariete, toro, gemelli, cancro, leone, vergine, bilancia, scorpione, sagittario, capricorno, acquario, pesci" title_url="http://www.facilegadget.it" author="FacileGadget" author_email="info@facilegadget.it" author_location="Italia" author_link="http://www.facilegadget.it" scrolling="true" height="380" screenshot="http://facilegadget.googlecode.com/svn/trunk/oroscopo/oroscopo_screenshot.png" thumbnail="http://facilegadget.googlecode.com/svn/trunk/oroscopo/oroscopo_thumbnail.png" >
<Require feature="analytics" />
<Require feature="setprefs" />
</ModulePrefs>
<UserPref name="Segno" display_name="Scegli il segno:" datatype="enum" required="true" default_value="0">
  <EnumValue value="0" display_value="Ariete"/>
  <EnumValue value="1" display_value="Toro"/>
  <EnumValue value="2" display_value="Gemelli"/>
  <EnumValue value="3" display_value="Cancro"/>
  <EnumValue value="4" display_value="Leone"/>
  <EnumValue value="5" display_value="Vergine"/>
  <EnumValue value="6" display_value="Bilancia"/>
  <EnumValue value="7" display_value="Scorpione"/>
  <EnumValue value="8" display_value="Sagittario"/>
  <EnumValue value="9" display_value="Capricorno"/>
  <EnumValue value="10" display_value="Acquario"/>
  <EnumValue value="11" display_value="Pesci"/>
</UserPref>
<Content type="html"><![CDATA[
<link rel="stylesheet" type="text/css" href="http://facilegadget.googlecode.com/svn/trunk/facilegadget.css" />
<script type="text/javascript">
//parametri gadget  
var nomegadget = "oroscopo";
var IDgadget = "24";
var piattaforma = "igoogle";
</script>
<script type="text/javascript" src="http://facilegadget.googlecode.com/svn/trunk/facilegadget.js"></script>
<style>
    i {color: #808080;}
    form {margin: 0;}
    p {margin: 5 0 10 0;}

    #title_div {text-align: center; font-weight: bold; font-size: 120%; margin-top: 10px;}
    #content_div {margin: 15 4 5 4; font-size: 100%;}
    #segni {font-size: 85%; font-weight: bold; text-align: center; margin-top: 10px;}
</style>

<script type="text/javascript">
var prefs = new _IG_Prefs();

function cambia() {
  if (cambiasegno.selectedIndex != "99") {
    var selIndex = cambiasegno.selectedIndex;
    prefs.set("Segno", cambiasegno.options[selIndex].value);
    Oroscopo();
  }
}

function datasegno(nrsegno) {
  switch (nrsegno)
  {
  case "0" : return "<br>21 marzo - 20 aprile";
  break;
  case "1" : return "<br>21 aprile - 20 maggio";
  break;
  case "2" : return "<br>21 maggio - 21 giugno";
  break;
  case "3" : return "<br>22 giugno - 22 luglio";
  break;
  case "4" : return "<br>23 luglio - 23 agosto";
  break;
  case "5" : return "<br>24 agosto - 22 settembre";
  break;
  case "6" : return "<br>23 settembre - 22 ottobre";
  break;
  case "7" : return "<br>23 ottobre - 22 novembre";
  break;
  case "8" : return "<br>23 novembre - 21 dicembre";
  break;
  case "9" : return "<br>22 dicembre - 20 gennaio";
  break;
  case "10" : return "<br>21 gennaio - 19 febbraio";
  break;
  case "11" : return "<br>20 febbraio - 20 marzo";
  break;
  }
}
  
function giorno(stringa) {
  switch (stringa)
  { 
  case "Mon" : return "lunedi";
  break;
  case "Tue" : return "martedi";
  break;
  case "Wed" : return "mercoledi";
  break;
  case "Thu" : return "giovedi";
  break;
  case "Fri" : return "venerdi";
  break;
  case "Sat" : return "sabato";
  break;
  case "Sun" : return "domenica";
  break;
  }
}


var html, url, segno, dataoroscopo, datagiorno;
var descrizione, i, j, nodeList, itemList, node, numeromax;
var i = prefs.getInt("Segno");
url = "http://it.horoscopofree.com/rss/horoscopofree-it.rss";

  
function Oroscopo() {
  var numero = prefs.getString("Segno");
  var numeropros = numero + 1;
  if (numeropros > numeromax) {numeropros = 0;}

  var numeroprec = numero - 1;
  if (numeroprec < 0) {numeroprec = numeromax;}

  
  _IG_FetchFeedAsJSON(url, function (feed) {
    if (typeof feed == "undefined" || typeof feed.Entry == "undefined") {
      _gel("content_div").innerHTML = "<i>Nessun dato da visualizzare</i>";
      return;
    }
    numeromax = feed.Entry.length - 1;
  
    if (numero > numeromax) {numero = 0;}
      html = "";

      var entry = feed.Entry[numero];
      title = _hesc(entry.Title);
      link = entry.Link;
      descrizione = entry.Summary;
      descrizione = descrizione.replace(entry.Title, "");
      descrizione = descrizione.replace("<br/>", "");
      descrizione = descrizione.replace('<a href="http://www.horoscopofree.com/it/community/registration/?IDPartner=57">Iscriviti al tuo oroscopo quotidiano in e-mail!</a>', '');

      if (title != "") {
        _gel("title_div").innerHTML = "<img src='http://facilegadget.googlecode.com/svn/trunk/oroscopo/loghi/oroscopo" + numero + ".gif' width=25 border=0 /><br />" + title + datasegno(numero);
        html = html + "<p>" + descrizione + "</p>";
      }
      else {
        numeroi = 1;
        if (param == 2) {numeroi = 2;}
        Contenuto(numeroi);
      }
      _gel("content_div").innerHTML = html;
    }, 50, (0 > -1));
  }
</script>

<div id="title_div"></div>
<div id="content_div"></div>
<div id="segni">Segno zodiacale: <select name="cambiasegno" id="cambiasegno" onChange="cambia()">
<option value="99">Scegli...</option>
<option value="0">Ariete</option>
<option value="1">Toro</option>
<option value="2">Gemelli</option>
<option value="3">Cancro</option>
<option value="4">Leone</option>
<option value="5">Vergine</option>
<option value="6">Bilancia</option>
<option value="7">Scorpione</option>
<option value="8">Sagittario</option>
<option value="9">Capricorno</option>
<option value="10">Acquario</option>
<option value="11">Pesci</option>
</select></div>

<script type="text/javascript">
scriviby(IDgadget, nomegadget);
</script>

<div id="adv">
<script type="text/javascript">
stats(nomegadget, piattaforma);
Oroscopo();
</script>
<iframe marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true" src="http://srv.juiceadv.com/banner_iframe.asp?user=871&amp;tipo=20" width="250" height="250"></iframe>
<script type="text/javascript" src="http://srv.juiceadv.com/banner_ext.asp?User=871&Tipo=13"></script>
</div>

]]></Content>
</Module>