

	jQuery(document).ready(function($){
				//
				$("body").addClass("jsActive");

				//superfish
				//==============================
				$('ul.galleryList').superfish({
				  delay:    50,              // one second delay on mouseout
				  speed:    'slow',             // faster animation speed
				  autoArrows: false,              // disable generation of arrow mark-up
				  dropShadows: false              // disable drop shadows
				});

				//  FIX IOS VIEWPORT BUG
				//==============================
				/**/
				var viewport = $('meta[name="viewport"]');
				var nua = navigator.userAgent;
				if ((nua.match(/iPad/i)) || (nua.match(/iPhone/i)) || (nua.match(/iPod/i))) {
					viewport.attr('content', 'width=device-width, minimum-scale=1.0, maximum-scale=1.0');
					$('body')[0].addEventListener("gesturestart", gestureStart, false);
				}
				function gestureStart() {
					viewport.attr('content', 'width=device-width, minimum-scale=0.25, maximum-scale=1.6');
				}
				

				// RADNOMISE THE ITEMS IN THE GALLERY 
				//==============================
				/* HOME GALLERY */
				var n = $("#galleryHome li").length;
				
					if (n > 5) {
						var $li = $("#galleryHome li").hide();
						var len = $li.length;
						var counter = 6; // how many items to display
						var randomnumber;
						while (counter > 0) {
							randomnumber = Math.floor(Math.random() * (len + 1));
							if ($li.eq(randomnumber).is(":hidden")) {
								$li.eq(randomnumber).show();
								counter -= 1;
							}
						}    
					}
				



				// SOFT ROLLOVERS - GALLERIES
				//==============================
				
				 if ($('.gallery li').length) {
				
					$(function() {
							$('.gallery .vimeoDataWrapper').find('.vimeoPlay').css({opacity:'0'});
							$('.gallery .vimeoDataWrapper').find('.vimeoTitle').css({opacity:'0.8'});
						$('.gallery .vimeoDataWrapper').hover(function(){
							$(this).find('.vimeoPlay').animate({opacity:'0.8'},{queue:false,duration:500});
							$(this).find('.vimeoTitle').animate({opacity:'0'},{queue:false,duration:500});
						}, function(){
							$(this).find('.vimeoPlay').animate({opacity:'0'},{queue:false,duration:500});
							$(this).find('.vimeoTitle').animate({opacity:'0.8'},{queue:false,duration:500});
						});
					});
				
				};
				/**/

						
				// LIGHT WINDOW EMBED 
				//==============================
                $(".vimeoLightwindowEmbed").prettyPhoto({theme:'dark_square'});	
				

				
				// SOFT ROLLOVERS - WORK SLIDESHOWS
				//==============================
				
				 if ($('.slideshow li').length) {
					 
					$('.slideshow .thumbWrapper').hover(			
					function() {			
						$(this).find('img').animate({opacity:'0.2'},{queue:false,duration:500});			
					},			
					function() {			
						$(this).find('img').animate({opacity:'1'},{queue:false,duration:500});
					});
				};
	
				// WORK SLIDESHOW CAROUSELS
				//==============================
				 if ($('.slideshow li').length) {
					$('.slideshow').after('<div id="slideshowNav" class="slideshowNav"><a id="prev" href="#">Prev</a> <a id="next" href="#">Next</a>').before('<p class="slideshowPager" id="videoSlideshowPager">').cycle({
							//fx:     'scrollVert',			
							fx:     'fade',			
							//easing: 'bounceout', 
							timeout:  0,
							delay:  -2000,
							cleartypeNoBg: true,
							//cleartype:  false,
							pager:  '#videoSlideshowPager', 
							next:   '#next', 
							prev:   '#prev'
					});
				
				};

				
             });

