1/* DOKUWIKI:include_once lightGallery/js/lightgallery.min.js */
2/* DOKUWIKI:include_once lightGallery/js/picturefill.min.js */
3/* DOKUWIKI:include_once lightGallery/js/lg-fullscreen.min.js */
4/* DOKUWIKI:include_once lightGallery/js/lg-thumbnail.min.js */
5/* DOKUWIKI:include_once lightGallery/js/lg-video.min.js */
6/* DOKUWIKI:include_once lightGallery/js/lg-autoplay.min.js */
7/* DOKUWIKI:include_once lightGallery/js/lg-zoom.min.js */
8/* !DOKUWIKI:include_once lightGallery/js/lg-hash.min.js */
9/* !DOKUWIKI:include_once lightGallery/js/lg-pager.min.js */
10/* DOKUWIKI:include_once lightGallery/js/jquery.mousewheel.min.js */
11
12/**
13 * Initialize lightGallery for pg-show class
14 */
15function InitPgGallery(tw,th,play){
16		jQuery("ul.pg-show").lightGallery({
17				thumbnail:true,
18				autoplay:play,
19				showAfterLoad:true,
20				pause:4000,
21				preload:1,
22				mode:"lg-fade",
23				thumbWidth:tw,
24				thumbContHeight:th
25		});
26    return false;
27}
28
29//		alert("Sono qui");
30
31/**
32 * Attach click event to the poster <a> tag
33   Runs when the DOM is ready
34 */
35jQuery(document).on('click', 'a.pg-start', function() {
36	var $pgid = '#' + jQuery(this).data('pg-id');
37	var $pg = jQuery($pgid);
38	var $img = $pg.children('li').children('img');
39//			alert("ID= " + $img.attr('src'));
40	$img.trigger("click");
41	return false;
42});
43
44// /**
45 // * Attach click event to the poster <a> tag
46	 // Runs when complete page is fully loaded, including all frames, objects and images
47 // */
48// jQuery(window).load(function(){
49	// // Trigger thumbnails preload
50	// jQuery('img.pg-preload').each(function(index) {
51		// jQuery(this).attr('src', jQuery(this).data('src'));
52	// });
53	// //alert("ok window");
54	// // Trigger images preload
55	// // jQuery('ul.pg-show').each(function(index) {
56			// // var $li = jQuery(this).children('li').first().data('src');
57			// // //jQuery('<img src="'.$li.'"/>');
58// // //					jQuery(this).attr('src', jQuery(this).data('src'));
59	// // });
60// });
61
62//		jQuery("img.lazy").lazyload();
63