auto debug or non phone mode detection in document ready function