$(document).ready(function() {

    $('img.lightbox').each(function(i){
          var a = document.createElement("a");
          $(a).attr('title', $(this).attr('title'));
          $(a).attr('href', $(this).attr('src'));  
          $(a).attr('rel', 'lightbox');
          $(this).removeClass('lightbox');          
          $(this).wrap(a);
    });
      
   var lang = $('#active_lang').val();

   if(lang == 'en') {
   $('a[rel=lightbox]').lightBox({
			overlayBgColor: 		'#000',
			overlayOpacity:			0.8,
			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
			imageLoading:			'images/lightbox/lightbox-ico-loading.gif',
			imageBtnPrev:			'images/lightbox/thumbsBackHover.gif',
			imageBtnNext:			'images/lightbox/thumbsForwardHover.gif',
			imageBtnClose:		'images/lightbox/lightbox-btn-close-en.gif',
			imageBlank:				'images/lightbox/lightbox-blank.gif',
			// Configuration related to container image box
			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			txtImage:				'Image',	// (string) Specify text "Image"
			txtOf:					' / ',		// (string) Specify text "of"
			// Configuration related to keyboard navigation
			keyToClose:				's',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
			keyToPrev:				'e',		// (string) (p = previous) Letter to show the previous image
			keyToNext:				'j'		// (string) (n = next) Letter to show the next image.
   });
   } else if(lang == 'ru') {
   $('a[rel=lightbox]').lightBox({
			overlayBgColor: 		'#000',
			overlayOpacity:			0.8,
			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
			imageLoading:			'images/lightbox/lightbox-ico-loading.gif',
			imageBtnPrev:			'images/lightbox/thumbsBackHover.gif',
			imageBtnNext:			'images/lightbox/thumbsForwardHover.gif',
			imageBtnClose:		'images/lightbox/lightbox-btn-close-ru.gif',
			imageBlank:				'images/lightbox/lightbox-blank.gif',
			// Configuration related to container image box
			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			txtImage:				'Изображение',	// (string) Specify text "Image"
			txtOf:					' / ',		// (string) Specify text "of"
			// Configuration related to keyboard navigation
			keyToClose:				's',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
			keyToPrev:				'e',		// (string) (p = previous) Letter to show the previous image
			keyToNext:				'j'		// (string) (n = next) Letter to show the next image.
   });
   } else {
   $('a[rel=lightbox]').lightBox({
			overlayBgColor: 		'#000',
			overlayOpacity:			0.8,
			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
			imageLoading:			'images/lightbox/lightbox-ico-loading.gif',
			imageBtnPrev:			'images/lightbox/thumbsBackHover.gif',
			imageBtnNext:			'images/lightbox/thumbsForwardHover.gif',
			imageBtnClose:		'images/lightbox/lightbox-btn-close.gif',
			imageBlank:				'images/lightbox/lightbox-blank.gif',
			// Configuration related to container image box
			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			txtImage:				'Pilt',	// (string) Specify text "Image"
			txtOf:					' / ',		// (string) Specify text "of"
			// Configuration related to keyboard navigation
			keyToClose:				's',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
			keyToPrev:				'e',		// (string) (p = previous) Letter to show the previous image
			keyToNext:				'j'		// (string) (n = next) Letter to show the next image.
   });
   }
});

