fixed the problem, {$ImgDir} is working fine... have to say xsl + javascript make quite a good team when they get going. thankyou everyone!