Though it may seem hopeless now, it can work. You don't have to loose your job. There is a family medical leave act that allows you to take up to 12 weeks unpaid leave without jeopardizing your job. If you have vacation/sick/personal time to use, use it to get well. The facility you detox at will have counselors, social workers to help you with this. You may not need to be inpatient for very long, but you won't know until you go and ask.
Since we don't know your particular circumstance we can only give you general answers. You need to do some of the work yourself. Believe it or not that is part of therapy. Keeping active in things other than what you normally do when using is a great diversion to using. Have you been to an NA meeting? If not, go tonight, tomorrow, whenever you can find a meeting in your area. It is evident you want help or you wouldn't be on SR, but this isn't a fix, it is only an aid to your recovery.
Please give us a wonderful gift and check into detox ASAP. You won't be sorry.