1/**
2 * Title: gallery-lightbox
3 *
4 * Description: Provides the lightbox for the gallery images
5 *
6 * Please do not edit this file. This file is part of the Cyber Chimps Framework and all modifications
7 * should be made in a child theme.
8 *
9 * @category Cyber Chimps Framework
10 * @package  Framework
11 * @since    1.0
12 * @author   CyberChimps
13 * @license  http://www.opensource.org/licenses/gpl-license.php GPL v3.0 (or later)
14 * @link     http://www.cyberchimps.com/
15 */
16
17jQuery(document).ready(function () {
18
19	jQuery('.gallery-icon a').each(function () {
20
21		var source = jQuery(this).children().attr('src');
22		var startIndex = source.lastIndexOf('-');
23		var endIndex = source.lastIndexOf('.');
24		var removeValue = source.substring(startIndex, endIndex);
25		var newSource = source.replace(removeValue, '');
26
27		jQuery(this).attr('rel', 'cyberchimps-lightbox');
28		jQuery(this).attr('href', newSource);
29
30	});
31
32});