E ovviamente "partegiorno" sarà così:

codice:
var partegiorno = today.getHours() > 11 ? "pm" : "am";