
/* $Id: image_swap.js 225 2008-01-24 12:31:03Z ilya $ */

function ShowLargePicture(parNumber){

    document.getElementById('m_LargePictureTD').innerHTML = 'Картинка загружается...';

    if (m_LargePicturesFlags[parNumber] == 'Y') {
    	_imageCSSClass = 'tim';
    } else {
    	_imageCSSClass = 'tim_1';
    }

    var _LargePicture = "<img src='" + m_LargePictures[parNumber] + "' class='" + _imageCSSClass + "' alt='"+m_LargePicturesDescription[parNumber]+"'>"
    var _LargePictureIMG = document.createElement('Img');

    _LargePictureIMG.src = m_LargePictures[parNumber];
    _LargePictureIMG.border = 0;
    _LargePictureIMG.width = 263;
    _LargePictureIMG.height = 350;

    var _html = '<span class="ttxt">';
    for (var i = 0; i < m_LargePictures.length; i++){
            if (i > 0)
                    _html = _html + '|';
            if (i == parNumber)
                    _html = _html + '&nbsp;<b>' + (i + 1) + '</b> ';
            else
                    _html = _html + '&nbsp;<a href="" onclick="ShowLargePicture(' + i + '); return false;">' + (i + 1) + '</a> ';
    }
    _html = _html + '</span>';
    document.getElementById ('m_OtherPicturesLinks').innerHTML = _html;
    _html = _LargePictureIMG.outerHTML;

    if (m_LargePictures.length == 1)
            _html = _LargePicture;
    else{
        _LargePictureIMG.alt = 'Следующая картинка';
        if (parNumber == m_LargePictures.length - 1)
                _html = '<a href="" onclick="ShowLargePicture(' + (parNumber + 1 - m_LargePictures.length) + '); return false;">' + _LargePicture + '</a>';
        else
                _html = '<a href="" onclick="ShowLargePicture(' + (parNumber + 1) + '); return false;">' + _LargePicture + '</a>';
    }

    document.getElementById('m_LargePictureTD').innerHTML = _html;
}


