Hey Hopefull,
Dwelling on fantasies is very dangerous because you will feel lustful and be tempted to develop them by seeking out pornography. Once porn comes into the picture, it's almost impossible to resist the desire to masturbate.
You need to push out these bad thoughts and prevent them from pulling you to places that you don't want to be. I find doing 20-60 press ups when the urge burns fiercely manages to douse the flames of lust. Also, think of the consequences every time you want to masturbate or look at porn.
Go for a walk, listen to music, phone a friend- in short do anything rather than indulging in porn and masturbation. Ok, you may lose precious work time by exercising/doing something else rather than working, but the net result is still far better than losing energy by wasting seed. Trust me, you'll waste a lot more time by looking at porn and then recovering from a fall than by avoiding it in the first place.
Just do the right thing for today!
KUTGW and keep on trucking,
DesertLion