﻿$(document).ready(function(){

$(function(){
  $.Lightbox.construct({
    download_link: false,
    ie6_upgrade: false, 
    show_linkback:false,
    show_extended_info: true  
  });
});

$('#productImageThumbs').css('display','block');
$('#productImage a').css('display','block').css('visibility','hidden'); 
$('#productImage a:first').css('visibility','visible'); 
$('#productImage a').css('position','absolute').css('top','0').css('left','0');

thumbMaxHeight = 0; 
$('#productImageThumbs img').each(function() {
 var thisHeight = $(this).height();
 if (thisHeight > thumbMaxHeight) { thumbMaxHeight = thisHeight; }
});
$('#productImageThumbs').css('height',thumbMaxHeight + 'px'); 

productMaxHeight = 0; 
$('#productImage img').each(function() {
 var thisHeight = $(this).height();
 if (thisHeight > productMaxHeight) { productMaxHeight = thisHeight; }
});
$('#productImage').css('height',productMaxHeight + 'px');

 
$('#productImageThumbs a').mouseover(function() {
/* we need to reset all to hidden */
$('#productImage a').css('visibility','hidden'); 
/* then we show the new image */
var thisName = $(this).attr('name');
$('#productImage a[name = ' + thisName + ']').css('visibility','visible'); 
});

});

