Simple Javascript Type Detection