Just ask the new employer to file an H1 transfer petition for you and you have no problem to get it approved. If you have lost your job for a while, you had better ask your employer to use Premium Processing to get the petition approved within 15 days and you can work after the transfer petition is approved.