PageSourceSearch

https://lindiandruss.com/wp-content/plugins/go_portfolio/assets/js/go_portfolio_scripts.js?ver=1.7.2

js lindiandruss.com collected 2026-10-09 17:31:55 UTC 55,598 bytes, 1,436 lines download raw bytes

1/* -------------------------------------------------------------------------------- /
2
3	Plugin Name: Go Portfolio - WordPress Responsive Portfolio
4	Author: Granth
5	Version: 1.7.2
6
7	+----------------------------------------------------+
8		TABLE OF CONTENTS
9	+----------------------------------------------------+
10
11    [1] SETUP
12	[2]	AJAX PAGINATION
13	[2.1] LOAD MORE
14    [3] SLIDER
15    [4] POPUP
16    [5] ISOTOPE 
17    [6] EFFECTS
18	[7] DEEP LINKING		
19    [8] OTHERS
20
21/ -------------------------------------------------------------------------------- */
22
23;(function ($, undefined) {
24	"use strict";
25	
26	window.gopojQ = $;
27	
28	$(function () {
29
30	/* -------------------------------------------------------------------------------- /
31		[1]	SETUP
32	/ -------------------------------------------------------------------------------- */
33		
34		/* Detect IE & Chrome */
35		var isIE = document.documentMode != undefined && document.documentMode >5 ? document.documentMode : false,
36			isChrome = !!window.chrome && !!window.chrome.webstore;
37	
38		/* Detect touch devices */
39		function isTouchDevice() { return 'ontouchstart' in window || navigator.msMaxTouchPoints; };
40		var isTouchDevice = isTouchDevice();
41		
42		/* Detect orintationchange */
43		function supportsOrientationchange() { return 'onorientationchange' in window };
44		var supportsOrientationchange = supportsOrientationchange();
45		
46		/* Detect CSS transition support */
47		function supportsTransitions() {
48			var s = document.createElement('p').style;
49		    return 'transition' in s || 'WebkitTransition' in s || 'MozTransition' in s || 'msTransition' in s || 'OTransition' in s;		
50		}
51		var supportsTransitions = supportsTransitions();
52		
53		/* Detect retina screens */
54		function isRetina() {
55			var retinaMediaQuery = '(-webkit-min-device-pixel-ratio: 2),(min--moz-device-pixel-ratio: 2),(-o-min-device-pixel-ratio: 2/1),(min-device-pixel-ratio: 2),(min-resolution: 2dppx)';
56			if (window.matchMedia && window.matchMedia(retinaMediaQuery).matches) {
57				return true;
58			} else {
59				return false;
60			};
61		};
62		
63		var isRetina = isRetina(),
64			retinaImageList = [];
65		
66		function loadRetinaImages() {
67			var $retinaReadyImages = $portfolio.find('.gw-gopf-retina'),
68				retinaReadyImageList = [];
69							
70			$retinaReadyImages.each(function(index, element) {
71				retinaReadyImageList.push(this.src);
72			});
73			
74			retinaReadyImageList = $.grep(retinaReadyImageList, function(v, k){
75				return $.inArray(v ,retinaReadyImageList) === k;
76			});
77			
78			var ImgsLoadedInterval = setInterval(function(){
79				$retinaReadyImages.filter(':not(.gw-gopf-loaded)').each(function(index, element) {
80					if (this.naturalWidth>0) {
81						$(this).addClass('gw-gopf-loaded');
82						this.style.width=this.naturalWidth+'px';
83						this.style.height=this.naturalHeight+'px';
84					};
85				});
86				if (!$retinaReadyImages.filter(':not(.gw-gopf-loaded)').length) { 
87					clearInterval(ImgsLoadedInterval);
88					for (var x=0;x<retinaReadyImageList.length;x++) {
89						var RetinaImageFileName=retinaReadyImageList[x].substr(0,retinaReadyImageList[x].lastIndexOf('.')),
90							RetinaImageFileExt=retinaReadyImageList[x].substr(retinaReadyImageList[x].lastIndexOf('.'));
91						
92						if ($.inArray(RetinaImageFileName+'@2x'+RetinaImageFileExt ,retinaImageList)>-1) { 
93							retinaImageList.push(RetinaImageFileName+'@2x'+RetinaImageFileExt);
94							$retinaReadyImages.each(function(index, element) {
95								$(this).removeClass('gw-gopf-retina');
96								if (this.src==RetinaImageFileName+RetinaImageFileExt) {
97									this.src=RetinaImageFileName+'@2x'+RetinaImageFileExt;
98								};
99							});
100						} else {
101							var http = new XMLHttpRequest();
102							http.open('HEAD', RetinaImageFileName+'@2x'+RetinaImageFileExt, false);
103							http.onreadystatechange = function() {
104								if (http.readyState==4 && http.status==200) {
105									retinaImageList.push(RetinaImageFileName+'@2x'+RetinaImageFileExt);
106									$retinaReadyImages.each(function(index, element) {
107										$(this).removeClass('gw-gopf-retina');
108										if (this.src==RetinaImageFileName+RetinaImageFileExt) {
109											this.src=RetinaImageFileName+'@2x'+RetinaImageFileExt;
110										};
111									});
112								};
113							};
114							http.send();
115						};
116					};					
117				};
118			}, 100);	
119		};
120			
121		var $portfolio=$('.gw-gopf'),
122			$portfolioFilter=$portfolio.filter('.gw-gopf-grid-type').find('.gw-gopf-filter'),
123			$portfolioPosts=$portfolio.filter('.gw-gopf-grid-type').find('.gw-gopf-posts'),
124			$sliders = $portfolio.filter('.gw-gopf-slider-type').find('.gw-gopf-posts');
125
126		/* Add CSS correction for chrome */
127		//if (isChrome) $portfolio.addClass('gw-gopf-chrome');
128
129		/* Add 'gw-gopf-touch' class for touch devices */
130		if (isTouchDevice) { $portfolio.addClass('gw-gopf-touch'); };
131		
132		if (isRetina) { loadRetinaImages() };
133		
134		/* Fix iframe hover */
135		if (isIE) { 
136			$portfolio.find('.gw-gopf-post iframe').delegate(this, 'mouseenter mouseleave', function (event) {
137				var $this = $(this);
138				if (event.type == 'mouseenter') {
139					$this.closest('.gw-gopf-post').trigger('mouseenter').addClass('gw-gopf-current');
140					$this.closest('.gw-gopf-col-wrap').css('zIndex',3);
141				} else {
142					/* This is not required, just in case
143					$this.closest('.gw-gopf-post').trigger('mouseleave').removeClass('gw-gopf-current');
144					$this.closest('.gw-gopf-col-wrap').css('zIndex',2);*/
145				};
146			});
147		};		
148				
149		/* Add show wrappers in sliders */
150		$portfolio.filter('.gw-gopf-slider-type').find('.gw-gopf-col-wrap').css({'display' : 'block', 'visibility' : 'visible' });
151
152
153	/* -------------------------------------------------------------------------------- /
154		[2]	AJAX PAGINATION
155	/ -------------------------------------------------------------------------------- */
156
157	/* -------------------------------------------------------------------------------- /
158		[2.1] LOAD MORE
159	/ -------------------------------------------------------------------------------- */
160		
161		
162		$portfolio.on('click', '.gw-gopf-pagination-load-more:not(.gw-gopf-disabled)', function() {
163			var $this=$(this),
164				$wrapper = $this.closest('.gw-gopf-pagination-wrapper'),
165				$currentPortfolio = $this.closest('.gw-gopf');
166				$wrapper.data('current-page', $wrapper.data('current-page')+1);
167			$.ajax({  
168				type: 'post', 
169				url: gw_go_portfolio_settings.ajaxurl,
170				data: $.param({ 
171					action : 'go_portfolio_ajax_load_portfolio', 
172					portfolio_id : $currentPortfolio.parent().attr('id').split('gw_go_portfolio_')[1],
173					current_page : $wrapper.data('current-page'),
174					current_id : $wrapper.data('current-id'),
175					loaded_ids : $wrapper.data('loaded'),
176					taxonomy : $wrapper.data('tax'),
177					term_slug : $wrapper.data('term'),
178					post_per_page : $wrapper.data('posts-per-page')
179				}),
180				beforeSend: function () {
181					$this.html($this.data('modified'));
182					$this.addClass('gw-gopf-disabled');
183				}
184			}).always(function() {
185				$this.html($this.data('original'));
186				$this.removeClass('gw-gopf-disabled');
187				if (parseInt($wrapper.data('current-page')) == parseInt($wrapper.data('pages'))) { 
188					$wrapper.stop().fadeTo(550, 0, function() { 
189						$wrapper.stop().slideUp(); 
190					});
191				};
192			}).fail(function(jqXHR, textStatus) {
193				//if (textStatus!='abort') { alert('Ajax error!'); };
194			}).done(function(data) {
195				var $ajaxResponse=$('<div />', { 'class':'ajax-response', 'html' : data }),
196					$ajaxResult=$ajaxResponse.find('.gw-gopf-posts'),
197					$newPosts=$ajaxResponse.find('.gw-gopf-col-wrap'),
198					newPostsLength=$newPosts.length;
199					var currentPostsIds = ($currentPortfolio.find('.gw-gopf-pagination-wrapper').data('loaded')+'').split(',');
200					currentPostsIds = $.grep(currentPostsIds,function(n){ return(n) });						
201					if ($ajaxResponse.find('.gw-gopf-pagination-wrapper').length) {
202						var loadedPostsIds = ($ajaxResponse.find('.gw-gopf-pagination-wrapper').data('loaded')+'').split(',');
203						loadedPostsIds = $.grep(loadedPostsIds,function(n){ return(n) });
204						$currentPortfolio.find('.gw-gopf-pagination-wrapper').data('loaded', loadedPostsIds.concat(currentPostsIds).join(','));
205					}
206					var images = $newPosts.find('.gw-gopf-post-media-wrap img:not(.gw-gopf-loaded)').length;
207					var $imgelems = $newPosts.find('.gw-gopf-post-media-wrap img:not(.gw-gopf-loaded)');
208					var loaded=0;
209					var interval = setInterval(function(){
210						if (loaded==images) {
211							$currentPortfolio.removeClass('gw-gopf-isotope-ready').addClass('gw-gopf-isotope-new-added').find('.gw-gopf-posts').GWisotope( 'insert', $newPosts, function() { 
212								$currentPortfolio.addClass('gw-gopf-isotope-ready');
213								$currentPortfolio.removeClass('gw-gopf-isotope-new-added');
214								$currentPortfolio.find('.gw-gopf-cats .gw-gopf-hidden').each(function(index, element) {
215									var $this = $(this);
216									if ($newPosts.filter('[data-filter~="'+$this.data('filter')+'"]').length) { $this.removeClass('gw-gopf-hidden'); };
217								});
218								if (isRetina) { loadRetinaImages() };
219								DoMagnificPopup();
220								updatePopupGallery($currentPortfolio.data('id'));
221							});
222							var $currentFilter = $currentPortfolio.find('.gw-gopf-filter .gw-gopf-current');
223							if ($currentFilter.data('filter')!=undefined) {
224								$currentPortfolio.find('.gw-gopf-posts').GWisotope('reLayout', function(){ 
225									$currentPortfolio.find('.gw-gopf-posts').callIsotope('[data-filter~="'+$currentFilter.data('filter')+'"]');
226									setTimeout(function(){ 
227										$currentPortfolio.addClass('gw-gopf-isotope-ready');						
228									},5);
229								});
230							};
231							clearInterval(interval);							
232						} else {
233							$imgelems.filter(':not(.gw-gopf-loaded)').each(function(index, element) {
234								if (this.naturalWidth>0) {
235									$(this).addClass('gw-gopf-loaded');
236									loaded++;
237								}
238								this.onerror = function() {
239									
240									$(this).addClass('gw-gopf-loaded');
241									$(this).closest('.gw-gopf-post-media-wrap').css('display','none');
242									loaded++;
243								};								
244							});
245						}
246					}, 100);
247
248			});
249			return false;
250		});			
251				
252	/* -------------------------------------------------------------------------------- /
253		[3]	SLIDER - CarouFredSel Slider
254	/ -------------------------------------------------------------------------------- */		
255		
256		if ($.fn.carouFredSel && $sliders.length) {
257			
258			var $scrollOverlay = $('<div class="gw-gopf-posts-wrap-inner-overlay">').appendTo('.gw-gopf-posts-wrap-inner').css({
259				'position' : 'absolute',
260				'top' : 0,
261				'z-index' : '2',
262				'width' : '100%',
263				'height' : '100%',
264				'display' : 'none'
265			});			
266				
267			$sliders.each(function(index, element) {
268				var $this=$(this);
269				if ($this.closest('.gw-gopf').hasClass('gw-gopf-rtl')) {
270					$this.find('.gw-gopf-col-wrap').each(function(index, element) {
271						$(this).prependTo($this);
272					});
273				};
274				var startIndex = 0;
275				if ($this.closest('.gw-gopf').hasClass('gw-gopf-rtl')) {
276					startIndex = ($this.find('.gw-gopf-col-wrap').length-$this.data('col'))>0 ? $this.find('.gw-gopf-col-wrap').length-$this.data('col') : 0;
277				}
278				$this.addClass('gw-gopf-slider').data('sliderDefaults', {				
279					responsive : true,
280					height : 'variable',
281					width : '100%',				
282					next : {
283						button : $this.closest('.gw-gopf-posts-wrap').find('.gw-gopf-slider-controls-wrap').find('.gw-gopf-control-next'),
284						onAfter : function(data) {
285							$this.find('.gw-gopf-col-wrap').css('pointer-events','auto');
286							if ($this.css('letterSpacing')=='30px' || $this.css('letterSpacing')=='20px') {
287								var id=0;
288							} else if ($this.css('letterSpacing')=='10px') {
289								var id=$this.data('col') == 1 ? 0 : 1;
290							} else {
291								var id=$this.data('col')-1;						
292							};						
293
294							$this.closest('.gw-gopf-posts-wrap').css('overflow', 'visible');
295							var items = $this.triggerHandler('currentVisible');
296							$this.find('.gw-gopf-col-wrap').css({ 
297								'opacity' : 0,
298								'z-index' : 0,
299								'position': 'absolute',
300								'visibility' : 'hidden',
301								'left': 0						
302							}).eq(id).css({
303								'position' : 'relative',
304								'left' : '0',
305								'z-index' : 'auto'
306							});
307							items.each(function(index, element) {
308								$(element).css({ 'visibility' : 'visible', 'opacity' : 1, 'position': 'relative', 'z-index' : 'auto' });
309							});
310							$this.closest('.gw-gopf-posts-wrap-inner').find('.gw-gopf-posts-wrap-inner-overlay').hide();								
311						}
312					},
313					prev : {
314						button : $this.closest('.gw-gopf-posts-wrap').find('.gw-gopf-slider-controls-wrap').find('.gw-gopf-control-prev'),
315						onAfter : function(data) {
316							$this.find('.gw-gopf-col-wrap').css('pointer-events','auto');
317							if ($this.css('letterSpacing')=='30px' || $this.css('letterSpacing')=='20px') {
318								var id=1;
319							} else if ($this.css('letterSpacing')=='10px') {
320								var id=2;
321							} else {
322								var id=$this.data('col');						
323							};								
324							$this.closest('.gw-gopf-posts-wrap').css('overflow', 'visible');
325							var items = $this.triggerHandler('currentVisible');
326							$this.find('.gw-gopf-col-wrap').css({ 
327								'opacity' : 0,
328								'z-index' : 0,
329								'position': 'absolute',
330								'visibility' : 'hidden',
331								'left': 0
332							}).eq(id).css({
333								'position' : 'relative',
334								'left': '0',
335								'z-index' : 'auto'
336							});						
337							items.each(function(index, element) {
338								$(element).css({ 'visibility' : 'visible', 'opacity' : 1, 'position': 'relative', 'z-index' : 'auto' });
339							});	
340							$this.closest('.gw-gopf-posts-wrap-inner').find('.gw-gopf-posts-wrap-inner-overlay').hide();
341						}
342					},
343					scroll : {
344						queue : true,
345						items: 1,
346						onBefore : function(data) {
347							var items = $this.triggerHandler('currentVisible');
348							$this.find('.gw-gopf-col-wrap').css('pointer-events','none');
349							$portfolio.find('.gw-gopf-current.gw-gopf-post').removeClass('gw-gopf-current').trigger('tapOff');
350							
351							if ($this.css('letterSpacing')=='30px' || $this.css('letterSpacing')=='20px') {
352								var id=1;
353							} else if ($this.css('letterSpacing')=='10px') {
354								var id=$this.data('col') == 1 ? 1 : 2;
355							} else {
356								var id=$this.data('col');						
357							};
358
359							$this.closest('.gw-gopf-posts-wrap').css('overflow', 'hidden');
360							var items = $this.triggerHandler('currentVisible');						
361							$this.find('.gw-gopf-col-wrap').css({ 
362								'visibility' : 'hidden',
363								'position': 'relative',
364								'opacity' : 0,
365								'zIndex' :	0
366							}).eq(id).css({
367								'position' : 'absolute',
368								'left' : $this.closest('.caroufredsel_wrapper').width()+'px',
369								'z-index' : '200',
370								'visibility' : 'visible', 
371								'opacity' : 1,
372								'zIndex' : 'auto'
373							});
374							items.each(function(index, element) {
375								$(element).css({ 'visibility' : 'visible', 'opacity' : 1, 'position': 'relative', 'z-index' : 'auto' });
376							});	
377
378							$this.closest('.gw-gopf-posts-wrap-inner').find('.gw-gopf-posts-wrap-inner-overlay').show();
379							$this.trigger('resume');
380						},
381						onAfter : function(data) {
382							var direction = $this.triggerHandler('configuration', 'direction');
383							$this.find('.gw-gopf-col-wrap').css('pointer-events','auto');
384							
385							/* Scrolling left */
386							if (direction=='left') {
387								if ($this.css('letterSpacing')=='30px' || $this.css('letterSpacing')=='20px') {
388									var id=0;
389								} else if ($this.css('letterSpacing')=='10px') {
390									var id=1;
391								} else {
392									var id=$this.data('col')-1;						
393								};							
394								
395								$this.closest('.gw-gopf-posts-wrap').css('overflow', 'visible');
396								var items = $this.triggerHandler('currentVisible');
397								$this.find('.gw-gopf-col-wrap').css({ 
398									'opacity' : 0,
399									'z-index' : 0,
400									'position': 'absolute',
401									'visibility' : 'hidden',
402									'left': 0							
403								}).eq(id).css({
404									'position' : 'relative',
405									'left' : '0',
406									'z-index' : 'auto'
407								});
408								items.each(function(index, element) {
409									$(element).css({ 'visibility' : 'visible', 'opacity' : 1, 'position': 'relative', 'z-index' : 'auto' });
410								});	
411								$this.closest('.gw-gopf-posts-wrap-inner').find('.gw-gopf-posts-wrap-inner-overlay').hide();
412							}
413							
414							/* Scrolling right */
415							if (direction=='right') {
416								if ($this.css('letterSpacing')=='30px' || $this.css('letterSpacing')=='20px') {
417									var id=1;
418								} else if ($this.css('letterSpacing')=='10px') {
419									var id=2;
420								} else {
421									var id=$this.data('col');						
422								}								
423	
424								$this.closest('.gw-gopf-posts-wrap').css('overflow', 'visible');
425								var items = $this.triggerHandler('currentVisible');
426								$this.find('.gw-gopf-col-wrap').css({ 
427									'opacity' : 0,
428									'z-index' : 0,
429									'position': 'absolute',
430									'visibility' : 'hidden',
431									'left': 0														
432								}).eq(id).css({
433									'position' : 'relative',
434									'left' : '0',
435									'z-index' : 'auto'
436								});					
437								items.each(function(index, element) {
438									$(element).css({ 'visibility' : 'visible', 'opacity' : 1, 'position': 'relative', 'z-index' : 'auto' });
439								});	
440								$this.closest('.gw-gopf-posts-wrap-inner').find('.gw-gopf-posts-wrap-inner-overlay').hide();
441							} 	
442						}							
443					},
444					swipe : {
445						onMouse : true
446					},	
447					items :	{
448						height : 'variable',
449						visible : {
450							min : 1,
451							max : $this.data('col')
452						},
453						start: startIndex
454						
455					},								
456				    onCreate : function (data) {
457						$this.closest('.gw-gopf-posts-wrap').css('overflow', 'visible');
458						var items = $this.triggerHandler('currentVisible');
459						$this.find('.gw-gopf-col-wrap').css({ 
460							'visibility' : 'hidden', 
461							'position': 'absolute',
462							'opacity' : 0
463						});
464						items.each(function(index, element) {
465							$(element).css({ 'visibility' : 'visible', 'opacity' : 1, 'position': 'relative' });
466						});
467
468				        $(window).on('resize', function(){
469							var paused = $this.triggerHandler('isPaused');
470							if ($this.css('letterSpacing')=='30px' || $this.css('letterSpacing')=='20px') {
471								$this.trigger('configuration', ['items.visible', 1]);			
472							} else if ($this.css('letterSpacing')=='10px') {
473								$this.trigger('configuration', ['items.visible', $this.data('col')==1 ? 1 : 2 ]);						
474							} else {
475								$this.trigger('configuration', ['items.visible', $this.data('col')]);
476										
477							};
478							if (paused) { $this.trigger('pause', true); }
479							
480							var items = $this.triggerHandler('currentVisible');
481							$this.find('.gw-gopf-col-wrap').css({ 
482								'visibility' : 'hidden', 
483								'position': 'absolute',
484								'opacity' : 0
485							});
486							items.each(function(index, element) {
487								$(element).css({ 'visibility' : 'visible', 'opacity' : 1, 'position': 'relative' });
488							});						
489				        }).resize();
490				    }
491				});
492				
493				/* Call slider */
494				$this.carouFredSel($.extend($this.data('slider'), $this.data('sliderDefaults')));
495			});
496
497		};
498		
499	/* -------------------------------------------------------------------------------- /
500		[4]	POPUP - Magnific Popup
501	/ -------------------------------------------------------------------------------- */		
502
503		var portfolioGallery = [], portfolioGalleryO = [], mfpOpened=false;
504		function DoMagnificPopup() {
505			
506			if ($.fn.magnificPopup) {
507				$portfolio.each(function(index, element) {
508					var $this = $(this);
509					if ( $this.data('lbenabled') ) {
510						$this.find('.gw-gopf-magnific-popup[href!=""], .gw-gopf-magnific-popup-html[href!=""]').attr('href','#');
511						portfolioGallery[$this.data('id')] = $this.find('.gw-gopf-magnific-popup[data-mfp-src!="#"][data-mfp-src!=""], .gw-gopf-magnific-popup-html[data-mfp-src!="#"][data-mfp-src!=""]').magnificPopup({
512							type : 'image',
513							closeOnContentClick : true,
514							removalDelay : 300,
515							mainClass : 'my-mfp-slide-bottom',
516							closeMarkup : '<a title="%title%" class="gw-gopf-mfp-close"></a>',
517							titleSrc: 'title',
518							gallery : {
519								enabled : $this.data('lbgallery'),
520								arrowMarkup: '<a title="%title%" class="gw-gopf-mfp-arrow mfp-arrow mfp-arrow-%dir%"></a>'
521							},
522							image : {
523								markup: '<div class="mfp-figure">'+
524										'<div class="mfp-close"></div>'+
525										'<div class="mfp-img"></div>'+
526										'<div class="mfp-bottom-bar">'+
527										  '<div class="gw-gopf-mfp-title mfp-title"></div>'+
528										  '<div class="gw-gopf-mfp-counter mfp-counter"></div>'+
529										'</div>'+
530									  '</div>'
531							},
532							iframe : {
533								patterns : {
534									vimeo : {
535										index: 'vimeo.com/',
536										id: '/',
537										src: '//player.vimeo.com/video/%id%&amp;autoplay=1'
538									},
539									dailymotion : {
540										index : 'dailymotion.com/',
541										id : '/',
542										src :'//dailymotion.com/embed/video/%id%?autoPlay=1'
543									},
544									metacafe : {
545										index : 'metacafe.com/',
546										id : '/',
547										src : 'http://www.metacafe.com/embed/%id%?ap=1'
548									},
549									soundcloud : {
550										index : 'soundcloud.com',
551										id : null,
552										src : '%id%'
553									},
554									mixcloud : {
555										index : 'mixcloud.com',
556										id: null,
557										src: '%id%'
558									},
559									beatport : {
560										index : 'beatport.com',
561										id : null,
562										src : '%id%'
563									}																										
564								},						
565								markup : '<div class="mfp-iframe-scaler">'+
566										'<div class="mfp-close"></div>'+
567										'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
568										'<div class="mfp-bottom-bar" style="margin-top:4px;"><div class="gw-gopf-mfp-title mfp-title"></div><div class="gw-gopf-mfp-counter mfp-counter"></div></div>'+
569										'</div>'
570							},					
571							callbacks : {
572								elementParse : function(item) {
573									if ($(item.el).hasClass('gw-gopf-magnific-popup-html')) {
574										item.type = 'iframe' 
575									};
576								},
577								change : function() {
578									var $currentItem = $(this.currItem.el);
579									if ($currentItem.hasClass('gw-gopf-magnific-popup-html')) {									
580										setTimeout(function(){ 
581											$('.mfp-title').html($currentItem.attr('title'))						
582										},5);									
583									}
584									
585									/* Deep linking */
586									if ($this.data('deepLinking')) {
587										mfpOpened = $(this.currItem.el);
588										if(history.pushState) {
589											location.hash = '#mpf-popup@'+$currentItem.attr('data-mfp-src')+'|'+$currentItem.data('id').split('_')[0]+'|'+$currentItem.data('id').split('_')[1];
590											if (history.state==$currentItem.data('id')) {
591												history.pushState($currentItem.data('id'), null, window.location.href.replace(window.location.origin,'').split('#')[0]+'#mpf-popup@'+$currentItem.attr('href')+'|'+$currentItem.data('id').split('_')[0]+'|'+$currentItem.data('id').split('_')[1]);
592											};
593										} else {
594											location.hash = '#mpf-popup@'+$currentItem.attr('href')+'|'+$currentItem.data('id').split('_')[0]+'|'+$currentItem.data('id').split('_')[1];
595										};
596									};
597	
598									var forcedHeight = $(this.currItem.el).data('height');
599									
600									if (forcedHeight != undefined) {	
601										setTimeout(function(){ 
602											$('.mfp-iframe-scaler').css({
603												'paddingTop' : 0,
604												'display' : 'table-cell',
605												'verticalAlign' : 'middle',
606												'height' : forcedHeight
607											});						
608										},5);
609									} else {
610										setTimeout(function(){ 
611											$('.mfp-iframe-scaler').css({
612												'padding-top': '56.25%', 
613												'display' : 'block',
614												'verticalAlign' : 'baseline',
615												'height' : 0
616											});						
617										},5);
618									};
619								},
620								beforeClose : function() {
621									if ($this.data('deepLinking')) {
622										if (history.pushState)
623											history.pushState('', null, window.location.pathname + window.location.search);
624										else {									
625											var scrollPosX = document.body.scrollTop;
626											var scrollPosY = document.body.scrollLeft;
627											window.location.hash = '';
628											document.body.scrollTop = scrollPosX;
629											document.body.scrollLeft = scrollPosY;
630										};
631									};
632									if ($(this.currItem.el).hasClass('gw-gopf-magnific-popup-html')) {
633										$('.mfp-wrap').css('display','none');
634									};									
635									mfpOpened=false;
636								},
637								afterClose : function() {
638									if (this.items[this.index].type == 'iframe') {
639										/* Firefox bug fix - force to redraw thumbnail */
640										var timer=setInterval(function() {
641										if ($('.mfp-bg').length==0) {
642											clearInterval(timer);
643											$portfolio.find('.gw-gopf-post').css('opacity','0.99');
644											setTimeout(function(){ $portfolio.find('.gw-gopf-post').css('opacity','1'); },20)
645										}
646										},50);
647									};
648								}						
649							}
650						});
651					} else {
652						$this.delegate('.gw-gopf-magnific-popup, .gw-gopf-magnific-popup-html','click', function(e) {
653							e.preventDefault();
654						});
655					};
656
657				});
658			};
659		};
660		
661		DoMagnificPopup();
662		
663		function updatePopupGallery( portfolioId ) {
664			if ($portfolio.filter('[data-id="'+portfolioId+'"]').data('lbenabled')) {
665				var $galleryItems = $portfolio.filter('[data-id="'+portfolioId+'"]').find('.gw-gopf-magnific-popup[data-mfp-src!="#"][data-mfp-src!=""], .gw-gopf-magnific-popup-html[data-mfp-src!="#"][data-mfp-src!=""]');
666				portfolioGallery[portfolioId].splice(0, $galleryItems.length);
667				$galleryItems.each(function(index, element) {
668					if (!$(this).closest('.gw-gopf-isotope-hidden').length) {
669					   portfolioGallery[portfolioId].push(this);
670					};
671				});
672			};
673		};
674		
675		$portfolio.find('.gw-gopf-magnific-popup, .gw-gopf-magnific-popup-html').on('mfpOpen', function(e) {
676			if ($.fn.carouFredSel && $sliders.length) {
677				$portfolio.find('.gw-gopf-posts-wrap-inner-overlay').show();
678				setTimeout(function() {
679					$sliders.each(function(index, element) {
680						var $this = $(this);
681						$this.trigger('pause', true);
682					});
683				}, 10);
684			}
685		});
686
687		$portfolio.find('.gw-gopf-magnific-popup, .gw-gopf-magnific-popup-html').on('mfpAfterClose', function(e) {
688			if ($.fn.carouFredSel && $sliders.length) {
689				$portfolio.find('.gw-gopf-posts-wrap-inner-overlay').hide();
690				setTimeout(function() {
691					$sliders.each(function(index, element) {
692						var $this = $(this);
693						$this.trigger('resume');
694					});
695				}, 10);
696			}
697		});
698		
699	/* -------------------------------------------------------------------------------- /
700		[5]	ISOTOPE 
701	/ -------------------------------------------------------------------------------- */		
702		
703		/* Isotope */
704
705		if ($.fn.GWisotope) {
706			
707			/* Call Isotope plugin */
708			$.fn.callIsotope = function ( filter, noImage ) {
709				var $this = $(this);
710				
711				$this.data( 'noImage', noImage ? true : false );
712				
713				filter = $this.closest('.gw-gopf').data('filter-type')==undefined || $this.closest('.gw-gopf').data('filter-type')=='opacity' ? '*' : filter;
714				$this.GWisotope({
715					filter : filter,
716					transformsEnabled: $this.closest('.gw-gopf').data('transenabled') ? true : false,
717					animationEngine: isIE && isIE == 8 ? 'css' : 'best-available',
718					containerClass : 'gw-gopf-isotope',
719					hiddenClass : 'gw-gopf-isotope-hidden',
720					itemClass : 'gw-gopf-isotope-item',
721					layoutMode : 'masonry',
722					onLayout: function( $elems, instance ) {
723						if (instance.element.closest('.gw-gopf').data('id')!=undefined) {
724							updatePopupGallery(instance.element.closest('.gw-gopf').data('id'));
725						};
726						instance.element.css('marginBottom',0).closest('.gw-gopf-posts-wrap-inner').css('marginTop',0).end().find('.gw-gopf-post-col').css('marginTop',0);
727						
728						if ( !$this.data( 'noImage' ) ) {
729							setTimeout(function() { 							
730								imgIsInview();
731								loadGalleryImages();
732							}, 800 );
733						}
734
735					}
736				}, 
737				function( $elems, instance ) {
738
739					/* auto load on filtering */
740					if (instance.element.closest('.gw-gopf').hasClass('gw-gopf-pagination')) {
741						var visibleItems = !instance.element.closest('.gw-gopf').hasClass('gw-gopf-filter-opacity') ? instance.$filteredAtoms.length : instance.element.closest('.gw-gopf').find('.gw-gopf-col-wrap').filter(':not(.gw-gopf-disabled)').length;
742						var visibleItemsTerm = instance.element.closest('.gw-gopf').find('.gw-gopf-cats .gw-gopf-current:last').data('count');
743						var postsCount = instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').data('posts');
744						var pagesCount = instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').data('pages');
745						var currentPage = instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').data('current-page');
746						var currItemsPerPage = instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').data('posts-per-page');
747						
748						var loadsCnt = 0;
749						if (visibleItems < currItemsPerPage) {
750							if (visibleItemsTerm<currItemsPerPage) {
751								loadsCnt = visibleItemsTerm - visibleItems;
752							} else {
753								loadsCnt = currItemsPerPage - visibleItems;
754							}
755						} else {
756							if (visibleItemsTerm - visibleItems >= currItemsPerPage ) {
757								loadsCnt = currItemsPerPage
758							} else {
759								loadsCnt = visibleItemsTerm % visibleItems;
760							}
761						}
762						instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').data('required', loadsCnt);
763						
764						if (instance.element.closest('.gw-gopf').find('.gw-gopf-cats .gw-gopf-current').data('filter')!=undefined) {
765							$(instance.element.closest('.gw-gopf')).find('.gw-gopf-pagination-wrapper').data('tax',  instance.element.closest('.gw-gopf').find('.gw-gopf-filter').data('tax'));
766							$(instance.element.closest('.gw-gopf')).find('.gw-gopf-pagination-wrapper').data('term',  instance.element.closest('.gw-gopf').find('.gw-gopf-cats .gw-gopf-current:last').data('filter'));							
767						} else {
768							$(instance.element.closest('.gw-gopf')).find('.gw-gopf-pagination-wrapper').removeData('tax');
769							$(instance.element.closest('.gw-gopf')).find('.gw-gopf-pagination-wrapper').removeData('term');							
770						}
771						
772						if (currItemsPerPage>-1 && visibleItemsTerm>visibleItems && visibleItems<currItemsPerPage) {			
773							$(instance.element.closest('.gw-gopf')).find('.gw-gopf-pagination-load-more').trigger('click');
774						} 
775						if (visibleItemsTerm == visibleItems || postsCount == visibleItems) {
776							if (instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').is(':visible')) {
777								instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').stop().fadeTo(550, 0, function() { 
778									instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').stop().slideUp(); 
779								});	
780							};
781						} else {
782							if (!instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').is(':visible')) {
783								instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').stop().fadeTo(550, 1, function() { 
784									instance.element.closest('.gw-gopf').find('.gw-gopf-pagination-wrapper').stop().slideDown(); 
785								});	
786							};
787						};
788					};
789				}				
790				);
791			};
792			
793			/* Extend the plugin to hack change column number if required */
794			$.extend( $.GWIsotope.prototype, {
795				_masonryReset : function() {
796					// layout-specific props
797					this.masonry = {};
798					
799					// FIXME shouldn't have to call this again
800					this._getSegments();
801					
802					/* Hack - set col number manually */
803					if (this.element.hasClass('gw-gopf-posts')) {
804						if (this.element.css('letterSpacing')=='30px' || this.element.css('letterSpacing')=='20px') {
805							this.masonry.cols = 1;
806						} else if (this.element.css('letterSpacing')=='10px') {
807							if (this.element.data('col')!=1) {
808								this.masonry.cols = 2;
809							} else {
810								this.masonry.cols = 1;
811							}
812						} else {
813							this.masonry.cols = this.element.data('col');					
814						};	
815						var i = this.masonry.cols;
816
817					};
818					/* end of Hack */
819					
820					/* modify margin */
821					this.element.css('marginBottom',this.element.closest('.gw-gopf').data('rowspace')).closest('.gw-gopf-posts-wrap-inner').css('marginTop',this.element.closest('.gw-gopf').data('rowspace')*-1).end().find('.gw-gopf-post-col').css('marginTop',this.element.closest('.gw-gopf').data('rowspace'));		
822					
823					this.masonry.colYs = [];
824					while (i--) {
825						this.masonry.colYs.push( 0 );
826					}
827				},
828				_masonryGetContainerSize : function() {
829				  var containerHeight = Math.max.apply( Math, this.masonry.colYs );
830				  containerHeight -= this.element.closest('.gw-gopf').data('rowspace');
831				  return { height: containerHeight };
832				}
833			});
834			
835			$.GWIsotope.prototype._positionAbs = function( x, y ) {
836		 		if (this.element.closest('.gw-gopf.gw-gopf-rtl').length) {
837					return { right: x, top: y };
838				} else {
839					return { left: x, top: y };	
840				}
841			};
842			
843					
844			/* Filter button events */
845			$portfolioFilter.delegate('div a', 'click', function(e) {
846				var $this=$(this), $parent=$this.closest('span'), filter;
847				e.preventDefault();
848				
849				$parent.addClass('gw-gopf-current').siblings().removeClass('gw-gopf-current');
850				if ($parent.data('filter')==undefined) {
851					$this.closest('.gw-gopf').find('.gw-gopf-posts').callIsotope('*');
852					$this.closest('.gw-gopf').find('.gw-gopf-posts').find('.gw-gopf-col-wrap').removeClass('gw-gopf-disabled');					
853				} else {
854					$this.closest('.gw-gopf').find('.gw-gopf-posts').callIsotope('[data-filter~="'+$parent.data('filter')+'"]');
855					$this.closest('.gw-gopf').find('.gw-gopf-posts').find('.gw-gopf-col-wrap').addClass('gw-gopf-disabled').filter('[data-filter~="'+$parent.data('filter')+'"]').removeClass('gw-gopf-disabled');
856				};			
857				
858			});
859			
860			
861			/* Call Isotope plugin */
862			$portfolio.filter('.gw-gopf-grid-type').each(function(index, element) {
863				var $this = $(this);
864				$this.find('.gw-gopf-posts').callIsotope('*');
865				if (!$this.hasClass('gw-gopf-isotope-ready')) { 
866					$this.closest('.gw-gopf').addClass('gw-gopf-isotope-ready');
867					
868				};
869			});
870			
871		};
872
873	/* -------------------------------------------------------------------------------- /
874		[6]	EFFECTS
875	/ -------------------------------------------------------------------------------- */	
876
877		/* Handle taps on touch devices */
878		
879		if (isTouchDevice) { 
880			$portfolio.delegate('.gw-gopf-post', 'touchstart', function (event) {
881				var $this = $(this);
882				$portfolio.find('.gw-gopf-current.gw-gopf-post').not($this).removeClass('gw-gopf-current').trigger('tapOff');					
883				if ( !$this.hasClass('gw-gopf-current')) {
884					$this.addClass('gw-gopf-current');
885					$this.trigger('tapOn');
886				};
887			});
888
889			/* Remove effect when you tap anywhere out */
890			$(document).delegate(this, 'touchstart', function (event) {
891				if ($(event.target).closest('.gw-gopf-posts-wrap').length) {
892					$(event.target).closest('.gw-gopf-posts-wrap').addClass('gw-gopf-touch');
893				} else {
894					$('.gw-gopf-posts-wrap').removeClass('gw-gopf-touch');
895				}
896				if (!$(event.target).closest('.gw-gopf-current.gw-gopf-post').length) {
897					$portfolio.find('.gw-gopf-current.gw-gopf-post').removeClass('gw-gopf-current').trigger('tapOff');
898				};
899				if (!$(event.target).closest('.gw-gopf-posts-wrap').length) {
900					$portfolio.find('.gw-gopf-current.gw-gopf-post').removeClass('gw-gopf-current').trigger('tapOff');
901				};
902				
903			});			
904						
905			/* Some trick to re-enable filtering (exluded element fix) */
906			$portfolio.delegate('.gw-gopf-cats > span a', 'touchstart', function (event) {
907				var $this = $(this);
908				$this.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
909				$this.one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
910					/* $(this).trigger('click');* - just in case */
911				});
912				$portfolio.find('.gw-gopf-current.gw-gopf-post').removeClass('gw-gopf-current').trigger('tapOff');
913			});
914
915			/* Remove effect - exluded elements correction */
916			$('body').delegate('button, input, select, textarea, a, .noSwipe', 'touchstart', function (event) {
917				if (!$(event.target).closest('.gw-gopf-current.gw-gopf-post').length) {
918					$portfolio.find('.gw-gopf-current.gw-gopf-post').removeClass('gw-gopf-current').trigger('tapOff');
919				};
920			});
921
922		};
923					
924		$portfolio.delegate('.gw-gopf-post', 'mouseenter mouseleave tapOn tapOff', function (event) {
925			var $this = $(this),
926				postHeight = $this.outerHeight(),
927				$content = $this.find('.gw-gopf-post-content'),
928				contentHeight = $content.outerHeight(),
929				$overlayInner = $this.find('.gw-gopf-post-overlay-inner'),
930				overlayInnerHeight = $overlayInner.height();
931			
932			if (event.type == 'mouseenter' || event.type == 'tapOn') {
933				if ($this.hasClass('gw-gopf-current') && event.type == 'mouseenter' ) { return false; };
934				$(event.target).closest('.gw-gopf').removeClass('gw-gopf-touch');
935				$this.find('.gw-gopf-post-overlay').css('height', $this.find('.gw-gopf-post-header').outerHeight());
936				$this.find('.gw-gopf-post-content-wrap').show();
937			} else if (event.type == 'mouseleave' || event.type == 'tapOff') {
938				if ($this.hasClass('gw-gopf-current') && event.type == 'mouseleave' ) { return false; };
939				$this.removeClass('gw-gopf-current');
940				$(event.target).closest('.gw-gopf').addClass('gw-gopf-touch');
941			}
942			
943			/* Flex Slide Up */
944			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-flex-slide-up')) {
945				if (event.type == 'mouseenter' || event.type == 'tapOn') {
946					if ( postHeight-contentHeight-overlayInnerHeight <= 0 ) {
947						$overlayInner.css('display', 'none');
948					} else {
949						$overlayInner.css('display', 'inline-block');	
950					};
951											
952					/* Media wrap */
953					$this.find('.gw-gopf-post-content-wrap').css({
954						'top' : postHeight
955					}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
956					
957					setTimeout(function(){ 
958						$this.find('.gw-gopf-post-content-wrap').css({
959							'top' : postHeight-contentHeight < 0 ? 0 : postHeight-contentHeight
960						});
961					}, 1);
962					
963					/* Overlay */
964					$this.find('.gw-gopf-post-overlay').css({
965						'height' : postHeight
966					}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');					
967
968					setTimeout(function(){ 					
969						$this.find('.gw-gopf-post-overlay').css({
970							'height' : postHeight-contentHeight < 0 ? 0 : postHeight-contentHeight
971						}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
972					}, 1);											
973				};
974				
975				if (event.type == 'mouseleave' || event.type == 'tapOff') {
976					$this.find('.gw-gopf-post-content-wrap').css({
977						'top' : supportsTransitions ? postHeight : '100%'
978					}).one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
979						$(this).css({ 'top' : '100%' });
980					});
981					
982					$this.find('.gw-gopf-post-overlay').css({
983						'height' : supportsTransitions ? postHeight : '100%'
984					}).one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
985						$(this).css({ 'height' : '100%' });
986					});
987				};
988			};	
989			
990			/* Flex Slide & Push Up */
991			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-flex-slide-push-up')) {
992				if (event.type == 'mouseenter' || event.type == 'tapOn') {
993					if ( postHeight-contentHeight-overlayInnerHeight <= 0 ) {
994						$overlayInner.css('display', 'none');
995					} else {
996						$overlayInner.css('display', 'inline-block');	
997					};
998											
999					/* Media wrap */
1000					$this.find('.gw-gopf-post-content-wrap').css({
1001						'top' : postHeight
1002					}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
1003					
1004					setTimeout(function(){ 
1005						$this.find('.gw-gopf-post-content-wrap').css({
1006							'top' : postHeight-contentHeight < 0 ? 0 : postHeight-contentHeight
1007						});
1008					}, 1);
1009					
1010					/* Overlay */
1011					$this.find('.gw-gopf-post-overlay').css({
1012						'top' : postHeight-contentHeight < 0 ? 100 : contentHeight,
1013						'height' : postHeight
1014					}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');					
1015
1016					setTimeout(function(){ 					
1017						$this.find('.gw-gopf-post-overlay').css({
1018							'height' : postHeight-contentHeight < 0 ? 0 : postHeight-contentHeight
1019						}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
1020					}, 1);
1021										
1022					/* Header */
1023					$this.find('.gw-gopf-post-header').css({
1024						'marginTop' : (postHeight-contentHeight < 0 ? postHeight : contentHeight)*-1,
1025						'marginBottom' : postHeight-contentHeight < 0 ? postHeight : contentHeight
1026					});																
1027				};
1028				
1029				if (event.type == 'mouseleave' || event.type == 'tapOff') {
1030					$this.find('.gw-gopf-post-content-wrap').css({
1031						'top' : supportsTransitions ? postHeight : '100%'
1032					}).one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
1033						$(this).css({ 'top' : '100%' });
1034					});
1035					
1036					$this.find('.gw-gopf-post-overlay').css({
1037						'top' : 0,
1038						'height' : supportsTransitions ? postHeight : '100%'
1039					}).one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
1040						$(this).css({ 'height' : '100%' });
1041					});
1042					
1043					$this.find('.gw-gopf-post-header').css({
1044						'marginTop' : 0,
1045						'marginBottom' : 0
1046					});																
1047				};
1048			};
1049			
1050			/* Flex Slide & Push Up Full */
1051			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-flex-slide-push-up-full')) {
1052				if (event.type == 'mouseenter' || event.type == 'tapOn') {
1053					$this.find('.gw-gopf-post-header').css({
1054						'marginTop' : postHeight*-1,
1055						'marginBottom' : postHeight
1056					});														
1057				};
1058				
1059				if (event.type == 'mouseleave' || event.type == 'tapOff') {
1060					$this.find('.gw-gopf-post-header').css({
1061						'marginTop' : 0,
1062						'marginBottom' : 0
1063					});															
1064				};
1065			};			
1066			
1067			/* Flex Slide Down */
1068			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-flex-slide-down')) {
1069				if (event.type == 'mouseenter' || event.type == 'tapOn') {
1070					if ( postHeight-contentHeight-overlayInnerHeight <= 0 ) {
1071						$overlayInner.css('display', 'none');
1072					} else {
1073						$overlayInner.css('display', 'inline-block');	
1074					};
1075											
1076					/* Media wrap */
1077					$this.find('.gw-gopf-post-content-wrap').css({
1078						'bottom' : postHeight
1079					}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
1080					
1081					setTimeout(function(){ 
1082						$this.find('.gw-gopf-post-content-wrap').css({
1083							'bottom' : postHeight-contentHeight < 0 ? 0 : postHeight-contentHeight
1084						});
1085					}, 1);
1086					
1087					/* Overlay */
1088					$this.find('.gw-gopf-post-overlay').css({
1089						'height' : postHeight
1090					}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');					
1091
1092					setTimeout(function(){ 					
1093						$this.find('.gw-gopf-post-overlay').css({
1094							'height' : postHeight-contentHeight < 0 ? 0 : postHeight-contentHeight
1095						}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
1096					}, 1);											
1097				};
1098				
1099				if (event.type == 'mouseleave' || event.type == 'tapOff') {
1100					$this.find('.gw-gopf-post-content-wrap').css({
1101						'bottom' : supportsTransitions ? postHeight : '100%'
1102					}).one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
1103						$(this).css({ 'bottom' : '100%' });
1104					});
1105					
1106					$this.find('.gw-gopf-post-overlay').css({
1107						'height' : supportsTransitions ? postHeight : '100%'
1108					}).one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
1109						$(this).css({ 'height' : '100%' });
1110					});
1111				};
1112			};
1113			
1114			/* Flex Slide & Push Down */
1115			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-flex-slide-push-down')) {
1116				if (event.type == 'mouseenter' || event.type == 'tapOn') {
1117					if ( postHeight-contentHeight-overlayInnerHeight <= 0 ) {
1118						$overlayInner.css('display', 'none');
1119					} else {
1120						$overlayInner.css('display', 'inline-block');	
1121					};
1122											
1123					/* Media wrap */
1124					$this.find('.gw-gopf-post-content-wrap').css({
1125						'bottom' : postHeight
1126					}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
1127					
1128					setTimeout(function(){ 
1129						$this.find('.gw-gopf-post-content-wrap').css({
1130							'bottom' : postHeight-contentHeight < 0 ? 0 : postHeight-contentHeight
1131						});
1132					}, 1);
1133					
1134					/* Overlay */
1135					$this.find('.gw-gopf-post-overlay').css({
1136						'bottom' : postHeight-contentHeight < 0 ? 100 : contentHeight,
1137						'height' : postHeight
1138					}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');					
1139
1140					setTimeout(function(){ 					
1141						$this.find('.gw-gopf-post-overlay').css({
1142							'height' : postHeight-contentHeight < 0 ? 0 : postHeight-contentHeight
1143						}).off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
1144					}, 1);
1145										
1146					/* Header */
1147					$this.find('.gw-gopf-post-header').css({
1148						'marginBottom' : (postHeight-contentHeight < 0 ? postHeight : contentHeight)*-1,
1149						'marginTop' : postHeight-contentHeight < 0 ? postHeight : contentHeight
1150					});																
1151				};
1152				
1153				if (event.type == 'mouseleave' || event.type == 'tapOff') {
1154					$this.find('.gw-gopf-post-content-wrap').css({
1155						'bottom' : supportsTransitions ? postHeight : '100%'
1156					}).one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
1157						$(this).css({ 'bottom' : '100%' });
1158					});
1159					
1160					$this.find('.gw-gopf-post-overlay').css({
1161						'bottom' : 0,
1162						'height' : supportsTransitions ? postHeight : '100%'
1163					}).one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { 
1164						$(this).css({ 'height' : '100%' });
1165					});
1166					
1167					$this.find('.gw-gopf-post-header').css({
1168						'marginBottom' : 0,
1169						'marginTop' : 0
1170					});																
1171				};
1172			};
1173			
1174			/* Flex Slide & Push Down Full */
1175			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-flex-slide-push-down-full')) {
1176				if (event.type == 'mouseenter' || event.type == 'tapOn') {
1177					$this.find('.gw-gopf-post-header').css({
1178						'marginTop' : postHeight,
1179						'marginBottom' : postHeight*-1
1180					});
1181				};
1182				
1183				if (event.type == 'mouseleave' || event.type == 'tapOff') {
1184					$this.find('.gw-gopf-post-header').css({
1185						'marginTop' : 0,
1186						'marginBottom' : 0
1187					});															
1188				};
1189			};
1190			
1191			/* Door style */
1192			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-door-slide-down')) {
1193				if (event.type == 'mouseenter' || event.type == 'tapOn') {
1194					$this.css({
1195						'marginBottom' : contentHeight * -1,
1196						'paddingBottom' : contentHeight
1197					});
1198				};
1199				
1200				if (event.type == 'mouseleave' || event.type == 'tapOff') {
1201					$this.css({
1202						'marginBottom' : 0,
1203						'paddingBottom' : 0
1204					});
1205				};
1206			};
1207			
1208			/* Delux Push Up */
1209			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-delux-push-up')) {
1210				if (event.type == 'mouseenter' || event.type == 'tapOn') {
1211					$this.find('.gw-gopf-post-content-wrap').css('top', $this.find('.gw-gopf-post-header').outerHeight());
1212					$this.css({
1213						'marginTop' : contentHeight * -1,
1214						'paddingBottom' : contentHeight
1215					});
1216				
1217				};
1218				
1219				if (event.type == 'mouseleave' || event.type == 'tapOff') {
1220					$this.css({
1221						'marginTop' : 0,
1222						'paddingBottom' : 0
1223					});
1224				};
1225			};		
1226			
1227			/* Delux Push Down */
1228			if ($this.closest('.gw-gopf').hasClass('gw-gopf-style-delux-push-down')) {
1229				if (event.type == 'mouseenter' || event.type == 'tapOn') {
1230					$this.find('.gw-gopf-post-content-wrap').css('bottom', $this.find('.gw-gopf-post-header').outerHeight());
1231					$this.find('.gw-gopf-post-overlay').css('height', $this.find('.gw-gopf-post-header').outerHeight());
1232					$this.css({
1233						'marginBottom' : contentHeight * -1,
1234						'paddingTop' : contentHeight
1235					});
1236				};
1237				
1238				if (event.type == 'mouseleave' || event.type == 'tapOff') {
1239					$this.css({
1240						'marginBottom' : 0,
1241						'paddingTop' : 0
1242					});
1243				};
1244			};									
1245											
1246		});			
1247
1248	/* -------------------------------------------------------------------------------- /
1249		[7]	DEEP LINKING
1250	/ -------------------------------------------------------------------------------- */
1251
1252	function doHashChange() {
1253		var hashinfo = getHashInfo(),
1254			galleryItemIndex;
1255				
1256		if (!hashinfo || hashinfo==undefined) { 
1257			if (mfpOpened!=false) {
1258				$.magnificPopup.close();
1259			}
1260			return false;
1261		} else {
1262			if (!$portfolio.filter('[data-id="'+hashinfo[2]+'"]').data('deepLinking')) { return false; };
1263		};
1264		
1265		if (portfolioGallery[hashinfo[2]]!=undefined) {
1266			portfolioGallery[hashinfo[2]].each(function(index, element) {
1267				if ($(this).data('id')==hashinfo[1]+'_'+hashinfo[2]) {
1268					galleryItemIndex=index;
1269				};
1270			});
1271
1272			if (galleryItemIndex>-1) {
1273				if (mfpOpened!=false) {
1274					if (mfpOpened.data('id')!=$(portfolioGallery[hashinfo[2]]).eq(galleryItemIndex).data('id')) {
1275						portfolioGallery[hashinfo[2]].magnificPopup('open', galleryItemIndex);
1276					};
1277				} else {
1278					portfolioGallery[hashinfo[2]].magnificPopup('open', galleryItemIndex);
1279				};
1280			};
1281		};
1282	};
1283
1284	doHashChange();
1285	
1286	function getHash() {
1287		var currentHash = location.hash && location.hash !='' ? location.hash.split('#')[1] : null;
1288		return currentHash;
1289	};
1290	
1291	function getHashInfo() {
1292		var hashData = getHash(); 
1293		if (!hashData) return false;
1294		hashData = hashData.replace(/%7C/g, '|');
1295		if (hashData && hashData.split('@').length == 2 && hashData.split('@')[0] == 'mpf-popup' && hashData.split('@')[1].split('|').length == 3) { 
1296			var hashParts = hashData.split('@')[1].split('|');
1297			return hashParts;
1298		};
1299	};
1300	
1301	if (window.addEventListener) {
1302    	window.addEventListener("hashchange", doHashChange, false);
1303	} else if (window.attachEvent) {
1304    	window.attachEvent("onhashchange", doHashChange);    
1305	};
1306
1307	/* -------------------------------------------------------------------------------- /
1308		[8]	OTHERS
1309	/ -------------------------------------------------------------------------------- */
1310	
1311		$(window).on('resize', function() { 
1312			$portfolio.filter('.gw-gopf-isotope-ready').find('.gw-gopf-posts').GWisotope('reLayout');
1313		});
1314		
1315		$(window).on('load', function() {
1316			if (supportsOrientationchange) {
1317				if (gw_go_portfolio_settings.mobileTransition=='enabled') {
1318					$('.gw-gopf-no-trans').removeClass('gw-gopf-no-trans');	
1319				};
1320			} else {
1321				$('.gw-gopf-no-trans').removeClass('gw-gopf-no-trans');
1322			};
1323		});
1324
1325		
1326		function loadImages(images, callback) {
1327			
1328			if (!images) return;
1329			
1330			images.each(function(index, element) {
1331                
1332				var $el = $(element);
1333				
1334				if ( !$el.data('src') ) return;
1335				
1336				if ($el.closest('.gw-gopf-col-wrap').hasClass('gw-gopf-isotope-hidden') ) return;
1337
1338				if ( $el.data('loading') && $el.data('fixh') ) {
1339										
1340					if ( parseFloat( $el.data('fixh') / $el.closest('.gw-gopf-post-media-wrap').width() ) >
1340 $el.data('img-aspect-ratio') ) {
1341						if ( $el.data('curent-orientaion') != 'landscape' ) $el.attr('data-orientation', 'landsacpe');	
1342					} else {
1343						if ( $el.data('curent-orientaion') != 'portrait' ) $el.attr('data-orientation', 'portrait');
1344					}
1345				}
1346
1347
1348				if ( $el.hasClass('gw-gopf-image-ready') || !$el.data('inview') || $el.data('loading') ) return;
1349				$el.data('loading', 1);
1350				var newImg = new Image;
1351					newImg.onload = function() {
1352					$el.attr('src', newImg.src);
1353					setTimeout($.proxy(function() {
1354						$el.closest('.gw-gopf-post-media-wrap').css('background-image', 'url("' + newImg.src +'")');
1355					}, $el), 1);
1356											
1357
1358					
1359					if ( !$el.data('view-aspect-ratio') && !$el.data('img-aspect-ratio') && !$el.data('fixh') ) {
1360						
1361						$el.data('width', $el.width());
1362						$el.data('height', $el.height());	
1363						$el.data('img-aspect-ratio', $el.data('height') / $el.data('width'));
1364						$el.closest('.gw-gopf-post-media-wrap').css('padding-bottom', $el.data('img-aspect-ratio')*100+'%');						
1365						$el.closest('.gw-gopf-posts').GWisotope('reLayout' );
1366						
1367					}
1368					
1369					if ( $el.data('fixh') && !$el.data('img-aspect-ratio') ) {
1370						
1371						$el.data('width', $el.width());
1372						$el.data('height', $el.height());	
1373						$el.data('img-aspect-ratio', $el.data('height') / $el.data('width'));						
1374						
1375					}
1376					
1377					// portrait or landscape
1378					if ( $el.data('fixh') ) {
1379						
1380						if ( parseFloat( $el.data('fixh') / $el.width() )  > $el.data('img-aspect-ratio') ) {
1381							$el.data('curent-orientaion','landsacpe');
1382							$el.attr('data-orientation', 'landsacpe');	
1383						} else {
1384							$el.data('curent-orientaion','portrait');							
1385							$el.attr('data-orientation', 'portrait');
1386						}
1387					}
1388
1389					setTimeout($.proxy(function() {
1390						$el.closest('.gw-gopf-post-media-wrap-outer').css('opacity',1);
1391					}, $el), 10);					
1392								
1393
1394				}
1395				newImg.onerror=function(){}
1396				newImg.src=$el.data('src');
1397				
1398				
1399            });
1400			
1401		}
1402		
1403		function loadGalleryImages() {
1404			
1405			var images = $portfolio.find('.gw-gopf-post-media-wrap img:visible');
1406			var xImages = images.filter('[data-x]');
1407			var wpImages = images.not('[data-x]');
1408			loadImages(xImages);		
1409			loadImages(wpImages)
1410
1411		};
1412		
1413		function imgIsInview() {
1414
1415			$portfolio.find('.gw-gopf-post-media-wrap img').each(function(index, element) {
1416				var $el = $(element);
1417				if ( $el.offset().top<parseInt($(document).scrollTop()+window.innerHeight ) ) {
1418					$el.data('inview', true);
1419				} else {
1420					$el.data('inview', false);
1421				}
1422				
1423            });
1424		}
1425		
1426		$(window).on('scroll resize', function() { 
1427			imgIsInview();
1428			loadGalleryImages();
1429		});
1430		
1431		imgIsInview();
1432		loadGalleryImages();		
1433				
1434	});
1435	
1436})( jQuery.noConflict() );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.