You have the setInterval(hourofday, 6000); function call INSIDE the hourofday() function definition! This means that it will infinitely recurse, calling itself until your computer runs out of memory.
Just move the setInterval(...) statements OUTSIDE of the function definitions.