Thank you all for your help. Someone has pointed out the problem to me now - as suspected, the code itself is fine, but the server was having a tizzy-fit over been asked to display some CSS from within the HTML. QUite why this meant a 30secon delay is unclear but I've removed the CSS now.