/* bpMain this is used to setup the methods that should be registered on any page. this can setup slideshows, services iframes, fancy box images and videos, mobile nav, and map functions. */ var bpMain = { setupAppDefault: function() { this.setupMinifyNavigation(); this.setupFancyBox(); this.setupServicesIframe(); this.setupAutoScroll(); this.addVideoPanels(); this.newStickyFooter(); this.setupNavEvents(); this.setupGoogleMaps(); this.modalFormReset(); this.formCheckBoxYes(); this.setupPeekThrough(); }, enableSlideShow: function(type) { type = type || 'modern'; switch(type) { case 'controller': this.setupSlideController(); break; case 'modern': this.setupSlideshow1(); break; case 'inner': this.setupSlideshow2(); break; case 'reviews': this.setupSlideshow3(); break; case 'nivo': this.setupNivoSlider(); break; case 'sight': this.setupSlideshow4(); break; case 'book': this.setupSlideshow5(); break; } }, /* this will setup the custom slideshow */ setupSlideController: function() { /* bg spotlight holder */ /* container ID, file path, background or not */ var spotlight = new bpApp.slideController('slides'); spotlight.duration = 7000; spotlight.setup(); }, /* this will setup the custom slideshow */ setupSlideshow1: function() { var optionsArray = [ { title: '', content: '', className: '', image: '1.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '2.jpg', alt: '', url: '', crumbContent: '' } ]; /* bg spotlight holder */ /* container ID, file path, background or not */ var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight = new bpApp.slideShow('slides', '/images/', true, startNumber); spotlight.duration = 7000; spotlight.setup(optionsArray); }, setupSlideshow2: function() { var optionsArray = [ { title: '', content: '', className: '', image: 'mslide1.png', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'mslide2.png', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'mslide3.png', alt: '', url: '', crumbContent: '' } ]; /* bg spotlight holder */ /* container ID, file path, background or not */ var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight = new bpApp.slideShow('mobile_mission_wrapper', '/images/', true, startNumber); spotlight.duration = 7000; spotlight.setup(optionsArray); }, setupSlideshow3: function() { var optionsArray = [ { title: '', content: '', className: '', image: 'slide1.png', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'slide2.png', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'slide3.png', alt: '', url: '', crumbContent: '' } ]; /* bg spotlight holder */ /* container ID, file path, background or not */ var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight = new bpApp.slideShow('mission_wrapper', '/images/', true, startNumber); spotlight.duration = 6000; spotlight.setup(optionsArray); }, setupSlideshow4: function() { var optionsArray = [ { title: '', content: '', className: '', image: '01.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '02.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '03.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '04.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '05.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '06.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '07.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '08.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '09.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '10.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '11.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '12.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '13.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '14.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '15.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '16.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '17.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '18.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '19.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '20.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '21.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '22.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '23.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '24.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '25.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '26.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '27.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '28.jpg', alt: '', url: '', crumbContent: '' } ]; /* bg spotlight holder */ /* container ID, file path, background or not */ var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight = new bpApp.slideShow('sight', '/images/sightings/', false, startNumber); spotlight.duration = 7000; spotlight.setup(optionsArray); }, setupSlideshow5: function() { var optionsArray = [ { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_01.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_02.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_03.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_04.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_05.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_06.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_07.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_08.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_09.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_10.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_11.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_12.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_13.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_14.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_15.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: 'new_mm_colorbook_Page_16.jpg', alt: '', url: '', crumbContent: '' } ]; /* bg spotlight holder */ /* container ID, file path, background or not */ var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight = new bpApp.slideShow('book', '/images/book/', false, 0); spotlight.duration = 7000; spotlight.setup(optionsArray); }, addVideoPanels: function(attrName) { attrName = attrName || 'data-video-src'; var self = this; var elements = jQuery('[' + attrName + ']').each(function(index, element) { element = jQuery(element); var src = element.attr('data-video-src'); if(src) { var title = element.attr('data-title'); element.on('click', function() { self.viewVideo(title, src); }); } }); }, viewVideo: function(title, src) { var vid = { title: title, source: src }; var panel = new bpApp.videoPanel(vid, '', document.body); panel.setup(); panel.display(); }, /* this will setup the fancy box overlay on all images with the class of pics and videos with class of videos */ setupFancyBox: function() { jQuery(".pics").fancybox({ openEffect:'elastic', closeEffect:'elastic', helpers: { overlay : { locked: false } } }); jQuery(".videos").click(function() { jQuery.fancybox({ openEffect:'elastic', closeEffect:'elastic', helpers: { overlay : { locked: false } }, 'padding' : 0, 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'title' : this.title, 'width' : 680, 'height' : 495, 'href' : this.href.replace(new RegExp("watch\?v=", "i"), 'v/'), 'type' : 'swf', 'swf' : { 'wmode' : 'transparent', 'allowfullscreen' : 'true' } }); return false; }); }, setupFancyPhoto: function(){ $ = jQuery; var $imgCount = 0, /* change the images location here */ $imageLocat = "/images/sightings/"; /* this function ads a new photo to the slider widget*/ function addFancyPhoto($photoName){ var $imgBox = '