function compute(DD,MM,YY) {

	/*
    DD=eval(form.dia.value)

    MM=eval(form.mes.value)

    YY=eval(form.any.value)
	
	LG=eval(form.lond.value)

    LM=eval(form.lonm.value)

    LS=eval(form.lons.value)

    BG=eval(form.latd.value)

    BM=eval(form.latm.value)

    BS=eval(form.lats.value)
	*/

    LG=0;

    LM=21;

    LS=5;

    BG=39;

    BM=27;

    BS=19;



    with (Math) {

     <!--longitud i latitud amb correcció de negatius-->

        Lon=LG+LM/60+LS/3600

	  if (LG < 0) Lon=LG-LM/60-LS/3600;

        Lat=BG+BM/60+BS/3600

        if (BG < 0) Lat=BG-BM/60-BS/3600;

     <!--dia julià-->  

        GGG = 1;

        if (YY <= 1585) GGG = 0;

        JD = -1 * floor(7 * (floor((MM + 9) / 12) + YY) / 4);

        S = 1;

        if ((MM - 9)<0) S=-1;

        A = abs(MM - 9);

        J1 = floor(YY + S * floor(A / 7));

        J1 = -1 * floor((floor(J1 / 100) + 1) * 3 / 4);

        JD = JD + floor(275 * MM / 9) + DD + (GGG * J1);

        JD = JD + 1721027 + 2 * GGG + 367 * YY - 0.5;

        J2=JD;

      

      <!--programet-->

	RAD=180/PI

	ET=0.016718;

	VP=8.22E-5

	P=4.93204

	M0=2.12344

	MN=1.72019E-2

	T0=2444000.5

	S=2415020.5

	P=P+(J2-T0)*VP/100

	AM=M0+MN*(J2-T0)

	AM=AM-2*PI*floor(AM/(2 * PI))

	V=AM+2*ET*sin(AM)+1.25*ET*ET*sin(2*AM);

	if (V<0) {

		V=2*PI+V

		}

	L=P+V

	L=L-2*PI*floor(L/(2*PI))

	Z=(J2-2415020.5)/365.2422

	OB=23.452294-(0.46845*Z+0.00000059*Z*Z)/3600

	OB = OB/RAD

	DC=asin(sin(OB)*sin(L))

	AR=acos(cos(L)/cos(DC))

	if (L>PI) {

		AR=2*PI-AR

		}

	OB=OB*RAD

        L=L*RAD

	

	AR = AR * 12 / PI;

	DC=DC*RAD

    	MR = 0.04301;


	F=13750.987;


	C=2*ET*F*sin(AM)+1.25*ET*ET*F*sin(2*AM);


	R=-MR*F*sin(2*(P+AM))+MR*MR*F*sin(4*(P+AM))/2;

        ET=C+R

	<!--arc semidiurn-->

	   H0=acos(-tan(Lat/RAD)*tan(DC/RAD))

	   H0=H0*RAD

	<!--variació en declinació-->

	   VD=0.9856*sin(OB/RAD)*cos(L/RAD)/cos(DC/RAD)

	<!--sortida-->

           VDOR=VD*(-H0+180)/360

           DCOR=DC+VDOR

           HORTO=-acos(-tan(Lat/RAD)*tan(DCOR/RAD))

           VHORTO=5/(6*cos(Lat/RAD)*cos(DCOR/RAD)*sin(HORTO))

           HORTO=(HORTO*RAD+VHORTO)/15

           TUORTO=HORTO+ET/3600-Lon/15+12


        <!--conversio a h i m de la sortida-->

	   HOR=floor(TUORTO);

	   MOR=floor((TUORTO - HOR) * 60+0.5)

	   if (MOR>59) {

		MOR=MOR-60;

		HOR=HOR+1;

		}


        <!--culminació-->

           TUC=12+ET/3600-Lon/15

       <!--conversió a h i m de la culminació-->

	   HC=floor(TUC);

	   MC=floor((TUC - HC) * 60+0.5)

	   if (MC>59) {

		MC=MC-60;

		HC=HC+1;

		}

	<!--posta-->

           VDOC=VD*(H0+180)/360

           DCOC=DC+VDOC

           HOC=acos(-tan(Lat/RAD)*tan(DCOC/RAD))

           VHOC=5/(6*cos(Lat/RAD)*cos(DCOC/RAD)*sin(HOC))

           HOC=(HOC*RAD+VHOC)/15

           TUOC=HOC+ET/3600-Lon/15+12

        <!--conversió a h i m de la posta-->

	   HOC=floor(TUOC);

	   MOC=floor((TUOC - HOC) * 60+0.5)

	   if (MOC>59) {

		MOC=MOC-60;

		HOC=HOC+1;

		}


        <!--alcada de la culminació-->

           HCUL=90-Lat+(DCOR+DCOC)/2

        <!--conversió a º i ' de la alcada-->

	   GCUL=floor(HCUL);

	   MCUL=floor((HCUL - GCUL) * 60+0.5)
	   
	   if (MCUL>59) {

		MCUL=MCUL-60;

		HCUL=HCUL+1;

		}


        <!--azimuts-->

           ACOC=acos(-sin(DCOC/RAD)/cos(Lat/RAD))*RAD

           ACOR=360-acos(-sin(DCOR/RAD)/cos(Lat/RAD))*RAD

        <!--conversió a º i ' dels azimuts-->

	   GACOC=floor(ACOC);

	   MACOC=floor((ACOC - GACOC) * 60+0.5)

	   if (MACOC>59) {

		MACOC=MACOC-60;

		GACOC=GACOC+1;

		}


           GACOR=floor(ACOR);

	   MACOR=floor((ACOR - GACOR) * 60+0.5)

	    if (MACOR>59) {

		MACOR=MACOR-60;

		GACOR=GACOR+1;

		}

    }
	
	var horasalida=HOR+":"+MOR;
	var horapuesta=HOC+":"+MOC;
	var result=new Array(horasalida, horapuesta);
	document.getElementById('salida').innerHTML = horasalida;
    document.getElementById('puesta').innerHTML = horapuesta;
	/*
    form.ortoh.value=HOR;

    form.ortom.value=MOR;

    form.ocasoh.value=HOC;

    form.ocasom.value=MOC;

    form.culmih.value=HC;

    form.culmim.value=MC;

    form.alculmig.value=GCUL;

    form.alculmim.value=MCUL;

    form.acortog.value=GACOR;

    form.acortom.value=MACOR;

    form.acocasog.value=GACOC;

    form.acocasom.value=MACOC;
	*/

}