Option to set initial expanded/collapsed state

Modified the readState() function to detect expanded/collapsed state on initialization when cookies are NOT used.