Fixed jQuery issues and successfully aligned div for dialog