Advertisement
Serpico57

Zodiacal period

Mar 26th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var sign;
  2. var pietra;
  3. var filepath;
  4.  
  5.  
  6. // function to extract the actual zodiacal period
  7. function getPeriod()
  8. {
  9.       var oggi = new Date();
  10.       var gior = oggi.getDate().toString();
  11.       var mese = (oggi.getMonth() + 1).toString();
  12.       var anno = oggi.getFullYear().toString();
  13.       var data = anno + ( mese.length < 2 ? "0" : "" ) + mese + ( gior.length < 2 ? "0" : "" ) + gior;
  14.      
  15.       if ( parseInt( data ) >= parseInt( anno + "0320" ) && parseInt( data ) <= parseInt( anno + "0420" ) ) { // dal 20 marzo al 20 aprile
  16.         document.write("dell'Ariete " ); sign = 0; pietra = "il Diaspro rosso"; filepath = "Pietre_ariete.htm";
  17.       }
  18.       if ( parseInt( data ) >= parseInt( anno + "0421" ) && parseInt( data ) <= parseInt( anno + "0519" ) ) { // dal 21 aprile al 19 maggio
  19.         document.write(" del Toro" ); sign = 1; pietra = "il Quarzo rosa"; filepath = "Pietre_toro.htm";
  20.       }
  21.       if ( parseInt( data ) >= parseInt( anno + "0520" ) && parseInt( data ) <= parseInt( anno + "0621" ) ) { // dal 20 maggio al 21 giugno
  22.         document.write("dei Gemelli" ); sign = 2; pietra = "l&acute;Occhio di tigre"; filepath = "Pietre_gemelli.htm";
  23.       }
  24.       if ( parseInt( data ) >= parseInt( anno + "0622" ) && parseInt( data ) <= parseInt( anno + "0722" ) ) { // dal 22 giugno al 22 luglio
  25.         document.write("del Cancro"); sign = 3; pietra = "la Pietra di Luna"; filepath = "Pietre_cancro.htm";
  26.       }
  27.       if ( parseInt( data ) >= parseInt( anno + "0723" ) && parseInt( data ) <= parseInt( anno + "0822" ) ) { // dal 23 luglio al 22 agosto
  28.         document.write("del Leone"); sign = 4; pietra = "il Cristallo di rocca"; filepath = "Pietre_leone.htm";
  29.       }
  30.       if ( parseInt( data ) >= parseInt( anno + "0823" ) && parseInt( data ) <= parseInt( anno + "0923" ) ) { // dal 23 agosto al 23 settembre
  31.         document.write("della Vergine"); sign = 5; pietra = "l&acute;Amazzonite"; filepath = "Pietre_vergine.htm";
  32.       }
  33.       if ( parseInt( data ) >= parseInt( anno + "0924" ) && parseInt( data ) <= parseInt( anno + "1022" ) ) { // dal 24 settembre al 22 ottobre
  34.         document.write("della Bilancia"); sign = 6; pietra = "la Giada"; filepath = "Pietre_bilancia.htm";
  35.       }
  36.       if ( parseInt( data ) >= parseInt( anno + "1023" ) && parseInt( data ) <= parseInt( anno + "1121" ) ) { // dal 23 ottobre al 21 novembre
  37.         document.write("dello Scorpione"); sign = 7; pietra = "il Quarzo tormalinato"; filepath = "Pietre_scorpione.htm";
  38.       }
  39.       if ( parseInt( data ) >= parseInt( anno + "1122" ) && parseInt( data ) <= parseInt( anno + "1221" ) ) { // dal 22 novembre al 21 dicembre
  40.         document.write("del Sagittario"); sign = 8; pietra = "la Malachite"; filepath = "Pietre_sagittario.htm";
  41.       }
  42.       if ( parseInt( data ) >= parseInt( anno + "1222" ) && parseInt( data ) <= parseInt( anno + "3112" ) ) { // dal 22 dicembre al 31 dicembre,
  43.         document.write("del Capricorno"); sign = 9; pietra = "l&acute;Ossidiana"; filepath = "Pietre_capricorno.htm";
  44.       }
  45.       if ( parseInt( data ) >= parseInt( anno + "0101" ) && parseInt( data ) <= parseInt( anno + "0120" ) ) { // dal 1° gennaio al 20 gennaio
  46.         document.write("del Capricorno"); sign = 9; pietra = "l&acute;Ossidiana"; filepath = "Pietre_capricorno.htm";
  47.       }
  48.       if ( parseInt( data ) >= parseInt( anno + "0121" ) && parseInt( data ) <= parseInt( anno + "0219" ) ) { // dal 21 gennaio al 19 febbraio
  49.         document.write("dell'Acquario"); sign = 10; pietra = "il Lapislazzuli"; filepath = "Pietre_acquario.htm";
  50.       }
  51.       if ( parseInt( data ) >= parseInt( anno + "0220" ) && parseInt( data ) <= parseInt( anno + "0319" ) ) { // dal 20 febbraio al 19 marzo
  52.         document.write("dei Pesci"); sign = 11; pietra = "l&acute;Ametista"; filepath = "Pietre_pesci.htm";
  53.       }
  54.  }    
  55.  
  56. // define array with all zodiacal stones used
  57.  function apri(conta) {
  58.     nuovo=new Array("wp-content/themes/catch-evolution-child/images/diaspro_rosso_ariete.png",
  59.                     "wp-content/themes/catch-evolution-child/images/quarzo_rosa_toro.png",
  60.                     "wp-content/themes/catch-evolution-child/images/occhio_di_tigre_gemelli.png",
  61.                     "wp-content/themes/catch-evolution-child/images/pietre_di_luna_cancro.png",
  62.                     "wp-content/themes/catch-evolution-child/images/cristallo_di_rocca_leone.png",
  63.                     "wp-content/themes/catch-evolution-child/images/amazzonite_vergine.png",
  64.                     "wp-content/themes/catch-evolution-child/images/giada_bilancia.png",
  65.                     "wp-content/themes/catch-evolution-child/images/quarzotormalinato_scorpione.png",
  66.                     "wp-content/themes/catch-evolution-child/images/malachite_sagittario.png",
  67.                     "wp-content/themes/catch-evolution-child/images/ossidiana_capricorno.png",
  68.                     "wp-content/themes/catch-evolution-child/images/lapislazzulo_acquario.png",
  69.                     "wp-content/themes/catch-evolution-child/images/ametista_pesci.png")
  70.     document.galle.src=nuovo[conta]
  71. }
  72.  
  73.  
  74. // Function to start the JS into the home page of the site  
  75.  function avvia() {
  76.     apri(sign)
  77. }
  78.  
  79.  
  80. //Function to extract the corresponding zodiacal stone
  81.  function getStone() {
  82.     stone= pietra;
  83.     document.write(stone);
  84. }
  85.  
  86.  
  87. // function for the assembling of the href statement to display the image and the corresponding file path pointing on a html page which contains more information about stones of this zodiacal sign
  88.  function getLink()  {
  89. document.write('<a href='+ filepath + '>');
  90. document.write('<img src="" name="galle" class="pietra" height=92 width=123/>');
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement