Non esiste l'istruzione end if in javascript... e' sufficiente la graffa chiusa.

ciao