Diferencia entre revisiones de «Widget:Calendario maya»

De CNB
Ir a la navegación Ir a la búsqueda
Busca en cnbGuatemala con Google

Línea 282: Línea 282:
 
             if(yb <=0) yb=yb + 20;
 
             if(yb <=0) yb=yb + 20;
  
if (yb==1)date.yb.value ="Imix";  
+
if (yb==1)date.tzolkin.value ="Imix"; {date.tzolkin.value ="Imix"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/c/cd/Imix.gif" width="64px">';}
else if (yb==2) date.yb.value ="Ik";  
+
else if (yb==2) {date.tzolkin.value ="Ik"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/e/e6/Ik.gif" width="64px">';}
else if (yb==3) date.yb.value ="Ak'bal";  
+
else if (yb==3) {date.tzolkin.value ="Ak'bal"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/4/4c/Akbal.gif" width="64px">';}
else if (yb==4) date.yb.value ="Kan";  
+
else if (yb==4) {date.tzolkin.value ="K'an"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/9/9e/Kan.gif" width="64px">';}
else if (yb==5) date.yb.value ="Chikchan";  
+
else if (yb==5) {date.tzolkin.value ="Chikchan"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/4/4f/Chikchan.gif" width="64px">';}
else if (yb==6) date.yb.value ="Kimi";  
+
else if (yb==6) {date.tzolkin.value ="Kimi"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/2/29/Kimi.gif" width="64px">';}
else if (yb==7) date.yb.value ="Manik";  
+
else if (yb==7) {date.tzolkin.value ="Manik"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/a/a9/Manik.gif" width="64px">';}
else if (yb==8) date.yb.value ="Lamat";  
+
else if (yb==8) {date.tzolkin.value ="Lamat"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/4/46/Lamat.gif" width="64px">';}
else if (yb==9) date.yb.value ="Muluk";  
+
else if (yb==9) {date.tzolkin.value ="Muluk"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/1/16/Muluk.gif" width="64px">';}
else if (yb==10) date.yb.value ="Ok";  
+
else if (yb==10) {date.tzolkin.value ="Ok"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/b/ba/Ok.gif" width="64px">';}
else if (yb==11) date.yb.value ="Chuen";  
+
else if (yb==11) {date.tzolkin.value ="Chuen"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/wiki/Archivo:Chuen.gif" width="64px">';}
else if (yb==12) date.yb.value ="Eb";  
+
else if (yb==12) {date.tzolkin.value ="Eb"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/0/01/Eb.gif" width="64px">';}
else if (yb==13) date.yb.value ="Ben";  
+
else if (yb==13) {date.tzolkin.value ="Ben"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/b/b2/Ben.gif" width="64px">';}
else if (yb==14) date.yb.value ="Ix";  
+
else if (yb==14) {date.tzolkin.value ="Ix"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/f/fb/Ix.gif" width="64px">';}
else if (yb==15) date.yb.value ="Men";  
+
else if (yb==15) {date.tzolkin.value ="Men"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/f/f1/Men.gif" width="64px">';}
else if (yb==16) date.yb.value ="Kib";  
+
else if (yb==16) {date.tzolkin.value ="Kib"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/b/bf/Kib.gif" width="64px">';}
                        else if (yb==17) {date.yb.value ="Kaban"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/e/e5/Kaban.gif" width="64px">';}
+
else if (yb==17) {date.tzolkin.value ="Kaban"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/e/e5/Kaban.gif" width="64px">';}
else if (yb==18) date.yb.value ="Etz'nab";  
+
else if (yb==18) {date.tzolkin.value ="Etz'nab"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/f/f8/Etznab.gif" width="64px">';}
else if (yb==19) date.yb.value ="Kawac";  
+
else if (yb==19) {date.tzolkin.value ="Kawak"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/5/55/Kawak.gif" width="64px">';}
else if (yb==0) date.yb.value ="Ahau";  
+
else if (yb==0) {date.tzolkin.value ="Ajau"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/images/2/2b/Ahau.gif" width="64px">';}
else if (yb>19) date.yb.value = "error";
 
 
 
 
 
 
 
 
 
  
  

Revisión del 13:34 20 dic 2017

<form name="dayForm" style="margin:0; padding:0">

Calendario maya

<tbody> </tbody>
<tbody> </tbody>
Año <input type="text" name="year" value="2017" size="5">
Mes

<select name="month"> <option>Enero</option> <option>Febrero</option>

<option>Marzo</option> <option>Abril</option> <option>Mayo</option> <option>Junio</option> <option>Julio</option> <option>Agosto</option>

<option>Septiembre</option> <option>Octubre</option> <option>Noviembre</option> <option>Diciembre</option> </select>

Día

<select name="day"> <option>1</option> <option>2</option> <option>3</option>

<option>4</option>

<option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option>

<option>10</option>

<option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option>

<option>16</option>

<option>17</option> <option>18</option> <option>19</option> <option>20</option> <option>21</option>

<option>22</option>

<option>23</option> <option>24</option> <option>25</option> <option>26</option> <option>27</option>

<option>28</option>

<option>29</option> <option>30</option> <option>31</option> </select>

Correlativo (calendario juliano)

<select name="corrType"> <option>584,283</option> <option>584,285</option> </select>

<input type="button" style="color:#000000" value="Calcular" onclick="maya(document.dayForm)">
  <tbody>


</tbody>
<input type="button" name="ybrad" value="9" size="5"> <input type="button" name="yb" value="Eb" size="9"> Día
<input type="button" name="baktun" value="12" size="4"> Baktun
<input type="button" name="katun" value="19" size="4"> Katun
<input type="button" name="tun" value="15" size="4"> Tun
<input type="button" name="uinal" value="2" size="4"> Uinal
<input type="button" name="kin" value="2" size="4"> Kin
<input type="button" name="tzolrad" value="1" size="5">, <input type="button" name="tzolkin" value="Ik" size="9"> Tzolkin
<input type="button" name="haabrad" value="10" size="5">, <input type="button" name="haab" value="Kayab" size="9"> Haab'
<input type="button" name="lon" value="6" size="4"> Señor de la noche


</form>

<script>

           yb=(tzolkin-haabradical)%20;
           if(yb <=0) yb=yb + 20;

if (yb==1)date.tzolkin.value ="Imix"; {date.tzolkin.value ="Imix"; document.getElementById("tzolkinimg").innerHTML= '<img src="Imix.gif" width="64px">';} else if (yb==2) {date.tzolkin.value ="Ik"; document.getElementById("tzolkinimg").innerHTML= '<img src="Ik.gif" width="64px">';} else if (yb==3) {date.tzolkin.value ="Ak'bal"; document.getElementById("tzolkinimg").innerHTML= '<img src="Akbal.gif" width="64px">';} else if (yb==4) {date.tzolkin.value ="K'an"; document.getElementById("tzolkinimg").innerHTML= '<img src="Kan.gif" width="64px">';} else if (yb==5) {date.tzolkin.value ="Chikchan"; document.getElementById("tzolkinimg").innerHTML= '<img src="Chikchan.gif" width="64px">';} else if (yb==6) {date.tzolkin.value ="Kimi"; document.getElementById("tzolkinimg").innerHTML= '<img src="Kimi.gif" width="64px">';} else if (yb==7) {date.tzolkin.value ="Manik"; document.getElementById("tzolkinimg").innerHTML= '<img src="Manik.gif" width="64px">';} else if (yb==8) {date.tzolkin.value ="Lamat"; document.getElementById("tzolkinimg").innerHTML= '<img src="Lamat.gif" width="64px">';} else if (yb==9) {date.tzolkin.value ="Muluk"; document.getElementById("tzolkinimg").innerHTML= '<img src="Muluk.gif" width="64px">';} else if (yb==10) {date.tzolkin.value ="Ok"; document.getElementById("tzolkinimg").innerHTML= '<img src="Ok.gif" width="64px">';} else if (yb==11) {date.tzolkin.value ="Chuen"; document.getElementById("tzolkinimg").innerHTML= '<img src="http://cnbguatemala.org/wiki/Archivo:Chuen.gif" width="64px">';} else if (yb==12) {date.tzolkin.value ="Eb"; document.getElementById("tzolkinimg").innerHTML= '<img src="Eb.gif" width="64px">';} else if (yb==13) {date.tzolkin.value ="Ben"; document.getElementById("tzolkinimg").innerHTML= '<img src="Ben.gif" width="64px">';} else if (yb==14) {date.tzolkin.value ="Ix"; document.getElementById("tzolkinimg").innerHTML= '<img src="Ix.gif" width="64px">';} else if (yb==15) {date.tzolkin.value ="Men"; document.getElementById("tzolkinimg").innerHTML= '<img src="Men.gif" width="64px">';} else if (yb==16) {date.tzolkin.value ="Kib"; document.getElementById("tzolkinimg").innerHTML= '<img src="Kib.gif" width="64px">';} else if (yb==17) {date.tzolkin.value ="Kaban"; document.getElementById("tzolkinimg").innerHTML= '<img src="Kaban.gif" width="64px">';} else if (yb==18) {date.tzolkin.value ="Etz'nab"; document.getElementById("tzolkinimg").innerHTML= '<img src="Etznab.gif" width="64px">';} else if (yb==19) {date.tzolkin.value ="Kawak"; document.getElementById("tzolkinimg").innerHTML= '<img src="Kawak.gif" width="64px">';} else if (yb==0) {date.tzolkin.value ="Ajau"; document.getElementById("tzolkinimg").innerHTML= '<img src="Ahau.gif" width="64px">';}


      		ybrad = (tzolradical-haabradical-(haabkin * 7))%13
           	if(ybrad <=0) ybrad=ybrad + 13;
           	date.ybrad.value =ybrad;


}

function getjulian(year,month,day){

if (month < 3) {month += 12; year -= 1};

a = Math.floor(year/100); b = 2-a+Math.floor(a/4); j = Math.floor(365.25*(year+4716))+ Math.floor(30.6001*(month+1))+ day+b-1524;

return j;

	}
  // -->


</script>