Thanks for that Marc, however the site is a hybrid of a content
management system and my templates. The invalid code is produced by
the content management system which I have no control over.
Thanks everyone for all of your help, I am not going to rest until I
get this fixed..