Awesome implementation. Thanks for doing that.
I needed this to work with 4.0 on one site so here's the only modifications I had to do to make to gb_productpage.tpl work with 4.0 branches:
replaced {lng.lbl_click_to_enlarge} with 'enlarge' - you could also add the lang variable if you wish.
replaced the second image href from 4.1 version to 4.0 version.
changed 'http://xcart/skin1/greybox/files/' to '{$SkinDir}/greybox/files/ - stops the 'unsecure page elements' warning in IE if your site uses http & https.
Here's the adapted gb_productpage.tpl - replace the one supplied in the 4.1 zip above to this and your 4.0 site will have a working greybox mod...
Code:
{if $images ne ""}
{section name=image loop=$images}
{if $images[image].avail eq "Y"}
{if $images[image].tmbn_url}
<div style="display:{cycle values="block,none,none,none,none,none"};">
<a href="{$images[image].tmbn_url}" title=" {$images[image].alt|escape}" rel="gb_imageset[detailed]">enlarge</a>
</div>
{else}
<div style="display:{cycle values="block,none,none,none,none,none"};">
<a href="{$xcart_web_dir}/product_image.php?imageid={$images[image].imageid}" title="{$images[image].alt|escape}" rel="gb_imageset[detailed]">enlarge</a> </div>
{/if}
{/if}
{/section}
<script type="text/javascript">
var GB_ROOT_DIR = "{$SkinDir}/greybox/files/";
</script>
<script type="text/javascript" src="{$SkinDir}/greybox/files/AJS.js"></script>
<script type="text/javascript" src="{$SkinDir}/greybox/files/AJS_fx.js"></script>
<script type="text/javascript" src="{$SkinDir}/greybox/files/gb_scripts.js"></script>
<link href="{$SkinDir}/greybox/files/gb_styles.css" rel="stylesheet" type="text/css" />
{/if}