Refactor js

Move hiding function for wp7 z-index bug