// Generated by CoffeeScript 1.4.0 /* jQuery Waypoints - v2.0.2 Copyright (c) 2011-2013 Caleb Troughton Dual licensed under the MIT license and GPL license. https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt */ (function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);/* * Sidr * https://github.com/artberri/sidr * * Copyright (c) 2013 Alberto Varela * Licensed under the MIT license. */ ;(function( $ ){ var sidrMoving = false, sidrOpened = false; // Private methods var privateMethods = { // Check for valids urls // From : http://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-an-url isUrl: function (str) { var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name '((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path '(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string '(\\#[-a-z\\d_]*)?$','i'); // fragment locator if(!pattern.test(str)) { return false; } else { return true; } }, // Loads the content into the menu bar loadContent: function($menu, content) { $menu.html(content); }, // Add sidr prefixes addPrefix: function($element) { var elementId = $element.attr('id'), elementClass = $element.attr('class'); if(typeof elementId === 'string' && '' !== elementId) { $element.attr('id', elementId.replace(/([A-Za-z0-9_.\-]+)/g, 'sidr-id-$1')); } if(typeof elementClass === 'string' && '' !== elementClass && 'sidr-inner' !== elementClass) { $element.attr('class', elementClass.replace(/([A-Za-z0-9_.\-]+)/g, 'sidr-class-$1')); } $element.removeAttr('style'); }, execute: function(action, name, callback) { // Check arguments if(typeof name === 'function') { callback = name; name = 'sidr'; } else if(!name) { name = 'sidr'; } // Declaring var $menu = $('#' + name), $body = $($menu.data('body')), $html = $('html'), menuWidth = $menu.outerWidth(true), speed = $menu.data('speed'), side = $menu.data('side'), bodyAnimation, menuAnimation, scrollTop; // Open Sidr if('open' === action || ('toogle' === action && !$menu.is(':visible'))) { // Check if we can open it if( $menu.is(':visible') || sidrMoving ) { return; } // If another menu opened close first if(sidrOpened !== false) { methods.close(sidrOpened, function() { methods.open(name); }); return; } // Lock sidr sidrMoving = true; // Left or right? if(side === 'left') { bodyAnimation = {left: menuWidth + 'px'}; menuAnimation = {left: '0px'}; } else { bodyAnimation = {right: menuWidth + 'px'}; menuAnimation = {right: '0px'}; } // Prepare page scrollTop = $html.scrollTop(); $html.css('overflow-x', 'hidden').scrollTop(scrollTop); // Open menu $("#mobileNavButton").animate({'margin-left':'280'}, 200); $("#logo").hide(); $body.css({ width: $body.width(), position: 'fixed' }).animate(bodyAnimation, speed); $menu.css('display', 'block').animate(menuAnimation, speed, function() { sidrMoving = false; sidrOpened = name; // Callback if(typeof callback === 'function') { callback(name); } }); } // Close Sidr else { // Check if we can close it if( !$menu.is(':visible') || sidrMoving ) { return; } // Lock sidr sidrMoving = true; // Right or left menu? if(side === 'left') { bodyAnimation = {left: 0}; menuAnimation = {left: '-' + menuWidth + 'px'}; } else { bodyAnimation = {right: 0}; menuAnimation = {right: '-' + menuWidth + 'px'}; } // Close menu $("#mobileNavButton").animate({'margin-left':'8'}, 200); $("#logo").fadeIn(200); scrollTop = $html.scrollTop(); $html.removeAttr('style').scrollTop(scrollTop); $body.animate(bodyAnimation, speed); $menu.animate(menuAnimation, speed, function() { $menu.removeAttr('style'); $body.removeAttr('style'); $('html').removeAttr('style'); sidrMoving = false; sidrOpened = false; // Callback if(typeof callback === 'function') { callback(name); } }); } } }; // Sidr public methods var methods = { open: function(name, callback) { privateMethods.execute('open', name, callback); }, close: function(name, callback) { privateMethods.execute('close', name, callback); }, toogle: function(name, callback) { privateMethods.execute('toogle', name, callback); } }; $.sidr = function( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'function' || typeof method === 'string' || ! method ) { return methods.toogle.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.sidr' ); } }; $.fn.sidr = function( options ) { var settings = $.extend( { name : 'sidr', // Name for the 'sidr' speed : 200, // Accepts standard jQuery effects speeds (i.e. fast, normal or milliseconds) side : 'left', // Accepts 'left' or 'right' source : null, // Override the source of the content. renaming : true, // The ids and classes will be prepended with a prefix when loading existent content body : 'body' // Page container selector, }, options); var name = settings.name, $sideMenu = $('#' + name); // If the side menu do not exist create it if( $sideMenu.length === 0 ) { $sideMenu = $('
') .attr('id', name) .appendTo($('body')); } // Adding styles and options $sideMenu .addClass('sidr') .addClass(settings.side) .data({ speed : settings.speed, side : settings.side, body : settings.body }); // The menu content if(typeof settings.source === 'function') { var newContent = settings.source(name); privateMethods.loadContent($sideMenu, newContent); } else if(typeof settings.source === 'string' && privateMethods.isUrl(settings.source)) { $.get(settings.source, function(data) { privateMethods.loadContent($sideMenu, data); }); } else if(typeof settings.source === 'string') { var htmlContent = '', selectors = settings.source.split(','); $.each(selectors, function(index, element) { htmlContent += '
' + $(element).html() + '
'; }); // Renaming ids and classes if(settings.renaming) { var $htmlContent = $('
').html(htmlContent); $htmlContent.find('*').each(function(index, element) { var $element = $(element); privateMethods.addPrefix($element); }); htmlContent = $htmlContent.html(); } privateMethods.loadContent($sideMenu, htmlContent); } else if(settings.source !== null) { $.error('Invalid Sidr Source'); } return this.each(function(){ var $this = $(this), data = $this.data('sidr'); // If the plugin hasn't been initialized yet if ( ! data ) { $this.data('sidr', name); $this.click(function(e) { e.preventDefault(); methods.toogle(name); }); } }); }; })( jQuery );/*! * jquery.customSelect() - v0.4.2 * http://adam.co/lab/jquery/customselect/ * 2013-05-22 * * Copyright 2013 Adam Coulombe * @license http://www.opensource.org/licenses/mit-license.html MIT License * @license http://www.gnu.org/licenses/gpl.html GPL2 License */ (function(a){a.fn.extend({customSelect:function(c){if(typeof document.body.style.maxHeight==="undefined"){return this}var e={customClass:"customSelect",mapClass:true,mapStyle:true},c=a.extend(e,c),d=c.customClass,f=function(h,k){var g=h.find(":selected"),j=k.children(":first"),i=g.html()||" ";j.html(i);if(g.attr("disabled")){k.addClass(b("DisabledOption"))}else{k.removeClass(b("DisabledOption"))}setTimeout(function(){k.removeClass(b("Open"));a(document).off("mouseup."+b("Open"))},60)},b=function(g){return d+g};return this.each(function(){var h=a(this),j=a("").addClass(b("Inner")),i=a(""),g=h.position();h.after(i.append(j));i.addClass(d);if(c.mapClass){i.addClass(h.attr("class"))}if(c.mapStyle){i.attr("style",h.attr("style"))}h.addClass("hasCustomSelect").on("update",function(){f(h,i);var l=parseInt(h.outerWidth(),10)-(parseInt(i.outerWidth(),10)-parseInt(i.width(),10));i.css({display:"inline-block"});var k=i.outerHeight();if(h.attr("disabled")){i.addClass(b("Disabled"))}else{i.removeClass(b("Disabled"))}j.css({width:l,display:"inline-block"});h.css({"-webkit-appearance":"menulist-button",width:i.outerWidth(),position:"absolute",opacity:0,height:k,fontSize:i.css("font-size"),left:g.left,top:g.top})}).on("change",function(){i.addClass(b("Changed"));f(h,i)}).on("keyup",function(k){if(!i.hasClass(b("Open"))){h.blur();h.focus()}else{if(k.which==13||k.which==27||k.which==9){f(h,i)}}}).on("mousedown",function(k){i.removeClass(b("Changed"))}).on("mouseup",function(k){if(!i.hasClass(b("Open"))){if(a("."+b("Open")).not(i).length>0&&typeof InstallTrigger!=="undefined"){h.focus()}else{i.addClass(b("Open"));k.stopPropagation();a(document).one("mouseup."+b("Open"),function(l){if(l.target!=h.get(0)&&a.inArray(l.target,h.find("*").get())<0){h.blur()}else{f(h,i)}})}}}).focus(function(){i.removeClass(b("Changed")).addClass(b("Focus"))}).blur(function(){i.removeClass(b("Focus")+" "+b("Open"))}).hover(function(){i.addClass(b("Hover"))},function(){i.removeClass(b("Hover"))}).trigger("update")})}})})(jQuery);/* * jQuery UI Touch Punch 0.2.2 * * Copyright 2011, Dave Furfero * Dual licensed under the MIT or GPL Version 2 licenses. * * Depends: * jquery.ui.widget.js * jquery.ui.mouse.js */ (function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return;}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return;}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f);}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return;}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown");};c._touchMove=function(f){if(!a){return;}this._touchMoved=true;d(f,"mousemove");};c._touchEnd=function(f){if(!a){return;}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click");}a=false;};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f);};})(jQuery);/*! * jQuery Cookie Plugin v1.3.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2013 Klaus Hartl * Released under the MIT license */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as anonymous module. define(['jquery'], factory); } else { // Browser globals. factory(jQuery); } }(function ($) { var pluses = /\+/g; function decode(s) { if (config.raw) { return s; } try { // If we can't decode the cookie, ignore it, it's unusable. return decodeURIComponent(s.replace(pluses, ' ')); } catch(e) {} } function decodeAndParse(s) { if (s.indexOf('"') === 0) { // This is a quoted cookie as according to RFC2068, unescape... s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } s = decode(s); try { // If we can't parse the cookie, ignore it, it's unusable. return config.json ? JSON.parse(s) : s; } catch(e) {} } var config = $.cookie = function (key, value, options) { // Write if (value !== undefined) { options = $.extend({}, config.defaults, options); if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); } value = config.json ? JSON.stringify(value) : String(value); return (document.cookie = [ config.raw ? key : encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // Read var result = key ? undefined : {}; // To prevent the for loop in the first place assign an empty array // in case there are no cookies at all. Also prevents odd result when // calling $.cookie(). var cookies = document.cookie ? document.cookie.split('; ') : []; for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); var name = decode(parts.shift()); var cookie = parts.join('='); if (key && key === name) { result = decodeAndParse(cookie); break; } // Prevent storing a cookie that we couldn't decode. if (!key && (cookie = decodeAndParse(cookie)) !== undefined) { result[name] = cookie; } } return result; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) !== undefined) { // Must not alter options, thus extending a fresh object... $.cookie(key, '', $.extend({}, options, { expires: -1 })); return true; } return false; }; })); //mobile menu $(document).ready(function() { //sidr mobile drawer $('#mobileNavButton').sidr(); //when the window is resized $(window).resize(function () { $.sidr('close', 'sidr'); if ($(window).width() > 1099) { $("#indexSideThingLeft").hide(); } }); //mobile dropdown nav $("#mobileNav li>span").click(function(){ if ($(this).siblings(".mobileDropdown").is(":visible")) { console.log('hi') $("#mobileNav .mobileDropdown").slideUp(200); return false; } //hide all $("#mobileNav .mobileDropdown").slideUp(200); //show selected ones $(this).siblings(".mobileDropdown").slideDown(200); }); $('#indexSlider').carousel({ interval: 5000 }); $('.customSelect').customSelect(); //blog comment checker $("#submit").click(function(){ if ($("#comment").val().length == 0) { alert("Please leave a comment"); return false; } }) //sub nav on role/type pages $("#roleTypeNav .navHeader").click(function(){ if ($(this).siblings(".liHolder").is(":visible")) { return false; } //hide or remove all $("#roleTypeNav .liHolder:visible").slideUp(200); $("#roleTypeNav .arrowDown").hide(); $("#roleTypeNav .arrowRight").show(); $("#roleTypeNav .navHeader").removeClass('blueDark'); //show selected ones $(this).siblings(".liHolder").slideDown(200); $(this).addClass("blueDark"); //arrows $(this).children(".arrowRight").hide(); $(this).children(".arrowDown").show(); }) //dropdown fix $(".dropdown").click(function(e){ e.stopPropagation(); console.log('other click'); return; }) //login modal $("#loginLink").click(function(e){ e.stopPropagation(); if (window.loginModal === true) { //hide it in the other handler } else { //show it window.loginModal = true; $("#loginModal").show().addClass("animatedFast fadeInDown"); $("#pageOverlay").show(); } return false; }); //clicking outside of things $('html').click(function() { console.log('html click'); window.loginModal = false; $("#loginModal").hide().removeClass("animatedFast fadeInDown"); $("#pageOverlay").hide(); //arrows $("#mainNav span .white").hide(); $("#mainNav span .dark").show(); $("#mainNav span").removeClass('selected'); $(".dropdown").hide().removeClass("animatedFast fadeIn"); }); $(".noJump").click(function(){ $(window).scrollTop(0); return false; }) //main nav $("#mainNav span").click(function(e){ e.stopPropagation(); var id = $(this).attr('id'); //clicking one already selected if ($(this).hasClass('selected')) { //arrows $(this).children('.arrow').eq(1).hide(); $(this).children('.arrow').eq(0).show(); $(this).removeClass('selected'); $(".dropdown[data-source='" + id + "']").hide().removeClass("animatedFast fadeIn"); return; } //if there's no dropdown, just exit if ($(".dropdown[data-source='" + id + "']").length == 0) { return; } //hide all $("#mainNav span").children('.white').hide(); $("#mainNav span").children('.dark').show(); $("#mainNav span").removeClass('selected'); $(".dropdown").hide().removeClass("animatedFast fadeIn"); //arrows $(this).children('.dark, .lightBlue').hide(); $(this).children('.white').show(); $(this).addClass('selected'); $(".dropdown[data-source='" + id + "']").show().addClass("animatedFast fadeIn"); }); $(".no-touch #mainNav span:not(.selected)").hover(function(){ if ($(this).children('.white').is(':visible')) { return; } $(this).children('.dark').hide(); $(this).children('.lightBlue').show(); console.log('hover'); }, function(){ if ($(this).children('.white').is(':visible')) { return; } $(this).children('.dark').show(); $(this).children('.lightBlue').hide(); console.log('unhover'); }) //sticky header $(window).scroll(function(){ var y = $(window).scrollTop(); if( y > 400 && $(window).width() > 767) { $("#mainHeaderPlaceholder").show(); $("#mainHeader").addClass('animated fadeInDown headerSticky'); $("#indexSideThingLeft").hide(); } else { $("#mainHeaderPlaceholder").hide(); $("#mainHeader").removeClass('animated fadeInDown headerSticky'); if ($(window).width() < 1100) { $("#indexSideThingLeft").show(); } } }); //tooltips $(".doTooltip").tooltip({ track: true, tooltipClass: 'ui-tooltip-popover animatedFast fadeInDown', content: function(){ return $(this).data('tooltip'); }, hide:false }); }); //animate scroll to function scrollToElem(elem, offset) { if (!$(".headerSticky").is(":visible")) { offset = offset + 169; } $('html,body').animate({scrollTop: $(elem).offset().top - offset}); } //index toggler function roleTypeToggle(link, target) { if (link.hasClass('selected')) { return false; } else { $('#roleTypeSwitch a').removeClass('selected'); link.addClass('selected'); } $("#indexRoles").toggle(); $("#indexTypes").toggle(); } //gated function openGatedModal(file, name) { var url = 'gated/modal.php?file='+file; $("#gatedModal iframe").attr('src', url); $("#gatedModal").find('h3').html("Download " + name); $("#gatedModal").modal('show'); }