acids | Family Dental of Roscoe Company Mission & Vision The Doctors Locations Family Dental of Lincoln Family Dental of Roscoe Dental Services Orthodontics Children’s Dentistry Cosmetic Dentistry Dental Bridges Dental Checkups Dental Crowns Dental Fillings Dental Implants Root Canal Therapy Teeth Whitening Tooth Extractions Information Blog Insurance & Financing Specials The Smiles Card Reviews Registration Contact like us: Click Here to Request an Appointment! Company Mission & Vision The Doctors Locations Family Dental of Lincoln Family Dental of Roscoe Dental Services Orthodontics Children’s Dentistry Cosmetic Dentistry Dental Bridges Dental Checkups Dental Crowns Dental Fillings Dental Implants Root Canal Therapy Teeth Whitening Tooth Extractions Information Blog Insurance & Financing Specials The Smiles Card Reviews Registration Contact Achieve Optimum Holiday Health with Dental Erosion Prevention Posts Tagged: acids Achieve Optimum Holiday Health with Dental Erosion Prevention Posted December 20, 2017 by & filed under Uncategorized. Your smile is extremely precious, and at the same time extremely susceptible to damage. Beyond instantaneous damage that can arise due to oral accidents or injuries, microscopic damage can also occur to your tooth enamel without you being aware of it. Harmful acids in your mouth caused by plaque and bacteria can eat away at… Read more » Recent Posts Tips To Help You Feel Calm and Relaxed at Your Next Dental Appointment Floss Your Way to a Healthier Mouth and a Healthier Body! June 17th Is National Teeth Whitening Day, and We Are Here for It! Smiling and Laughing Are Good for Your Mouth, Mood, and Body! Spring Is a Great Time To Replace Missing Teeth With Dental Implants and Complete Your Smile The Company Our Services Company The Doctors Locations Dental Services Information Registration Contact Patients Insurance & Financing Registration Reviews Specials Orthodontics Cosmetic Dentistry Dental Checkups Location 3332 N. Western Ave Chicago, IL 60618 T: (773) 327-6500 Affiliate Locations Family Dental of Lincoln 5206 N Lincoln Ave Chicago, IL 60625 T: 773 561 5106 Copyright 2022 © Family Dental of Roscoe. All rights reserved. Website Design by × Request an Appointment Are you a current patient? Yes No Send Your request has been sent -- we will be in contact with you shortly. There was an error! Please phone our office. Close ",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0()[\]\\.,;:\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; }, isSelectValid: function(element) { if(element) { var options = element.options, selectedIndex = element.selectedIndex; if(options.length && typeof selectedIndex !== 'undefined') { var selection = options[selectedIndex]; if(selection) { var value = selection.getAttribute('value'); if(value !== null && value !== '') { 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. "; }; if(typeof form == 'object') { var previousRadios = []; jQuery(form).find('input.val, select.val, textarea.val').each(function(i) { var field = jQuery(this); var node = field[0]; var nodeName = node.nodeName.toLowerCase(); var validField; if(nodeName === 'input' && field.attr('type') === 'radio') { var groupName = field[0].name; if(jQuery.inArray(groupName, previousRadios) == '-1') { previousRadios.push(groupName); validField = self.isRadioChecked(groupName); if(validField === false) { updateError(field); } } } else { validField = self.validateField(field); if(validField === false) { updateError(field); } } }); } return errors; }, validateField: function(field) { var self = this; var showValidateStyle = function(field, isValid) { if(isValid == true) { field.removeClass(self.errorClass); field.addClass(self.acceptedClass); return true; } else { field.addClass(self.errorClass); field.removeClass(self.acceptedClass); return false; } }; var returnValue = false; field = jQuery(field); if(field) { var val = field.val(); var placeholder = field.attr('placeholder') || field.attr('alt'); var node = field[0]; var nodeName = node.nodeName.toLowerCase(); var validField; var type = field.attr('type'); if(type === 'checkbox') { validField = field.is(':checked'); returnValue = showValidateStyle(field, validField); } if(nodeName === 'select') { validField = self.isSelectValid(node); returnValue = showValidateStyle(field, validField); } else if(!self.isValidField(val) || val === placeholder) { returnValue = showValidateStyle(field, false); } else if(field.hasClass('field_email') || type === 'email') { validField = self.isValidEmail(val); returnValue = showValidateStyle(field, validField); } else if(field.hasClass('field_phone') || type === 'tel') { validField = self.isValidPhone(val); returnValue = showValidateStyle(field, validField); } else if(field.hasClass('field_date') || type === 'date') { validField = self.isValidDate(val); returnValue = showValidateStyle(field, validField); } else { returnValue = showValidateStyle(field, true); } } return returnValue; }, resetForm: function(form) { if(form && typeof form === 'object') { var elements = form.elements; if(elements) { for(var i = 0, maxLength = elements.length; i < maxLength; i++) { var element = elements[i]; this.removeStyles(element); } } } }, removeStyles: function(field) { var field = jQuery(field); if(field) { field.removeClass(this.errorClass); field.removeClass(this.acceptedClass); } } }; bp.formLayout = function(bttnClassName) { this.bttnClassName = (typeof bttnClassName !== 'undefined')? bttnClassName : 'bp-submit-button'; }; bp.formLayout.prototype = (function() { var addFormEvents = function(form) { if(form && typeof form === 'object') { jQuery(form).find('input.val, select.val, textarea.val').each(function(i) { var field = jQuery(this); var placeholder = field.attr('placeholder') || field.attr('alt'); field.focus(function() { bp.formValidator.removeStyles(field); var val = this.value; if(val == placeholder) { field.val(''); } }); field.blur(function(e) { var node = field[0]; var val = this.value; if(val === null || val === '') { this.value = placeholder; } bp.formValidator.validateField(field); }); }); jQuery(form).find('input[type="file"]').each(function(i) { var field = jQuery(this); field.change(function(evt){ files.onchange(evt); }); }); } }; var files = { list: [], onchange: function(evt) { evt = evt || window.event; if(evt) { var element = evt.target || evt.srcElement; var fileList = evt.target.files; this.add(element, fileList); } }, add: function(element, fileList) { this.remove(element); this.list.push({ element: element, files: fileList }); }, getFilesByElement: function(element) { var index = this.getIndex(element); if(index !== false) { var savedElement = this.list[index]; return savedElement.files; } return false; }, getIndex: function(element) { var files = this.list; if(files.length) { for(var i = 0, maxLength = files.length; i < maxLength; i++) { if(element === files[i].element) { return i; } } } return false; }, remove: function(element) { var index = this.getIndex(element); if(index !== false) { this.list.splice(index, 1); } } }; return { setup: function() { this.addEvents(); return this; }, addEvents: function() { this.addButtonEvents(); this.addFormEvents(); return this; }, getButtonsByButtonClass: function() { var bttns = document.querySelectorAll('.' + this.bttnClassName); return bttns; }, addFormEvents: function() { var bttns = this.getButtonsByButtonClass(); if(bttns) { for(var i = 0, maxLength = bttns.length; i < maxLength; i++) { var bttn = bttns[i]; if(bttn.form) { var form = bttn.form; addFormEvents(form); } } } return this; }, addButtonEvents: function() { var self = this; var bttns = this.getButtonsByButtonClass(); if(bttns) { var createClickEvent = function(bttn) { bttn.onclick = function() { self.saveForm(bttn); }; }; for(var i = 0, maxLength = bttns.length; i < maxLength; i++) { var bttn = bttns[i]; jQuery(bttn).attr('data-form-button', 'true'); createClickEvent(bttn); } } return this; }, getFormElements: function(form) { if(form && typeof form === 'object') { var elements = form.elements; if(elements) { return elements; } } return false; }, saveForm: function(buttonObj) { var self = this; var formUploader = { getParams: function(form) { var radioValue = 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 == true) { return radio.value; } } } } return null; }; var formParams = new FormData(); var previousRadios = []; var elements = self.getFormElements(form); if(elements) { for(var i = 0, maxLength = elements.length; i < maxLength; i++) { var element = elements[i], name = element.name || element.id, value = element.value, nodeName = element.nodeName.toLowerCase(), type = (nodeName !== 'input')? nodeName : element.type; if(nodeName === 'input' && type === 'radio') { if(jQuery.inArray(name, previousRadios) == '-1') { previousRadios.push(name); value = radioValue(name); formParams.append(name, value); } } else if(nodeName === 'input' && type === 'checkbox') { value = (element.checked == true)? true : false; formParams.append(name, value); } else if(nodeName === 'input' && type === 'file') { value = (element.checked == true)? true : false; var formFiles = files.getFilesByElement(element); if(formFiles !== false) { for(var j = 0, filesMax = formFiles.length; j < filesMax; j++) { formParams.append(name + '_' + j, formFiles[j]); } } } else { formParams.append(name, value); } } } formParams.append('action', 'bp_form_submit'); return formParams; }, getParamsByCollections: function(form) { var radioValue = function(groupName) { if(typeof groupName !== 'undefined') { var radios = form.querySelectorAll('[name="' + 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 == true) { return radio.value; } } } } return null; }; var previousRadios = []; var params = { data: [], add: function(element) { var addDataToCollection = function(collection, data) { if(typeof collection === 'object') { addData(collection.elements, data); } }; var addData = function(array, data) { if(array && typeof data === 'object') { array.push(data); } }; var data = this.setupElementObj(element); if(data !== false) { if(data.nodeName === 'fieldset' || data.collection != null) { var collectionLabel = (data.nodeType === 'fieldset')? data.label : data.collection; var collection = this.isCollectionSetup(collectionLabel); if(collection === false) { collection = this.createCollection(data); } else { addDataToCollection(collection, data); } } else { addData(this.data, data); } } }, getData: function() { var form = new FormData(); var addFilesToForm = function(formData) { if(typeof formData === 'object') { var data = []; for(var i = 0, maxLength = formData.length; i < maxLength; i++) { var element = formData[i]; if(element.elements) { addFilesToForm(element.elements); } else { if(element.type === 'file') { for(var h = 0, elementMaxLength = element.files.length; h < elementMaxLength; h++) { var file = element.files[h]; form.append(file.name, file.value); } } } } } }; var dataArray = this.data.slice(0); if(dataArray) { addFilesToForm(dataArray); form.append('form', JSON.stringify(dataArray)); } return form; }, createCollection: function(data) { var collection = data; collection.elements = []; this.data.push(collection); return collection; }, setupElementObj: function(element) { var nodeName = element.nodeName.toLowerCase(); var jqObj = jQuery(element); var data = { name: element.name || element.id, label: jqObj.attr('alt') || element.placeholder || jQuery('label[for="' + element.id + '"]').html() || element.name || element.id, value: element.value, nodeName: nodeName, type: (nodeName !== 'input')? nodeName : element.type, size: jqObj.data('size'), collection: null }; if(jQuery(element).closest('fieldset')) { var fieldset = jQuery(element).closest('fieldset')[0]; if(fieldset && fieldset !== element) { data.collection = this.getFieldsetLabel(fieldset); } } if(data.nodeName === 'input' && element.type === 'radio') { if(jQuery.inArray(data.name, previousRadios) == '-1') { previousRadios.push(element.name); data.value = radioValue(element.name); } else { return false; } } else if(data.nodeName === 'input' && element.type === 'checkbox') { if(typeof element.value !== 'undefined' && element.value !== 'on') { data.label += ' ' + element.value; } data.value = (element.checked == true)? 'Yes' : 'No'; } else if(data.nodeName === 'input' && element.type === 'file') { data.files = []; var formFiles = files.getFilesByElement(element); if(formFiles !== false) { for(var j = 0, maxLength = formFiles.length; j < maxLength; j++) { var file = { name: data.name + '_' + j, value: formFiles[j] }; data.files.push(file); } } } else if(data.nodeName === 'fieldset') { var label = this.getFieldsetLabel(element); data.subCollection = (data.nodeName === 'fieldset' && data.collection)? true : false; data.label = label; data.value = label; } else if(data.nodeName === 'select') { } else { var placeholder = element.placeholder; if(placeholder) { data.value = (element.value !== placeholder)? element.value : ''; } } return data; }, getFieldsetLabel: function(element) { var elmnt = jQuery(element); var label = elmnt.find('legend:first-child'); if(label) { label = label[0]; } return elmnt.data('title') || ((label)? label.innerHTML : false) || element.id || element.name || ''; }, getCollection: function(collectionLabel) { var getCollection = function(array, collectionLabel) { var collection = false; if(typeof array === 'object') { for(var i = 0, maxLength = array.length; i < maxLength; i++) { var row = array[i]; if(typeof row === 'object') { if(row.label === collectionLabel) { collection = array[i]; break; } if(row.elements) { collection = getCollection(row.elements, name); } } } } return collection; }; if(collectionLabel) { return getCollection(this.data, collectionLabel); } return false; }, isCollectionSetup: function(label) { var collection = this.getCollection(label); if(collection !== false) { return collection; } else { return false; } } }; var elements = self.getFormElements(form); if(elements) { for(var i = 0, maxLength = elements.length; i < maxLength; i++) { params.add(elements[i]); } } var formParams = params.getData(); formParams.append('action', 'bp_form_submit'); var formName = form.querySelectorAll('[name="bp_form_name"]'); if(formName) { formParams.append('bp_form_name', formName[0].value || ''); } var getUploadId = function() { var value = ""; var uploadId = form.querySelector('#bp_upload_id'); if(uploadId) { var data = jQuery(uploadId).data('values'); if(data && data !== '') { var idArray = data.split(' '); if(idArray && idArray.length) { for(var i = 0, maxLength = idArray.length; i < maxLength; i++) { var id = idArray[i]; var element = form.querySelector('#' + id); if(element) { if(i !== 0) { value += " "; } value += element.value; } } } } } return value; }; var getDataMode = function() { var value = "private"; var ele = form.querySelector('#bp_data_mode'); if(ele) { var data = jQuery(ele).data('value'); if(data && data !== '') { value = data; } } return value; }; var dataMode = getDataMode(); formParams.append('bp_data_mode', dataMode); var value = getUploadId(); formParams.append('bp_upload_id', value); return formParams; }, save: function(form) { var child = this; var validate = bp.formValidator.validateForm(form); if(validate.number === 0) { var params = this.getParamsByCollections(form); bp.ajax.request('bp_form_submit', params, function(data, textStatus, XMLHttpRequest) { data = (data)? JSON.parse(data) : null; if(data) { if(data.error === 'no' && data.status !== 'not_added') { if(data.error === 'no') { var url = document.getElementById('bp_redirect_url'); if(url) { var location = window.location; window.location = '//' + location.host + url.value; } else { var message = 'Thank You for completing this information. Your form has been securely submitted. See you soon!'; self.addAlert(message, 'alert-success'); } child.resetForm(form); } else { var message = 'There was an error saving the form. Please call our Office'; self.addAlert(message); } } } else { var message = 'There was an error saving the form. Please call our Office'; self.addAlert(message); } }); } else { var message = validate.message; self.addAlert(message); } }, resetForm: function(form) { if(form && typeof form === 'object') { form.reset(); bp.formValidator.resetForm(form); } } }; if(typeof buttonObj === 'object') { if(buttonObj.form) { var form = buttonObj.form; formUploader.save(form); } } return this; }, previousAlert: null, addAlert: function(message, type) { var self = this; type = (typeof type !== 'undefined')? type : 'alert-danger'; var alertPanelNumber = 0; var alertPanel = function() { this.id = 'alert_panel_' + alertPanelNumber; this.number = alertPanelNumber++; var panel = this; this.timer = null; this.setup = function() { this.create(); this.addEvents(); this.addTimer(); }; this.addEvents = function() { var obj = jQuery('#' + panel.id); obj.on('mouseout', function() { panel.addTimer(); }); obj.on('mouseover', function() { panel.removeTimer(); }); }; this.create = function() { var overlay = document.createElement('div'); overlay.id = panel.id + '_overlay'; overlay.className = 'overlay-panel fadeInSlow'; overlay.onclick = function(){panel.remove(); }; var title = (type === 'alert-success')? 'All Done' : 'Please complete the fields listed below'; var a = document.createElement('div'); a.id = panel.id; a.className = 'alert ' + type + ' alert-panel dropInBounce'; a.role = 'alert'; a.innerHTML = ' ' + '' + title + ':' + 'Close' + ' ' + ' ' + message; var bdy = document.body; bdy.appendChild(a); bdy.appendChild(overlay); var bttn = jQuery('#' + panel.id + '_close')[0]; if(bttn) { bttn.onclick = function(){panel.remove(); }; } }; this.remove = function() { panel.removeTimer(); var bdy = document.body; var obj = document.getElementById(panel.id); if(bdy && obj) { var overlay = document.getElementById(panel.id + '_overlay'); bdy.removeChild(overlay); bdy.removeChild(obj); } self.previousAlert = null; }; this.addTimer = function() { panel.removeTimer(); panel.timer = window.setTimeout(function(){ panel.remove(); }, 5500); }; this.removeTimer = function() { window.clearTimeout(panel.timer); }; }; if(!self.previousAlert) { self.previousAlert = new alertPanel(); self.previousAlert.setup(); } return this; } }; })(); jQuery(window).on('load', function() { "use strict"; var bpFormObj = new bp.formLayout(); bpFormObj.setup(); }); !function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:' ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:' '}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:' ',item:' ',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); var imgSizer = { Config:{ imgCache:[], spacer:"/path/to/your/spacer.gif" }, collate:function(aScope){ var isOldIE=(document.all&&!window.opera&&!window.XDomainRequest)?1:0; if(isOldIE&&document.getElementsByTagName){ var c=imgSizer;var imgCache=c.Config.imgCache; var images=(aScope&&aScope.length)?aScope:document.getElementsByTagName("img"); for(var i=0;i 0) $(thisObj).addClass('label'); if (num == 2) $(thisObj).addClass('label label-info'); if (num > 2 && num < 4) $(thisObj).addClass('label label-success'); if (num >= 5 && num < 10) $(thisObj).addClass('label label-warning'); if (num >=10) $(thisObj).addClass('label label-important'); } } else $(thisObj).addClass('label'); return true; } jQuery(document).ready(function($) { $("#tag-cloud a").each(function() { addTwitterBSClass(this); return true; }); $("p.tags a").each(function() { addTwitterBSClass(this); return true; }); $("ol.commentlist a.comment-reply-link").each(function() { $(this).addClass('btn btn-success btn-mini'); return true; }); $('#cancel-comment-reply-link').each(function() { $(this).addClass('btn btn-danger btn-mini'); return true; }); $('article.post').hover(function(){ $('a.edit-post').show(); },function(){ $('a.edit-post').hide(); }); $('[placeholder]').focus(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); input.removeClass('placeholder'); } }).blur(function() { var input = $(this); if (input.val() == '' || input.val() == input.attr('placeholder')) { input.addClass('placeholder'); input.val(input.attr('placeholder')); } }).blur(); $('[placeholder]').parents('form').submit(function() { $(this).find('[placeholder]').each(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); } }) }); $('#s').focus(function(){ if( $(window).width() < 940 ){ $(this).animate({ width: '200px' }); } }); $('#s').blur(function(){ if( $(window).width() < 940 ){ $(this).animate({ width: '100px' }); } }); $('.alert-message').alert(); $('.dropdown-toggle').dropdown(); }); (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0 ',image:' ',iframe:' ",error:' The requested content cannot be loaded. Please try again later. ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d= a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")), b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f(' ').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(), y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement; if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0, {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1, mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio= !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href"); "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload= this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href); f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload, e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin, outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f(" ").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f(' ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}", g);break;case "swf":e=' ',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+=' "}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll": "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside? h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth|| h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),cz||y>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&jz||y>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1 ').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive? b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth), p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"=== f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d= b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f(' '+e+" ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d, e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+ ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f(' ').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f(' ').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) { if(target.hasOwnProperty(prop) && typeof obj[prop] === 'undefined') { 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); if(prop === 'innerHTML') { obj.innerHTML = attrObject[prop]; } 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); } }, 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); } }, createObject: function(object, id, tmpClass, text, container, prepend) { var attr = { id: id, 'className': tmpClass, innerHTML: text }; var obj = this.create(object, attr, container, prepend); return obj; }, createButton: function(type,id,tmpClass,text,callBackFn,container,prepend) { var attr = { id: id, 'className': tmpClass, innerHTML: text }; if(typeof callBackFn === 'function') { attr.onclick = callBackFn; } var obj = this.create(type, attr, container, prepend); return obj; }, createLink: function(type,id,tmpClass,text,url,container,prepend) { var attr = { id: id, 'className': tmpClass, innerHTML: text }; if(url !== null) { attr.href = url; } var obj = this.create(type, attr, container, prepend); return obj; }, 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; } var obj = this.create('img', attr, container, prepend); return obj; } }; 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.slideShow = function(container, defaultPathUrl, setAsBg, onNumber) { this.number = (typeof bpApp.slideShow.number === 'undefined')? bpApp.slideShow.number = 0 : (++bpApp.slideShow.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.htmlBuilder, { constructor: bpApp.slideShow, 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(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); }, resetContainer: function() { var container = document.getElementById(this.container); container.innerHTML = ''; }, setup: function(optionsArray) { this.resetContainer(); this.setupControlPanel(); this.setupOptions(optionsArray); 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(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(); }, 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); }, 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) { if(tmpOption.selected === 'yes') { return 'option selected'; } else { return '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; if(nextOptionNumber < this.optionsArray.length) { return this.optionsArray[nextOptionNumber]; } else { return this.optionsArray[0]; } }, 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; if(previousOptionNumber >= 0) { return this.optionsArray[previousOptionNumber]; } else { return this.optionsArray[(this.optionsArray.length - 1)]; } }, 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(number) { for(var i = 0, maxLength = this.optionsArray.length; i < maxLength; i++) { if(i == number) { var tmpOption = this.optionsArray[i]; var selection = tmpOption; } } if(selection) { this.selectOption(selection); } }, 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; }, startTimer: function() { var self = this; this.stopTimer(); this.timer = window.setTimeout(function(){ self.selectNewPanel(); }, 7000); }, stopTimer: function() { window.clearTimeout(this.timer); } }); var spotlightPanel = bpApp.slideShow; 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); if(!obj.style.display || obj.style.display === 'none') { obj.style.display = 'block'; this.toggleMode = 'block'; this.createShadow(); } else { obj.style.display = 'none'; this.toggleMode = 'none'; this.remove(); } } }); var bpMain = { setupAppDefault: function() { this.setupMinifyNavigation(); this.setupFancyBox(); this.setupMobileNav(); this.setupServicesIframe(); }, enableSlideShow: function(type) { type = type || 'modern'; switch(type) { case 'modern': this.setupSlideshow1(); break; case 'nivo': this.setupNivoSlider(); break; } }, enableSlideShow2: function(type) { type = type || 'modern'; switch(type) { case 'modern': this.setupSlideshow5(); break; case 'nivo': this.setupNivoSlider(); break; } }, enableSlideShow3: function(type) { type = type || 'modern'; switch(type) { case 'modern': this.setupSlideshow6(); break; case 'nivo': this.setupNivoSlider(); break; } }, enableSlideShow4: function(type) { type = type || 'modern'; switch(type) { case 'modern': this.setupSlideshow7(); break; case 'nivo': this.setupNivoSlider(); break; } }, 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(); }, setupSlideshow1: function() { var optionsArray = [ { title: '', content: '', className: '', image: '2.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '1.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '3.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '4.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '5.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '6.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '7.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '8.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '9.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '10.jpg', alt: '', url: '', crumbContent: '' } ]; var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight1 = new spotlightPanel('main-location-slides', '/main-location/', false, 0); spotlight1.setup(optionsArray); }, setupSlideshow5: function() { var optionsArray = [ { title: '', content: '', className: '', image: '8.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '2.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '3.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '4.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '5.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '6.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '7.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '1.jpg', alt: '', url: '', crumbContent: '' } ]; var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight5 = new spotlightPanel('bolingbrook-tour', '/bolingbrook-tour/', false, 0); spotlight5.setup(optionsArray); }, setupSlideshow6: function() { var optionsArray = [ { title: '', content: '', className: '', image: '8.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '2.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '3.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '4.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '5.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '6.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '7.jpg', alt: '', url: '', crumbContent: '' } ]; var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight6 = new spotlightPanel('plainfield-tour', '/plainfield-tour/', false, 0); spotlight6.setup(optionsArray); }, setupSlideshow7: function() { var optionsArray = [ { title: '', content: '', className: '', image: '8.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '2.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '3.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '4.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '5.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '6.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '7.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '9.jpg', alt: '', url: '', crumbContent: '' }, { title: '', content: '', className: '', image: '1.jpg', alt: '', url: '', crumbContent: '' } ]; var startNumber = Math.round(Math.random() * (optionsArray.length - 1)); var spotlight7 = new spotlightPanel('franklin-park-tour', '/franklin-park-tour/', false, 0); spotlight7.setup(optionsArray); }, setupCoolMap: function() { function $(id) { return jQuery(id); } var button = $('.map-overlay'), mapBox = $('#mapBox'), mapSection = $('.map-section'); button.click(function() { mapBox.css('display','none'); button.hide(); }); mapSection.mouseleave(function() { mapBox.css('display','block'); button.show(); }); }, 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; }); }, setupNivoSlider: function() { jQuery('#slider').nivoSlider({ effect: 'random', slices: 15, boxCols: 8, boxRows: 4, animSpeed: 500, pauseTime: 5000, startSlide: 0, directionNav: true, controlNav: false, controlNavThumbs: false, pauseOnHover: true, manualAdvance: false, prevText: 'Prev', nextText: 'Next', randomStart: false, beforeChange: function(){}, afterChange: function(){}, slideshowEnd: function(){}, lastSlide: function(){}, afterLoad: function(){} }); }, setupMinifyNavigation: function() { var onScrollHeader = function(headerID, miniHeaderClass, distance) { this.header = (typeof headerID === 'string')? document.getElementById(headerID) : headerID; if(!header) { return false; } this.miniClassName = miniHeaderClass; this.topScroller = { distance: (typeof distance !== 'undefined')? distance : 300, setup: function() { this.checkScroll(); this.addScroll(); }, addScroll: function() { var child = this; var tmpFunction = function(){ child.checkScroll(); }; jQuery(window).on('scroll', tmpFunction); jQuery(window).on('resize', tmpFunction); }, headerMinified: false, 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(self.header).addClass(self.miniClassName); this.headerMinified = true; } } else { if(this.headerMinified === true) { this.headerMinified = false; jQuery(self.header).removeClass(self.miniClassName); } } }, scrollToTop: function() { window.scrollTo(window.scrollX, 0); } }; this.topScroller.setup(); }; onScrollHeader('navarea', 'sticky', 400); }, setupMobileNav: function() { jQuery(".mobilenav .menu-item-has-children > a").append(''); jQuery(".mobilenav .menu-item-has-children").on("mouseenter click", function(){ var elemnt = jQuery(this); if(elemnt.hasClass("active")){ elemnt.removeClass("active").find(".sub-menu").first().hide(); } else { elemnt.addClass("active").find(".sub-menu").first().show(); } return false; }); jQuery(".mobilenav .sub-menu li:not(.menu-item-has-children)").click(function(event){ event.stopPropagation(); }); }, setupAutoScroll: function() { var exceptions = ['myModal']; var pattern = /^\//; jQuery('a[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(pattern,'') === this.pathname.replace(pattern,'') && location.hostname === this.hostname) { var hash = this.hash.slice(1), index = jQuery.inArray(hash, exceptions); if(index === -1) { var target = jQuery(this.hash); target = target.length ? target : jQuery('[id=' + hash +']'); if (target.length) { jQuery('html,body').animate({ scrollTop: target.offset().top }, 800); return false; } } } }); }, setupServicesIframe: function() { var self = this; this.setupGetDocHeight(); jQuery(window).on('resize', function() { self.setupGetDocHeight(); }); }, setupGetDocHeight: function() { function getDocHeight(doc) { doc = doc || document; var body = doc.body, html = doc.documentElement; var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ); return height; } function setIframeHeight(id) { var ifrm = document.getElementById(id); var doc = ifrm.contentDocument? ifrm.contentDocument: ifrm.contentWindow.document; ifrm.style.visibility = 'hidden'; ifrm.style.height = getDocHeight( doc ) + 40 + "px"; ifrm.style.visibility = 'visible'; } var iframe = document.getElementById('servicesIframe'); if(iframe) { iframe.onload = function() { setIframeHeight('servicesIframe'); }; } }, setupHandleIOS: function() { var pattern = /iPad|iPhone|iPod/; var iOS = pattern.test(navigator.platform); if(iOS) { jQuery('.peekThrough').css('background-attachment', 'scroll'); } }, setupGoogleMaps: function(attrName) { var setupMaps = function() { attrName = attrName || 'data-map-src'; var elements = jQuery('iframe[' + attrName + ']').each(function(index, element) { element = jQuery(element); var src = element.attr(attrName); if(src) { element.addClass('fadeIn'); element.attr('src', src); } }); }; window.setTimeout(setupMaps, 5000); } }; jQuery(function() { checkScroll(); jQuery(window).scroll(function(){ checkScroll(); }); jQuery(window).resize(function(){ checkScroll(); }); function checkScroll(){ jQuery('.slowscroll').parent().each(function(){ var top = (-0.75 * jQuery(this).offset().top); jQuery(this).find('.slowscroll').css('top',top+'px'); }); var scrollTop = jQuery(window).scrollTop(); var movement = scrollTop*0.75; jQuery('.slowscroll').css('transform','translateY('+movement+'px)'); jQuery('.slowscroll').css('webkit-transform','translateY('+movement+'px)'); } if(wpPageID === '2') { bpMain.enableSlideShow(); bpMain.setupHandleIOS(); } else if(wpPageID == '143') { bpMain.enableSlideShow2(); } else if(wpPageID == '138') { bpMain.enableSlideShow3(); } else if(wpPageID == '148') { bpMain.enableSlideShow4(); } bpMain.setupCoolMap(); bpMain.setupGoogleMaps(); bpMain.setupAppDefault(); bpMain.setupAutoScroll(); bpMain.addVideoPanels(); });