You have several options:
1. Suspend the job hunt until your medical issue is resolved.
This is tough if you don't have cash reserves. You may have to seek help from friends, family and religious organizations to pull this off.
2. Put off the surgery until you secure a new position, with full disclosure to your potential employer during the interview process
Wait until you are actually interviewing to reveal this. This will likely close several doors for you. While an employer might appreciate your honesty, it's just as likely, if not more so, that they will pass on you for someone who they will not have to accommodate. Though tough, this may be the best option because your new employer will not be surprised when you suddenly have to take off.
3. Put off your surgery until you secure a position and tell the employer after you get the job.
I would strongly recommend against doing this. Yes, you'll be able to get the surgery and have a job, but your employer will feel like you pulled a fast one. They'll be right. If you take this option, start job hunting again immediately. They may or may not give you the boot, but even if they don't, you won't be trusted.
IMO, pick #1 if you can afford it, #2 if you can't.