var selectedImageInd = 1;
var prevSelectedImageInd = 1;
//var currThumbBW =

function onThumbClick(thumbInd){
    var thumb_bw = document.getElementById('thumb_bw_'+thumbInd);
    var thumb_color = document.getElementById('thumb_color_'+thumbInd);
    //restore bw for the currently selected thumb
    
    var currThumb_bw = document.getElementById('thumb_bw_'+selectedImageInd);
    var currThumb_color = document.getElementById('thumb_color_'+selectedImageInd);
    
    var curProductImage = document.getElementById('product_image_'+selectedImageInd);
    var newProductImage = document.getElementById('product_image_'+thumbInd);
    
    var curImageDescr = document.getElementById('product_image_descr_'+selectedImageInd);
    var newImageDescr = document.getElementById('product_image_descr_'+thumbInd);
    
    curProductImage.className = 'invisible';
    newProductImage.className = 'visible';
    curImageDescr.className = 'product-image-text invisible';
    newImageDescr.className = 'product-image-text visible';
    
    currThumb_bw.className = 'visible';
    currThumb_color.className = 'invisible';
    
    selectedImageInd = thumbInd;

    thumb_bw.className = 'invisible';
    thumb_color.className = 'visible';
}

function showImage(imgInd){
    
    var curImageContainer = document.getElementById('product_image_'+selectedImageInd);
    var newImageContainer = document.getElementById('product_image_'+imgInd);
    
    curImageContainer.className = 'product-description invisible';
    newImageContainer.className = 'product-description visible';
    
    selectedImageInd = imgInd;
}