Ok im confused...
I have four buttons that all have alternative rollover images and all redirect to a new page onClick. I used Javascipt to do this as usual.
eg:
<a href="javascript:;" onClick="MM_goToURL('parent','post.php?mode=new&forum=general&postid=1');return document.MM_returnValue" onMouseOver="MM_swapImage('Image1','','../gfx/newthreadbutton_over.jpg',1)" onMouseOut="MM_swapImgRestore()"><img src="../gfx/newthreadbutton.jpg" name="Image1" width="92" height="25" border="0" id="Image1"></a>
The thing is that what buttons are shown is dependent on certain conditions so I have put the code for each button into a variable (preceeding all the double quotes with backslashes) and then use a PHP If block to see which ones are needed. Then I use echo statements to output the code stored in the variables.
But the rollover images no longer appear. The onClick event still works fine but the images don't swap. If I 'view source' in the browser I can see that the code generated is correct. I have even copied and pasted it onto a blank webpage to test it and it works perfectly?!!
Can't understand this at all! Anyone know why?
Hope I've explained that clearly enuff.