I am also on H1B. After we get the job offer from the new employer, it takes 2-3 weeks to switch. The employer takes care of the formalities. It also gives us time for the usual 2-week notice to the older employer.
I agree with gopalakrishnans about the time taken. However, it is safer to give notice after the H1B transfer gets approved.