dom independent javascipt object validator