it doesn't seem to be a javascript issue. I tried to be carefull with the paths to the js libraries which in case of Joomla! have necessarily to be changed.
I looked more deeply inside my code and it seems that is just a matter of the CSS style sheet. Are this style sheets coded specifically for using just as the home page says?, I noticed that they use absolute positioning, and may be they are using wrong positions for my template.
This is the code that I'm using, it's quite extensive, but I hope it helps (getfolders.php is correctly included - with a require_once() - : at the beginning of the script):
function showGallery($abspath)
{
global $mainframe;
?>
<style>
img {
border:none;
}
</style>
<?php
$mainframe->addCustomHeadTag('<link rel="stylesheet" type="text/css"'
.' href="components/com_e2gallery/e2/css/e2.css" title="default">');
$mainframe->addCustomHeadTag(
'<link rel="alternate stylesheet" type="text/css"'
.' href="components/com_e2gallery/e2/css/e2photo_lightgray.css" title="lightgray">'
);
$mainframe->addCustomHeadTag(
'<link rel="alternate stylesheet" type="text/css" '
.' href="components/com_e2gallery/e2/css/e2photo_gray.css" title="gray">'
);
$mainframe->addCustomHeadTag(
'<link rel="alternate stylesheet" type="text/css" '
.' href="components/com_e2gallery/e2/css/e2photo_black.css" title="black">'
);
$mainframe->addCustomHeadTag(
'<link rel="alternate stylesheet" type="text/css" '
.' href="components/com_e2gallery/e2/css/e2photo.css" title="none">'
);
$transitionspeed = 150;
$fadespeed = 600;
$thumbpath = $abspath.'/thumbs';
?>
<script type="text/javascript" src="components/com_e2gallery/e2/js/mootools.v1.11.js">
</script>
<script type="text/javascript">
var transspeed=<?php echo $transitionspeed;?>;
var fadespeed=<?php echo $fadespeed;?>;
</script>
<script type="text/javascript" src="components/com_e2gallery/e2/js/e2photo.js">
</script>
<script type="text/javascript" src="components/com_e2gallery/e2/js/styleswitcher.js">
</script>
<script type="text/JavaScript">
<?php getImages($abspath, 'tempgallery'); ?>
var firstimagewidth=currentwidth;
var firstimageheight=currentheight;
var thumbnailnum = <?php echo count(scandir($thumbpath)); ?>;
var maxthumbvisible = 10;
</script>
<script type="text/javascript" src="components/com_e2gallery/e2/js/e2photo2.js">
</script>
<div class="e2_photo_gallery">
<div class="hd">
<div class="c"></div>
</div>
<div class="bd">
<div class="c">
<div class="s">
<div id="gallery" align="center">
<!--Main Image Here-->
<div id="main_image_wrapper">
<div id="iptc_btn"></div>
<?php getfirstimage($abspath, "tempgallery"); ?>
<div id="pn_overlay"> <a href='javascript:previmage(current_imgid);' id='prev' class=".toolTip" tooltitle="Previous Image" ></a> <a href='javascript:nextimage(current_imgid);' id='next' tooltitle="Next Image"></a> </div>
</div>
<div align="center" class="spacing"> </div>
<!--End Main Image-->
<div id="thumbdisplay">
<div align="center" id="photocount">
<script type="text/javascript">document.write("1 of "+tempgallery.length+" Photos");</script>
</div>
<div id="thumbtoggler"> <a href="#" onclick="setActiveStyleSheet('none'); return false;"> <img src="components/com_e2gallery/e2/rsrc/none.gif" alt="Minimalistic" class="toolTips"
title="Minimalistic::Click to Display Simple Design Version" /> </a> <a href="#" onclick="setActiveStyleSheet('lightgray'); return false;"> <img src="components/com_e2gallery/e2/rsrc/lightgray.gif" class="toolTips"
title="Light Gray Design::Click to Display Light Gray Design Version"
alt="Light Gray Design" /> </a> <a href="#" onclick="setActiveStyleSheet('gray'); return false;"> <img src="components/com_e2gallery/e2/rsrc/gray.gif" class="toolTips"
title="Dark Gray Design::Click to Display Dark Gray Design Version"
alt="Dark Gray Design" /> </a> <a href="#" onclick="setActiveStyleSheet('black'); return false;"> <img src="components/com_e2gallery/e2/rsrc/black.gif" class="toolTips"
title="Black Design::Click to Display Black Design Version"
alt="Black Design" /> </a> <a href="#" onclick="setActiveStyleSheet('default'); return false;"> <img src="components/com_e2gallery/e2/rsrc/e2.gif" class="toolTips"
title="(E)2 Design::Click to Display (E)2 Design Design Version" alt="(E)2 Design" /> </a> <img src='components/com_e2gallery/e2/rsrc/info_btn.gif' onclick='loadinfo();' border="0"
class="toolTips" title="Show IPTC Info::Click to Display IPTC Info" alt="Show IPTC Info" /> <a href="javascript:thumbs();" ><img src="components/com_e2gallery/e2/rsrc/thumbgallery.gif"
border="0" class="toolTips" title="Toggle Thumbnails::Click to Toggle Thumbnails"
alt="Toggle Thumbnails" /> </a> </div>
<div class="clear"></div>
</div>
<div align="center" class="spacing"> </div>
<div id="thumbhide">
<div id="thumbbox">
<div id="thumb_container">
<div id="thumbgall">
<div id="thumbs">
<div id="widthbox">
<?php getthumbnailimages($abspath, 'tempgallery', $thumbpath); ?>
</div>
</div>
</div>
</div>
<div id="back">
<script type="text/javascript">if(thumbnailnum>maxthumbvisible){document.write("<div id='leftmore'><ul><li><a href=\"javascript:checkbutton(addposition('minus'));movethumbs('plus');\"><img src='components/com_e2gallery/e2/rsrc/buttonblank.gif' width='15' height='115' border='0' /></a></li></ul></div>");}</script>
</div>
<div id="more">
<script type="text/javascript">if(thumbnailnum>maxthumbvisible){document.write("<div id='rightmore'><ul><li><a href=\"javascript:checkbutton(addposition('plus'));movethumbs('minus');\"><img src='components/com_e2gallery/e2/rsrc/buttonblank.gif' width='15' height='115' border='0' /></a></li></ul></div>");}</script>
</div>
</div>
</div>
<div align="center" class="spacing"> </div>
<div id="imgtitle"></div>
</div>
</div>
</div>
</div>
</div>
<?php
}