Why Choose Us?
WHY CHOOSE US?
Smile!
When you come in for your complimentary consultation our benenfits coordinator will look up your insurance benefits and we will review them during your appointment.
Are you a current patient?
Your request has been sent -- we will be in contact with you shortly.
Please make sure ALL fields are filled out correctly.
The requested content cannot be loaded.
Please try again later.
').appendTo("body");var e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery);(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);(function ($) { "use strict"; var F = $.fancybox, format = function( url, rez, params ) { params = params || ''; if ( $.type( params ) === "object" ) { params = $.param(params, true); } $.each(rez, function(key, value) { url = url.replace( '$' + key, value || '' ); }); if (params.length) { url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; } return url; }; F.helpers.media = { defaults : { youtube : { matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, params : { autoplay : 1, autohide : 1, fs : 1, rel : 0, hd : 1, wmode : 'opaque', enablejsapi : 1 }, type : 'iframe', url : '//www.youtube.com/embed/$3' }, vimeo : { matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, params : { autoplay : 1, hd : 1, show_title : 1, show_byline : 1, show_portrait : 0, fullscreen : 1 }, type : 'iframe', url : '//player.vimeo.com/video/$1' }, metacafe : { matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, params : { autoPlay : 'yes' }, type : 'swf', url : function( rez, params, obj ) { obj.swf.flashVars = 'playerVars=' + $.param( params, true ); return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; } }, dailymotion : { matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, params : { additionalInfos : 0, autoStart : 1 }, type : 'swf', url : '//www.dailymotion.com/swf/video/$1' }, twitvid : { matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, params : { autoplay : 0 }, type : 'iframe', url : '//www.twitvid.com/embed.php?guid=$1' }, twitpic : { matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, type : 'image', url : '//twitpic.com/show/full/$1/' }, instagram : { matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, type : 'image', url : '//$1/p/$2/media/?size=l' }, google_maps : { matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, type : 'iframe', url : function( rez ) { return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); } } }, beforeLoad : function(opts, obj) { var url = obj.href || '', type = false, what, item, rez, params; for (what in opts) { if (opts.hasOwnProperty(what)) { item = opts[ what ]; rez = url.match( item.matcher ); if (rez) { type = item.type; params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); break; } } } if (type) { obj.href = url; obj.type = type; obj.autoHeight = false; } } };}(jQuery)); var bpApp = { extendObject: function(sourceObj, targetObj) { if(typeof sourceObj === 'object' && typeof targetObj === 'object') { for(var property in sourceObj) { if(sourceObj.hasOwnProperty(property) && typeof targetObj[property] === 'undefined') { targetObj[property] = sourceObj[property]; } } return targetObj; } return false; }, extendClass: function(sourceClass, targetClass) { var source = (typeof sourceClass === 'function')? sourceClass.prototype : sourceClass, target = (typeof targetClass === 'function')? targetClass.prototype : targetClass; if(typeof source === 'object' && typeof target === 'object') { var obj = this.createObject(source); this.extendObject(source, obj); for(var prop in target) { obj[prop] = target[prop]; } return obj; } return false; }, createObject: function(object) { if(typeof Object.create !== 'function') { var obj = function(){}; obj.prototype = object; return new obj(); } else { return Object.create(object); } }, createCallBack: function(obj, method, argArray) { if(typeof method === 'function') { argArray = argArray || []; return function() { return method.apply(obj, argArray); }; } else { return false; } }}; bpApp.htmlBuilder = function(){}; bpApp.htmlBuilder.prototype = { constructor: bpApp.htmlBuilder, create: function(nodeName, attrObject, container, prepend) { var filterProperty = function(prop) { switch(prop) { case 'class': prop = 'className'; break; } return prop; }; var removePrefix = function(prop) { if(typeof prop !== 'undefined') { if(prop.substring(0, 2) === 'on') { prop = prop.substring(2); } } return prop; }; var obj = document.createElement(nodeName); if(typeof attrObject === 'object') { for(var prop in attrObject) { var propName = filterProperty(prop), attrPropValue = attrObject[prop]; if(prop === 'innerHTML') { if(typeof attrPropValue !== 'undefined' && attrPropValue !== '') { var pattern = /<[a-z][\s\S]*>/i; if(pattern.test(attrPropValue)) { obj.innerHTML = attrPropValue; } else { obj.textContent = attrPropValue; } } } else if(prop.substring(0, 5) === 'data-') { jQuery(obj).data(prop, attrObject[prop]); } else { if(typeof attrObject[prop] !== 'undefined' && attrObject[prop] != '') { if(typeof attrObject[prop] === 'function') { propName = removePrefix(propName); jQuery(obj).on(propName, attrObject[prop]); } else { obj[propName] = attrObject[prop]; } } } } } try { if(prepend == true) { this.prepend(container, obj); } else { this.append(container, obj); } } catch(e) { console.log(obj); } return obj; }, append: function(parent, child) { if(typeof parent === "undefined") { parent = document.body; } else if(typeof parent === 'string') { parent = document.getElementById(parent); } if(typeof parent === 'object') { parent.appendChild(child); } return this; }, prepend: function(parent, child) { if(typeof parent === "undefined") { parent = document.body; } else if(typeof parent === 'string') { parent = document.getElementById(parent); } if(typeof parent === 'object') { parent.insertBefore(child, parent.firstChild); } return this; }, createObject: function(object, id, tmpClass, text, container, prepend) { var attr = { id: id, 'className': tmpClass, innerHTML: text }; return this.create(object, attr, container, prepend); }, createButton: function(type,id,tmpClass,text,callBackFn,container,prepend) { var attr = { id: id, 'className': tmpClass, innerHTML: text }; if(typeof callBackFn === 'function') { attr.onclick = callBackFn; } return this.create(type, attr, container, prepend); }, createLink: function(type,id,tmpClass,text,url,container,prepend) { var attr = { id: id, 'className': tmpClass, innerHTML: text }; if(url !== null) { attr.href = url; } return this.create(type, attr, container, prepend); }, createIframe: function(id, className, src, container, prepend) { var attr = { id: id, 'className': className }; if(typeof src !== 'undefined') { attr.src = src; } attr.width = '100%'; attr.height = '100%'; attr.frameBorder = "0"; return this.create('iframe', attr, container, prepend); }, createImage: function(id, tmpClass, src, alt, container, prepend) { var attr = { id: id, 'className': tmpClass }; if(typeof alt !== 'undefined') { attr.alt = alt; } if(typeof src !== 'undefined') { attr.src = src; } return this.create('img', attr, container, prepend); } }; var removeClassAndHide = function(obj, animationClass){ obj.style.display = 'none'; removeAnimationClass(obj, animationClass); }; var removeAnimationClass = function(obj, animationClass){ jQuery(obj).removeClass(animationClass); bpApp.animate.animating.remove(obj); }; bpApp.animate = { animating: { objects: [], add: function(object, className, timer) { this.stopPreviousAnimations(object); this.addObject(object, className, timer); }, addObject: function(object, className, timer) { if(object) { var animation = { object: object, className: className, timer: timer }; this.objects.push(animation); } }, remove: function(object) { var objectIndex = this.removeObject(object); }, removeObject: function(object, removeClass) { if(object) { var animating = this.checkAnimating(object); if(animating !== false) { var animations = animating; for(var i = 0, maxLength = animations.length; i < maxLength; i++) { var animation = animations[i]; this.stopTimer(animation); if(removeClass) { jQuery(animation.object).removeClass(animation.className); } var indexNumber = jQuery.inArray(animation, this.objects); if(indexNumber >= 0) { this.objects.splice(indexNumber, 1); } } } } }, stopTimer: function(animation) { if(animation) { var timer = animation.timer; window.clearTimeout(timer); } }, checkAnimating: function(obj) { var animationArray = []; for(var i = 0, maxLength = this.objects.length; i < maxLength; i++) { var animation = this.objects[i]; if(animation.object === obj) { animationArray.push(animation); } } return (animationArray.length >= 1)? animationArray : false; }, stopPreviousAnimations: function(obj) { this.removeObject(obj, 1); }, reset: function() { this.objects = []; } }, setupSelectingObject: function(object) { return (typeof object === 'string')? document.getElementById(object) : object; }, hide: function(object, animationClass, duration) { var obj = this.setupSelectingObject(object); jQuery(obj).addClass(animationClass); var callBack = bpApp.createCallBack(null, removeClassAndHide, [obj, animationClass]); var timer = window.setTimeout(callBack, duration); this.animating.add(obj, animationClass, timer); }, show: function(object, animationClass, duration) { var obj = this.setupSelectingObject(object); jQuery(obj).addClass(animationClass); obj.style.display = 'block'; var callBack = bpApp.createCallBack(null, removeAnimationClass, [obj, animationClass]); var timer = window.setTimeout(callBack, duration); this.animating.add(obj, animationClass, timer); }, set: function(object, animationClass, duration) { var obj = this.setupSelectingObject(object); jQuery(obj).addClass(animationClass); var callBack = bpApp.createCallBack(null, removeAnimationClass, [obj, animationClass]); var timer = window.setTimeout(callBack, duration); this.animating.add(obj, animationClass, timer); } }; bpApp.navigation = function(scrollContainer, container){ var navigation = bpApp.navigation; this.number = (typeof navigation.number === 'undefined')? navigation.number = 0 : (++navigation.number); this.id = 'navigation_panel_' + this.number; this.scrollContainer = scrollContainer; this.container = container; }; bpApp.navigation.prototype = bpApp.extendClass( bpApp.htmlBuilder, { constructor: bpApp.navigation, setup: function() { this.setupCurrentPage(); this.setupNav(); this.groups.selectPrimaryGroup(); }, setupGroups: function(optionsArray) { var self = this; this.groups = { lastSelectedGroup: null, options: [], createPanel: function() { var buttonBack = self.createButton('button', self.id + '_button_back', 'bttn back', '', '', 'main-nav-container'); }, addGroup: function(level, parent) { var container = self.scrollContainer, style = (level === 0)? 'primary' : 'sub-menu', number = (this.options.length); var groupPanel = self.createObject('div', self.id + '_nav_' + number + level, 'group-nav-container', '', self.scrollContainer); var navContainer = self.createObject('nav', self.id + '_nav_container', 'main-nav-container', '', groupPanel); var ul = self.createObject('ul', self.id + '_nav_ul_' + number + level, 'dropdown-menu ' + style, '', navContainer); var group = { level: level, parent: parent, element: groupPanel, list: ul, options: [], selected: false }; this.options.push(group); return group; }, reset: function() { this.lastSelectedGroup = null; this.options = []; this.optionNumber = 0; }, createGroup: function(optionsArray, level, parent) { level = level || 0; var group = this.addGroup(level, parent); var selected = false; if(typeof optionsArray !== 'undefined') { for(var i = 0, maxLength = optionsArray.length; i < maxLength; i++) { var element = optionsArray[i]; if(element) { var childOptions = element.querySelectorAll('#' + element.id + ' > ul > li'); var option = { element: element, number: this.optionNumber++, selected: 'no', pages: childOptions.length }; var childSelected = false; if(childOptions.length) { var data = this.createGroup(childOptions, (level + 1), group); childSelected = data.selected; group.options = childOptions; } option.child = (data)? data.group : null; var li = this.addOption(option, group.list, childSelected); if(selected !== true && option.selected === 'yes') { selected = true; } } } } return { group: group, selected: selected }; }, setup: function(optionsArray) { this.createPanel(); this.createGroup(optionsArray); }, createCallBack: function(group) { return bpApp.createCallBack(this, this.selectGroup, [group]); }, selectGroup: function(group) { if(group && typeof group === 'object') { if(group.selected === false) { group.selected = true; this.selectGroupPanel(group); this.updateBackButton(group); this.lastSelectedGroup = group; } } }, selectPrimaryGroup: function() { var groups = this.options; if(groups.length) { this.selectGroup(groups[0]); } }, getAnimationClass: function(lastNum, currentNum) { var animation = { selecting: 'pullRightIn', removing: 'pullLeft' }; if(lastNum === null) { animation.removing = 'no-change'; animation.selecting = 'no-change'; } else if(currentNum > lastNum) { animation.removing = 'pullLeft'; animation.selecting = 'pullRightIn'; } else if(currentNum < lastNum) { animation.removing = 'pullRight'; animation.selecting = 'pullLeftIn'; } return animation; }, selectGroupPanel: function(group) { var groups = this.options; var groupNumber = group.level; var lastOption = this.lastSelectedGroup, lastGroupNumber = (lastOption && typeof lastOption !== 'undefined')? lastOption.level: null, animations = this.getAnimationClass(lastGroupNumber, groupNumber); for(var i = 0, maxLength = groups.length; i < maxLength; i++) { var option = groups[i], panel = option.element; if(panel && group.element) { if(panel === group.element) { panel.style.zIndex = 5; var animationClass = animations.selecting; bpApp.animate.show(panel, animationClass, 800); } else { if(option === lastOption) { panel.style.zIndex = 4; var animationClass = animations.removing; bpApp.animate.hide(panel, animationClass, 1000); } else { panel.style.zIndex = 2; bpApp.animate.hide(panel, 'none', 0); } option.selected = false; } } } }, updateBackButton: function(group) { var button = document.getElementById(self.id + '_button_back'); if(group && typeof group.parent !== 'undefined') { button.onclick = bpApp.createCallBack(this, this.selectGroup, [group.parent]); button.style.visibility = 'visible'; } else { button.style.visibility = 'hidden'; } }, optionNumber: 0, addOption: function(option, container, childSelected) { container.appendChild(option.element); option.selected = (childSelected === true)? 'yes' : self.checkSelection(option); return this.addNavOption(option, container); }, addNavOption: function(option, container) { var element = option.element; if(option.selected === 'yes') { jQuery(element).addClass('selected'); } if(option.pages && option.child) { var a = element.querySelector('a'); if(a) { var callBack = this.createCallBack(option.child); a.onclick = function(e) { e.preventDefault(); callBack(); }; } } return option; } }; this.groups.setup(optionsArray); }, setupNav: function() { var currentPage = this.getCurrentPage(); var options = document.querySelectorAll('#' + this.scrollContainer + ' nav > ul > li'); this.setupGroups(options); }, checkSelection: function(option) { var currentPage = this.currentPage; currentPage = currentPage.split('&')[0]; var url = (typeof option.url === 'string')? option.url.replace('/', '') : null; if(url) { if(currentPage === url) { return 'yes'; } else if(!currentPage && url == '') { return 'yes'; } else if(currentPage === 'blog-post' && url === 'blog') { return 'yes'; } else { return 'no'; } } }, getCurrentPage: function() { var path = window.location.pathname; var pattern = /\//g; var pageSlashCount = path.match(pattern); if(pageSlashCount.length > 1) { var start = path.indexOf("/") + 1; var length = path.indexOf("/", 2) + 1; var end = length - start; var tmpLocation = path.substring(start, end); } else { var tmpLocation = path.substring(path.lastIndexOf("/") + 1); } return tmpLocation.replace("/", ""); }, setupCurrentPage: function() { this.currentPage = this.getCurrentPage(); }, getOptionStyle: function(tmpOption) { var optionStyle = (tmpOption.selected === 'yes')? 'nav-option selected' : 'nav-option'; return optionStyle; }, resetContainer: function() { var container = document.getElementById(this.container); if(container) { container.innerHTML = ''; } }});bpApp.slideController = function(container, onNumber) { var constructor = bpApp.slideController; this.number = (typeof constructor.number === 'undefined')? constructor.number = 0 : (++constructor.number); this.id = 'bp_slide_controller_' + this.number; this.animationMode = 'fade'; this.lastSelectedOption = null; this.onNumber = typeof onNumber !== 'undefined' ? onNumber: 0; this.optionsArray = []; this.timer = null; this.container = container; }; bpApp.slideController.prototype = bpApp.extendClass(bpApp.htmlBuilder, { constructor: bpApp.slideController, addKeyboardSupport: function() { var self = this; jQuery(document).on('keydown', function(e){ self.keyPress(e); }); }, keyPress: function(e) { var keyCode = e.keyCode; switch(keyCode) { case 37: this.selectPreviousOption(); break; case 39: this.selectNextOption(); break; } }, addOption: function(element) { var option = {}; var number = this.optionsArray.length; option.optionNumber = number; option.nameId = element.id; option.crumbId = this.id + '_crumb_number_' + number; option.selected = 'no'; this.optionsArray.push(option); this.createCrumb(option); }, resetContainer: function() { var container = document.getElementById(this.container); container.innerHTML = ''; }, setup: function() { this.setupControlPanel(); this.setupOptions(); this.addKeyboardSupport(); }, setupControlPanel: function() { var self = this; var button = this.createButton('a', '', 'arrow arrow_left', '', function(){ self.selectPreviousOption(); }, this.container); button = this.createButton('a', '', 'arrow arrow_right', '', function(){ self.selectNextOption(); }, this.container); var numberContainer = this.createObject('div', this.id + '_crumb_container', 'number_crumb_container', '', this.container); var slideTab = this.createObject('div', this.id + '_slide_tab', 'slideTab', '', numberContainer); }, selectPrimaryOption: function() { if(typeof this.onNumber !== 'undefined') { this.selectOptionByNumber(this.onNumber); } else { this.selectNewPanel(); } }, setupOptions: function() { var container = typeof this.container === 'object'? this.container : document.getElementById(this.container); if(!container) { return false; } var optionsArray = container.querySelectorAll('.splash_container'); var maxLength = optionsArray.length; if(maxLength > 0) { var tmpNumber = 0; for(var i = 0; i < maxLength; i++) { var tmpOption = optionsArray[i]; this.addOption(tmpOption); } } this.selectPrimaryOption(); }, getAnimation: function() { var animations = ['pullLeftIn', 'pullRightIn']; var animationNumber = Math.round(Math.random() * (animations.length - 1)); return animations[animationNumber]; }, createCrumb: function(tmpOption) { var self = this; var crumbContainer = this.id + '_crumb_container'; var optionClass = this.getCrumbClass(tmpOption); var option = this.createButton('div', tmpOption.crumbId, optionClass, tmpOption.crumbContent, function(){ self.selectOption(tmpOption); }, crumbContainer); }, getCrumbClass: function(tmpOption) { return (tmpOption.selected === 'yes')? 'option selected' : 'option'; }, selectNewPanel: function() { if(this.onNumber < (this.optionsArray.length - 1) && this.onNumber != null) { this.onNumber++; } else { this.onNumber = 0; } this.selectOptionByNumber(this.onNumber); }, getPanelClass: function(lastNum, currentNum) { var animation = { selecting: 'same', removing: '' }; var mode = this.animationMode || 'fade'; if(mode === 'left_right') { if(currentNum > lastNum) { animation.removing = 'pullLeft'; animation.selecting = 'pullRightIn'; } else if(currentNum < lastNum) { animation.removing = 'pullRight'; animation.selecting = 'pullLeftIn'; } } else { animation.removing = 'fadeOut'; animation.selecting = 'fadeIn'; } return animation; }, getPanelAnimations: function() { var selection = this.getSelectedOption(); var panelNumber = selection.optionNumber; var lastPanelNumber = (typeof this.lastSelectedOption !== 'undefined')? jQuery.inArray(this.lastSelectedOption, this.optionsArray): 0; return this.getPanelClass(lastPanelNumber, panelNumber); }, selectPanel: function(tmpOption) { var animations = this.getPanelAnimations(); for(var i = 0, maxLength = this.optionsArray.length; i < maxLength; i++) { var option = this.optionsArray[i], nameId = option.nameId, panel = document.getElementById(nameId); if(panel) { if(tmpOption.nameId === nameId) { panel.style.zIndex = 2; panel.style.position = (this.setAsBg === true)? 'absolute' : 'relative'; bpApp.animate.show(panel, animations.selecting, 1000); } else { if(this.lastSelectedOption && this.lastSelectedOption.nameId === nameId) { panel.style.zIndex = 1; panel.style.position = 'absolute'; panel.style.top = '0px'; bpApp.animate.hide(panel, animations.removing, 1000); } } } var crumbId = option.crumbId; if(typeof crumbId !== 'undefined') { var crumbClass = this.getCrumbClass(option), crumb = document.getElementById(crumbId); if(crumb) { crumb.className = crumbClass; } } } }, getNextOption: function() { var lastSelectedOption = (this.lastSelectedOption !== null)? this.lastSelectedOption.optionNumber : 0; var nextOptionNumber = ++lastSelectedOption; var index = (nextOptionNumber < this.optionsArray.length)? nextOptionNumber : 0; return this.optionsArray[index]; }, selectNextOption: function() { var nextOption = this.getNextOption(); if(nextOption) { this.selectOption(nextOption); } }, getPreviousOption: function() { var lastSelectedOption = (this.lastSelectedOption !== null)? this.lastSelectedOption.optionNumber : 0; var previousOptionNumber = --lastSelectedOption; var index = (previousOptionNumber >= 0)? previousOptionNumber : (this.optionsArray.length - 1); return this.optionsArray[index]; }, selectPreviousOption: function() { var previousOption = this.getPreviousOption(); if(previousOption) { this.selectOption(previousOption); } }, setLastSelectedOption: function(option) { this.lastSelectedOption = option; }, unselectOption: function(tmpOption) { for(var j = 0, maxLength = this.optionsArray.length; j < maxLength; j++) { var option = this.optionsArray[j]; if(option !== tmpOption) { if(option.selected === 'yes') { option.selected = 'no'; } } } }, moveSlideTab: function(e) { var offset = jQuery(e).position(); var slideTab = jQuery('#' + this.id + '_slide_tab').css('left', offset.left + 'px'); }, selectOption: function(tmpOption) { this.stopTimer(); var object = document.getElementById(tmpOption.nameId); var slideTab = document.getElementById(tmpOption.crumbId); if(slideTab) { this.moveSlideTab(slideTab); } if(tmpOption.selected === 'no') { tmpOption.selected = 'yes'; this.onNumber = jQuery.inArray(tmpOption, this.optionsArray); } else { tmpOption.selected = 'no'; } this.unselectOption(tmpOption); this.selectPanel(tmpOption); this.setLastSelectedOption(tmpOption); this.startTimer(); }, selectOptionByNumber: function(index) { var option = this.optionsArray[index]; if(option) { this.selectOption(option); } }, getSelectedOption: function() { for(var j = 0, maxLength = this.optionsArray.length; j < maxLength; j++) { var option = this.optionsArray[j]; if(option.selected === 'yes') { return option; } } return false; }, duration: 7000, startTimer: function() { var self = this; this.stopTimer(); this.timer = window.setTimeout(function(){ self.selectNewPanel(); }, this.duration); }, stopTimer: function() { window.clearTimeout(this.timer); }}); bpApp.slideShow = function(container, defaultPathUrl, setAsBg, onNumber) { console.log(1); var constructor = bpApp.slideShow; this.number = (typeof constructor.number === 'undefined')? constructor.number = 0 : (++constructor.number); this.id = 'bp_spotlight_' + this.number; this.defaultPathUrl = (defaultPathUrl)? defaultPathUrl : '/slideshow/'; this.setAsBg = (setAsBg)? setAsBg : false; this.animationMode = 'fade'; this.lastSelectedOption = null; this.onNumber = typeof onNumber !== 'undefined' ? onNumber: null; this.optionsArray = []; this.timer = null; this.container = container; }; bpApp.slideShow.prototype = bpApp.extendClass(bpApp.slideController, { constructor: bpApp.slideShow, addOption: function(option) { var number = this.optionsArray.length; option.optionNumber = number; option.nameId = this.id + '_option_number_' + number; option.crumbId = this.id + '_crumb_number_' + number; option.selected = 'no'; this.optionsArray.push(option); this.createCrumb(option); var panel = this.createOptionPanel(option,this.container); }, setupOptions: function(optionsArray) { var maxLength = optionsArray.length; if(maxLength > 0) { var tmpNumber = 0; for(var i = 0; i < maxLength; i++) { var tmpOption = optionsArray[i]; this.addOption(tmpOption); } } this.selectPrimaryOption(); }, setup: function(optionsArray) { this.resetContainer(); this.setupControlPanel(); this.setupOptions(optionsArray); this.addKeyboardSupport(); }, createOptionPanel: function(tmpOption, container) { if(tmpOption && tmpOption.url) { container = this.createLink('a','','','',tmpOption.url,container); } var spotlightContainer = this.createObject('div', tmpOption.nameId, 'splash_container', '', container); spotlightContainer.onmouseover = bpApp.createCallBack(this, this.stopTimer); spotlightContainer.onmouseout = bpApp.createCallBack(this, this.startTimer); spotlightContainer.style.display = 'none'; var imageURL = tmpOption.image; if(this.setAsBg == true) { if(imageURL) { spotlightContainer.style.backgroundImage = 'url(' + wpThemeUrl + this.defaultPathUrl + imageURL + ')'; } } else { if(imageURL) { var imageContainer = this.createObject('div','','image_container','',spotlightContainer); var image = this.createImage('','',wpThemeUrl + this.defaultPathUrl + imageURL,tmpOption.alt,imageContainer); } } var articleContainer = this.createObject('article', '', 'content_container ' + tmpOption.className, '', spotlightContainer); var animation = this.getAnimation(); var sectionContainer = this.createObject('section', '', 'spotlight dark ' + animation, '', articleContainer); var h2 = this.createObject('h2', '', 'title_text blue', tmpOption.title, sectionContainer); var text = this.createObject('div', '', 'light', tmpOption.content, sectionContainer); }}); var spotlightPanel = bpApp.slideShow;bpApp.officeSlideController = function(container, onNumber) { var constructor = bpApp.officeSlideController; this.number = (typeof constructor.number === 'undefined')? constructor.number = 0 : (++constructor.number); this.id = 'bp_slide_controller_' + this.number; this.animationMode = 'fade'; this.lastSelectedOption = null; this.onNumber = typeof onNumber !== 'undefined' ? onNumber: 0; this.optionsArray = []; this.timer = null; this.container = container; }; bpApp.officeSlideController.prototype = bpApp.extendClass(bpApp.slideController, { constructor: bpApp.officeSlideController, getPanelClass: function(lastNum, currentNum) { var animation = { selecting: 'same', removing: '' }; var mode = this.animationMode || 'fade'; if(mode === 'left_right') { if(currentNum > lastNum) { animation.removing = 'pullLeft'; animation.selecting = 'pullRightIn'; } else if(currentNum < lastNum) { animation.removing = 'pullRight'; animation.selecting = 'pullLeftIn'; } } else { animation.removing = 'fadeOut'; animation.selecting = 'slideDown'; } return animation; }, getAnimation: function() { var animations = ['pullLeftIn', 'pullRightIn']; var animationNumber = Math.round(Math.random() * (animations.length - 1)); return animations[animationNumber]; } }); bpApp.lazyAnimator = function(attrName, cacheElements) { this.attrName = (typeof attrName === 'string')? attrName : 'data-animate'; this.cacheElements = cacheElements === true? true : false; this.elements = []; this.setup(); }; bpApp.lazyAnimator.prototype = { constructor: bpApp.lazyAnimator, setup: function() { this.setupEvents(); this.update(); return this; }, update: function() { this.elements = this.getElements(); this.checkScroll(); return this; }, removeElement: function(element) { var index = jQuery.inArray(element, this.elements); if(index > -1) { this.elements.splice(index, 1); } return this; }, getElements: function() { var elements; try { elements = document.querySelectorAll('[' + this.attrName + ']:not(.animated)'); } catch(e) {} if(elements) { return Array.prototype.slice.call(elements); } return []; }, checkScroll: function() { var optionsArray = (this.cacheElements === true)? this.elements : this.getElements(); if(optionsArray.length) { var viewPortTop = jQuery(document).scrollTop(); var viewPortBottom = jQuery(window).height() + viewPortTop; for(var i = 0, maxLength = optionsArray.length; i < maxLength; i++) { var element = optionsArray[i]; if(element) { var ele = jQuery(element); var optionDelay = ele.data('delay'); var delay = optionDelay !== null? optionDelay : 20; var position = ele.offset(); var optionTop = position.top + delay; var optionBottom = position.top + ele.height(); if(optionTop < viewPortBottom && optionTop >= viewPortTop) { this.animate(element); } else if(optionBottom >= viewPortTop && optionBottom <= viewPortBottom) { this.animate(element); } } } } return this; }, animate: function(element) { var ele = jQuery(element); var animation = ele.attr(this.attrName); animation = animation || 'pullUp'; ele.addClass(animation); ele.addClass('animated'); this.removeElement(element); return this; }, setupEvents: function() { var ele = jQuery(window); var self = this; var callBack = function() { self.checkScroll(); }; this.addEvents = function() { ele.on('scroll', callBack); }; this.removeEvents = function() { ele.off('scroll', callBack); }; this.addEvents(); return this; } }; bpApp.scrollHeader = function(header, miniHeaderClass, distance) { this.header = (typeof header === 'string')? document.getElementById(header) : header; this.miniClassName = miniHeaderClass; this.headerMinified = false; this.distance = (typeof distance !== 'undefined')? distance : 300; this.setup(); }; bpApp.scrollHeader.prototype = { constructor: bpApp.scrollHeader, setup: function() { var header = this.header; if(!header) { return false; } this.checkScroll(); this.addScroll(); }, addScroll: function() { var child = this; var tmpFunction = function(){ child.checkScroll(); }; jQuery(window).on('scroll', tmpFunction); jQuery(window).on('resize', tmpFunction); }, checkScroll: function() { var wind = jQuery(window); var scrollTop = wind.scrollTop(), documentHeight = (jQuery(document).height() - wind.height()); if(scrollTop >= this.distance) { if(this.headerMinified === false) { jQuery(this.header).addClass(this.miniClassName); this.headerMinified = true; } } else { if(this.headerMinified === true) { this.headerMinified = false; jQuery(this.header).removeClass(this.miniClassName); } } }, scrollToTop: function() { window.scrollTo(window.scrollX, 0); }}; bpApp.videoPanel = function(video, callbackFunction, container){ this.number = (typeof bpApp.videoPanel.number === 'undefined')? bpApp.videoPanel.number = 0 : (++bpApp.videoPanel.number); this.id = 'video_panel_' + this.number; this.video = video; this.callbackFunction = callbackFunction; this.container = container; }; bpApp.videoPanel.prototype = bpApp.extendClass( bpApp.htmlBuilder, { constructor: bpApp.videoPanel, remove: function() { var panel = document.getElementById(this.id); if(panel) { panel.parentNode.removeChild(panel); } panel = document.getElementById(this.id + '_shadow'); if(panel) { panel.parentNode.removeChild(panel); } }, createPanel: function() { var panel = this.createObject('div', this.id, 'panel video-panel slideIn', '', this.container); var title = this.createObject('div', this.id + '_title_container', 'title-container', '', this.id); var titleLabel = this.createObject('h1', '', 'title title-text left dark', this.video.title, title); var container = this.createObject('div', '', 'body-container', '', this.id); var self = this; window.setTimeout(function(){ self.createIframe(self.id + '_iframe', '', self.video.source, container); }, 500); var buttons = this.createObject('div', this.id + '_button_container', 'button-container', '', this.id); var button1 = this.createButton('button', this.id + '_button_1', 'bttn bttn-decline', 'Close', function(){ self.decline(); }, buttons); }, setup: function() { this.createPanel(); }, decline: function() { this.display(); }, display: function() { this.toggleDisplay(); }, createShadow: function() { var self = this; var backdrop = this.createButton('div', this.id + '_shadow','panel-shadow video-shadow fadeIn','', function(){ self.decline(); }, document.body); this.createButton('button', '', 'bttn top close', '', '', backdrop); }, toggleMode: null, toggleDisplay: function() { var obj = document.getElementById(this.id); var display = obj.style.display; if(!display || display === 'none') { obj.style.display = 'block'; this.toggleMode = 'block'; this.createShadow(); } else { obj.style.display = 'none'; this.toggleMode = 'none'; this.remove(); } } }); bpApp.localData = { storage: null, setup: function() { this.supported = this.checkSupport(); if(this.supported === true) { this.storage = window.localStorage; } }, supported: false, checkSupport: function() { if(typeof window.Storage !== "undefined" && window.localStorage) { return true; } return false; }, get: function(key) { if(this.supported === true) { var value = this.storage.getItem(key); if(typeof value !== 'undefined') { return JSON.parse(value); } } return null; }, set: function(key, value) { if(this.supported === true) { value = JSON.stringify(value); this.storage.setItem(key, value); } }, clear: function() { if(this.supported === true) { this.storage.clear(); } }}; bpApp.formValidator = { errorClass: 'error_val', acceptedClass: 'success_val', isValidEmail: function(email) { var regExp = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return regExp.test(email); }, isValidPhone: function(phone) { var pattern = /[^0-9]/g; phone = phone.toString().replace(pattern, ''); if(!isNaN(phone)) { if(phone.substr(0, 1) === '1') { phone = phone.substring(1); } if(phone.length == 10 && phone.substr(0, 3) !== '555') { return true; } } return false; }, isValidDate: function(date) { if(typeof date !== 'undefined') { var result = new Date(date).toDateString(); if(result != 'Invalid Date') { return true; } } return false; }, isRadioChecked: function(groupName) { if(typeof groupName !== 'undefined') { var radios = document.getElementsByName(groupName); if(radios && radios.length) { for(var i = 0, maxLength = radios.length; i < maxLength; i++) { var radio = radios[i]; if(radio.type === 'radio' && radio.checked) { return true; } } } } return false; }, isValidField: function(val) { if(typeof val !== 'undefined' && val != '') { return true; } return false; }, validateForm: function(form) { var self = this; var errors = { number: 0, message: '' }; var updateError = function(field) { var upperCaseWords = function(str) { var pattern = /\w\S*/g; return str.replace(pattern, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); }; var fieldName = field.attr('name') || field.attr('id'); if(fieldName) { var pattern = /[^a-zA-Z1-9]/g; fieldName = fieldName.replace(pattern, ' '); fieldName = upperCaseWords(fieldName); } errors.number++; errors.message += fieldName + " is empty or invalid.
- Rhonda M.
