/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-geolocation-touch-cssclasses-teststyles-hasevent-prefixes
*/
;
window.Modernizr = (function( window, document, undefined ) {
var version = '2.8.3',
Modernizr = {},
enableClasses = true,
docElement = document.documentElement,
mod = 'modernizr',
modElem = document.createElement(mod),
mStyle = modElem.style,
inputElem ,
toString = {}.toString,
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
tests = {},
inputs = {},
attrs = {},
classes = [],
slice = classes.slice,
featureName,
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
var style, ret, node, docOverflow,
div = document.createElement('div'),
body = document.body,
fakeBody = body || document.createElement('body');
if ( parseInt(nodes, 10) ) {
while ( nodes-- ) {
node = document.createElement('div');
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
div.appendChild(node);
}
}
style = ['',''].join('');
div.id = mod;
(body ? div : fakeBody).innerHTML += style;
fakeBody.appendChild(div);
if ( !body ) {
fakeBody.style.background = '';
fakeBody.style.overflow = 'hidden';
docOverflow = docElement.style.overflow;
docElement.style.overflow = 'hidden';
docElement.appendChild(fakeBody);
}
ret = callback(div, rule);
if ( !body ) {
fakeBody.parentNode.removeChild(fakeBody);
docElement.style.overflow = docOverflow;
} else {
div.parentNode.removeChild(div);
}
return !!ret;
},
isEventSupported = (function() {
var TAGNAMES = {
'select': 'input', 'change': 'input',
'submit': 'form', 'reset': 'form',
'error': 'img', 'load': 'img', 'abort': 'img'
};
function isEventSupported( eventName, element ) {
element = element || document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
var isSupported = eventName in element;
if ( !isSupported ) {
if ( !element.setAttribute ) {
element = document.createElement('div');
}
if ( element.setAttribute && element.removeAttribute ) {
element.setAttribute(eventName, '');
isSupported = is(element[eventName], 'function');
if ( !is(element[eventName], 'undefined') ) {
element[eventName] = undefined;
}
element.removeAttribute(eventName);
}
}
element = null;
return isSupported;
}
return isEventSupported;
})(),
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
hasOwnProp = function (object, property) {
return _hasOwnProperty.call(object, property);
};
}
else {
hasOwnProp = function (object, property) {
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
};
}
if (!Function.prototype.bind) {
Function.prototype.bind = function bind(that) {
var target = this;
if (typeof target != "function") {
throw new TypeError();
}
var args = slice.call(arguments, 1),
bound = function () {
if (this instanceof bound) {
var F = function(){};
F.prototype = target.prototype;
var self = new F();
var result = target.apply(
self,
args.concat(slice.call(arguments))
);
if (Object(result) === result) {
return result;
}
return self;
} else {
return target.apply(
that,
args.concat(slice.call(arguments))
);
}
};
return bound;
};
}
function setCss( str ) {
mStyle.cssText = str;
}
function setCssAll( str1, str2 ) {
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
}
function is( obj, type ) {
return typeof obj === type;
}
function contains( str, substr ) {
return !!~('' + str).indexOf(substr);
}
function testDOMProps( props, obj, elem ) {
for ( var i in props ) {
var item = obj[props[i]];
if ( item !== undefined) {
if (elem === false) return props[i];
if (is(item, 'function')){
return item.bind(elem || obj);
}
return item;
}
}
return false;
}
tests['touch'] = function() {
var bool;
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
bool = true;
} else {
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
bool = node.offsetTop === 9;
});
}
return bool;
};
tests['geolocation'] = function() {
return 'geolocation' in navigator;
};
for ( var feature in tests ) {
if ( hasOwnProp(tests, feature) ) {
featureName = feature.toLowerCase();
Modernizr[featureName] = tests[feature]();
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
}
}
Modernizr.addTest = function ( feature, test ) {
if ( typeof feature == 'object' ) {
for ( var key in feature ) {
if ( hasOwnProp( feature, key ) ) {
Modernizr.addTest( key, feature[ key ] );
}
}
} else {
feature = feature.toLowerCase();
if ( Modernizr[feature] !== undefined ) {
return Modernizr;
}
test = typeof test == 'function' ? test() : test;
if (typeof enableClasses !== "undefined" && enableClasses) {
docElement.className += ' ' + (test ? '' : 'no-') + feature;
}
Modernizr[feature] = test;
}
return Modernizr;
};
setCss('');
modElem = inputElem = null;
Modernizr._version = version;
Modernizr._prefixes = prefixes;
Modernizr.hasEvent = isEventSupported; Modernizr.testStyles = injectElementWithStyles; docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
(enableClasses ? ' js ' + classes.join(' ') : '');
return Modernizr;
})(this, this.document);
;
/**
* Utilities; useful scripts
*
* @author Tijs Verkoyen
* @author Thomas Deceuninck
*/
var utils =
{
debug: false
};
/**
* Functions related to arrays
*
* @author Tijs Verkoyen
*/
utils.array =
{
/**
* Is the given value present in the array
*
* @return bool
*/
inArray: function(needle, array)
{
// loop values
for(var i in array)
{
if(array[i] == needle) return true;
}
// fallback
return false;
}
};
/**
* Function related to cookies
*
* @author Tijs Verkoyen
*/
utils.cookies =
{
/**
* Are cookies enabled?
*
* @return bool
*/
isEnabled: function()
{
// try to grab the property
var cookiesEnabled = !!(navigator.cookieEnabled);
// unknown property?
if(typeof navigator.cookieEnabled == 'undefined' && !cookiesEnabled)
{
// try to set a cookie
document.cookie = 'testcookie';
cookiesEnabled = ($.inArray('testcookie', document.cookie) != -1);
}
// return
return cookiesEnabled;
},
/**
* Read a cookie
*
* @return mixed
*/
readCookie: function(name)
{
// get cookies
var cookies = document.cookie.split(';');
name = name + '=';
for(var i = 0; i < cookies.length; i++)
{
var cookie = cookies[i];
while(cookie.charAt(0) === ' ') cookie = cookie.substring(1, cookie.length);
if(cookie.indexOf(name) === 0) return cookie.substring(name.length, cookie.length);
}
// fallback
return null;
},
setCookie: function(name, value, days)
{
if(typeof days == 'undefined') days = 7;
var expireDate = new Date();
expireDate.setDate(expireDate.getDate() + days);
document.cookie = name + '=' + escape(value) + ';expires=' + expireDate.toUTCString() + ';path=/';
}
};
/**
* Functions related to forms
*
* @author Tijs Verkoyen
*/
utils.form =
{
/**
* Is a checkbox checked?
*
* @return bool
* @param object element
*/
isChecked: function(element)
{
return ($('input[name="' + element.attr('name') + '"]:checked').length >= 1);
},
/**
* Is the value inside the element a valid email address
*
* @return bool
* @param object element
*/
isEmail: function(element)
{
var regexp = /^[a-z0-9!#\$%&'*+-\/=?^_`{|}\.~]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i;
return regexp.test(element.val());
},
/**
* Is the element filled
*
* @return bool
* @param object element
*/
isFilled: function(element)
{
return (utils.string.trim(element.val()) !== '');
},
/**
* Is the value inside the element a valid number
*
* @return bool
* @param object element
*/
isNumber: function(element)
{
return (!isNaN(element.val()) && element.val() !== '');
},
/**
* Is the value inside the element a valid URL
*
* @return bool
* @param object element
*/
isURL: function(element)
{
var regexp = /^((http|ftp|https):\/{2})?(([0-9a-zA-Z_-]+\.)+[0-9a-zA-Z]+)((:[0-9]+)?)((\/([~0-9a-zA-Z\#%@\.\/_-]+)?(\?[0-9a-zA-Z%@\/&=_-]+)?)?)$/i;
return regexp.test(element.val());
}
};
/**
* Functions related to strings
*
* @author Tijs Verkoyen
* @author Dieter Vanden Eynde
* @author Matthias Mullie
*/
utils.string =
{
// data member
div: false,
/**
* Fix a HTML5-chunk, so IE can render it
*
* @return string
* @param string html
*/
html5: function(html)
{
var html5 = 'abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' ');
// create div if needed
if(utils.string.div === false)
{
utils.string.div = document.createElement('div');
utils.string.div.innerHTML = '';
if(utils.string.div.childNodes.length !== 1)
{
var fragment = document.createDocumentFragment();
var i = html5.length;
while(i--) fragment.createElement(html5[i]);
fragment.appendChild(utils.string.div);
}
}
html = html.replace(/^\s\s*/, '').replace(/\s\s*$/, '')
.replace(/' );
iframe_doc.close();
// Update the Iframe's hash, for great justice.
iframe.location.hash = hash;
}
};
})();
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// ^^^^^^^^^^^^^^^^^^^ REMOVE IF NOT SUPPORTING IE6/7/8 ^^^^^^^^^^^^^^^^^^^
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return self;
})();
})(jQuery,this);
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
while (length--) {
method = methods[length];
// Only stub undefined methods.
if (!console[method]) {
console[method] = noop;
}
}
}());
/**
* Interaction for the location module
*
* @author Tijs Verkoyen
*/
jsFrontend.location =
{
map: {},
mapFullUrl: null,
directionService: null,
directionsDisplay: null,
// init, something like a constructor
init: function()
{
if($('.parseMap').length > 0)
{
$('.parseMap').each(function()
{
var id = $(this).attr('id').replace('map', '');
google.maps.event.addDomListener(window, 'load', jsFrontend.location.initMap(id));
});
}
},
// init the map
initMap: function(id)
{
// define some variables we will need
var suffix = (id == '') ? '' : '_' + id;
var mapId = (id == '') ? 'general' : id;
var theme = [
{
"featureType": "water",
"stylers": [
{
"visibility": "on"
},
{
"color": "#b5cbe4"
}
]
},
{
"featureType": "landscape",
"stylers": [
{
"color": "#efefef"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry",
"stylers": [
{
"color": "#83a5b0"
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [
{
"color": "#bdcdd3"
}
]
},
{
"featureType": "road.local",
"elementType": "geometry",
"stylers": [
{
"color": "#ffffff"
}
]
},
{
"featureType": "poi.park",
"elementType": "geometry",
"stylers": [
{
"color": "#e3eed3"
}
]
},
{
"featureType": "administrative",
"stylers": [
{
"visibility": "on"
},
{
"lightness": 33
}
]
},
{
"featureType": "road"
},
{
"featureType": "poi.park",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
},
{
"lightness": 20
}
]
},
{},
{
"featureType": "road",
"stylers": [
{
"lightness": 20
}
]
}
];
// build the options
var options =
{
zoom: (jsFrontend.data.get('Location.settings' + suffix + '.zoom_level') == 'auto') ? 0 : parseInt(jsFrontend.data.get('Location.settings' + suffix + '.zoom_level')),
center: new google.maps.LatLng(jsFrontend.data.get('Location.settings' + suffix + '.center.lat'), jsFrontend.data.get('Location.settings' + suffix + '.center.lng')),
mapTypeId: google.maps.MapTypeId[jsFrontend.data.get('Location.settings' + suffix + '.map_type')],
draggable: Modernizr.touch ? false : true,
scrollwheel: false,
styles: theme
};
// create map
jsFrontend.location.map[mapId] = new google.maps.Map(document.getElementById('map' + id), options);
// get the items
var items = jsFrontend.data.get('Location.items' + suffix);
// any items
if(items.length > 0)
{
// loop items
for(var i in items)
{
// add markers
jsFrontend.location.addMarker(mapId, items[i].id, items[i].lat, items[i].lng, items[i].title);
}
}
// are directions enabled?
if(jsFrontend.data.get('Location.settings' + suffix + '.directions'))
{
// create direction variables if needed
if(jsFrontend.location.directionsService == null) jsFrontend.location.directionsService = new google.maps.DirectionsService();
if(jsFrontend.location.directionsDisplay == null) jsFrontend.location.directionsDisplay = new google.maps.DirectionsRenderer();
// bind events
$('#locationSearch' + id + ' form').on('submit', function(e)
{
// prevent default
e.preventDefault();
// calculate & display the route
jsFrontend.location.setRoute(id, mapId, items[0]);
});
}
if($('#map-full-url-' + id).length > 0) {
jsFrontend.location.mapFullUrl = $('#map-full-url-' + id).attr('href');
}
},
// add a marker
addMarker: function(mapId, id, lat, lng, title)
{
// add the marker
var marker = new google.maps.Marker(
{
position: new google.maps.LatLng(lat, lng),
map: jsFrontend.location.map[mapId],
title: title,
locationId: id,
icon: '/src/Frontend/Themes/Soda/Core/Layout/Images/Modules/Location/solid-pin-black.png'
}
);
// show info window on click
google.maps.event.addListener(marker, 'click', function()
{
$markerText = $('#markerText' + marker.locationId);
// apparently JS goes bananas with multi line HTMl, so we grab it from the div, this seems like a good idea for SEO
if($markerText.length > 0) text = $markerText.html();
var content = '' + title + '
';
if(typeof text != 'undefined') content += text;
new google.maps.InfoWindow(
{
content: content
}
).open(jsFrontend.location.map[mapId], marker);
});
},
// calculate the route
setRoute: function(id, mapId, item)
{
$error = $('#locationSearchAddress' + id);
$search = $('#locationSearchAddress' + id);
// validate
if($search.val() == '') $error.addClass('input-error');
else $error.removeClass('input-error');
// build the position
var position = new google.maps.LatLng(item.lat, item.lng);
// build request
var request =
{
origin: $search.val(),
destination: position,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
// request the route
jsFrontend.location.directionsService.route(request, function(response, status)
{
// did we find a route
if(status == google.maps.DirectionsStatus.OK)
{
// change the map
jsFrontend.location.directionsDisplay.setMap(jsFrontend.location.map[mapId]);
// render the route
jsFrontend.location.directionsDisplay.setDirections(response);
// change the link
if (jsFrontend.location.mapFullUrl != null) {
// get "a"-link element
var $item = $('#map-full-url-' + id);
// d = directions
var href = jsFrontend.location.mapFullUrl + '&f=d&saddr=' + $search.val() + '&daddr=' + position;
// update href
$item.attr('href', href);
}
}
// show error
else $error.addClass('input-error');
});
}
};
$(jsFrontend.location.init);
$(window).load(function()
{
$('.js-photogallery-lightbox').each(function()
{
var $this = $(this);
var lightboxId = $this.data('id');
var lightboxSettings = jsFrontend.data.get('Photogallery.lightbox_settings_' + lightboxId);
var show_close_button = lightboxSettings.show_close_button == 'true';
var show_arrows = lightboxSettings.show_arrows == 'true';
var show_caption = lightboxSettings.show_caption == 'true';
var caption_type = lightboxSettings.caption_type;
var padding = parseInt(lightboxSettings.padding);
var margin = parseInt(lightboxSettings.margin);
var modal = lightboxSettings.modal == 'true';
var close_click = lightboxSettings.close_click == 'true';
var media_helper = lightboxSettings.media_helper == 'true';
var show_hover_icon = lightboxSettings.show_hover_icon == 'true';
var navigation_effect = lightboxSettings.navigation_effect;
var open_effect = lightboxSettings.open_effect;
var close_effect = lightboxSettings.close_effect;
var play_speed = parseInt(lightboxSettings.play_speed);
var loop = lightboxSettings.loop == 'true';
var show_thumbnails = lightboxSettings.show_thumbnails == 'true';
var thumbnails_position = lightboxSettings.thumbnails_position;
var thumbnail_navigation_width = parseInt(lightboxSettings.thumbnail_navigation_width);
var thumbnail_navigation_height = parseInt(lightboxSettings.thumbnail_navigation_height);
var show_overlay = lightboxSettings.show_overlay == 'true';
var overlay_color = lightboxSettings.overlay_color;
var fancybox = $('a.fancybox', this);
var h = {};
if(show_hover_icon)
{
//fancybox.addClass('linkOverlay').linkIcon({background:{css:{'opacity': 0.65}}});
}
if(show_thumbnails)
{
h.thumbs = {
width: thumbnail_navigation_width,
height: thumbnail_navigation_height,
position: thumbnails_position
};
}
if(show_overlay)
{
h.overlay = { css: {'background': overlay_color } };
}
else
{
h.overlay = null;
}
if(media_helper)
{
h.media = {};
}
if(show_caption)
{
h.title = { type: caption_type };
}
else
{
h.title = null;
}
fancybox.fancybox({
nextEffect: navigation_effect,
prevEffect: navigation_effect,
openEffect: open_effect,
closeEffect: close_effect,
closeBtn: show_close_button,
playSpeed: play_speed,
loop: loop,
arrows: show_arrows,
closeClick: close_click,
modal: modal,
padding: padding,
margin: margin,
tpl: {
closeBtn : '',
next : '',
prev : ''
},
helpers: h,
beforeShow: function()
{
// Get rich titles
var currentElement = this.element;
var next = $(currentElement).next();
if(next.length && next.hasClass('photogallery-lightbox-caption')) this.title = next.html();
// Disable right click
$.fancybox.wrap.bind("contextmenu", function (e) {
return false;
});
}
});
var imageId = utils.url.getGetValue('{$actLightboxImage}');
if(imageId) $this.find("a[data-image-id=" + imageId + "]").trigger('click');
});
});
$(window).load(function()
{
$('.js-photogallery-slideshow-wrapper').each(function()
{
var $this = $(this);
var slideshowId = $this.data('id');
var slideshowSettings = jsFrontend.data.get('Photogallery.slideshow_settings_' + slideshowId);
var controlNav = slideshowSettings.show_pagination == 'true';
var controlType = slideshowSettings.pagination_type;
var controlTypeIsThumbnails = (controlType == 'thumbnails');
var slideshow = true;
var animationLoop = true;
var sync = '';
var randomize = slideshowSettings.random == 'true';
var directionNav = slideshowSettings.show_arrows == 'true';
var slider = '#photogallery-flexslider-id-' + slideshowId;
var pauseOnHover = slideshowSettings.pause_on_hover == 'true';
var animation = slideshowSettings.animation;
var slideshow_item_width = parseInt(slideshowSettings.slideshow_item_width);
if(jQuery.type(slideshow_item_width) == 'number')
{
if( slideshow_item_width > 0) animation = 'slide';
}
if(controlTypeIsThumbnails)
{
controlNav = false;
slideshow = false;
animationLoop = false;
sync = '#photogallery-flexslider-navigation-id-' + slideshowId;
randomize = false;
directionNav = directionNav;
pauseOnHover = false;
$(sync).flexslider({
animation: "slide",
controlNav: controlNav,
animationLoop: animationLoop,
slideshow: slideshow,
itemWidth: 150,
itemMargin: 5,
asNavFor: slider
});
}
$(slider).flexslider({
slideshowSpeed: slideshowSettings.slideshow_speed,
animationSpeed: slideshowSettings.animation_speed,
randomize: randomize,
pauseOnHover: pauseOnHover,
directionNav: directionNav,
controlNav: controlNav,
sync: sync,
animationLoop: animationLoop,
slideshow: slideshow,
animation: animation,
itemWidth: slideshow_item_width
});
})
});
var jsSite =
{
// init, something like a constructor
init: function()
{
$('.masonry').imagesLoaded( function() {
$('.masonry').masonry({
// options
itemSelector: '.case-widget-item-masonry',
percentPosition:true,
gutter: 20
});
});
$('.planner-tab-item a').click(function(e){
e.preventDefault();
var id = $(this).data('tab-id');
$('.planner-tab').removeClass('planner-tab-selected');
var target = $('.planner-tab[data-tab-id=' + id + ']');
target.addClass('planner-tab-selected');
$('.planner-tab-item').removeClass('selected');
$(this).parent().addClass('selected');
})
$('.js-next-tab').click(function(e){
e.preventDefault();
var id = $(this).data('tab-id');
var errors = false;
// validate
var tab = $('.planner-tab[data-tab-id=' + id + ']');
var dropdowns = tab.find('select');
dropdowns.each(function(index, el){
if($(el).val() == ''){
errors = true;
$(el).siblings('.js-formError').show();
} else if(errors == false) {
$(el).siblings('.js-formError').hide();
errors = false;
}
})
if(!errors){
var target = $('.planner-tab-item[data-tab-id=' + id + ']');
var next = target.next();
$('.planner-tab-item').removeClass('selected');
next.addClass('selected');
var nextId = next.data('tab-id');
$('.planner-tab').removeClass('planner-tab-selected');
var target = $('.planner-tab[data-tab-id=' + nextId + ']');
target.addClass('planner-tab-selected');
$("html, body").animate({ scrollTop: $("#plannerDetailForm").offset().top }, "fast");
}
});
$('.js-prev-tab').click(function(e){
e.preventDefault();
var id = $(this).data('tab-id');
var target = $('.planner-tab-item[data-tab-id=' + id + ']');
var next = target.prev();
$('.planner-tab-item').removeClass('selected');
next.addClass('selected')
var nextId = next.data('tab-id');
$('.planner-tab').removeClass('planner-tab-selected');
var target = $('.planner-tab[data-tab-id=' + nextId + ']');
target.addClass('planner-tab-selected');
$("html, body").animate({ scrollTop: $("#plannerDetailForm").offset().top }, "fast");
})
$('body').addClass('js');
jQuery('.phases-widget .phase a').click(function(){
var match = jQuery(this).attr('href').match(/#\S+/);
//ga('send', 'pageview', location.pathname + match[0]);
});
$('.planner-phase-question-show-tips a').click(function(e){
e.preventDefault();
$(this).parent().parent().parent().find('.planner-phase-question-tips').toggle();
});
function tips(){
$('.tips-index').packery({
itemSelector: '.tips-index-category-container',
transitionDuration: 0
});
}
tips();
$(window).hashchange( function(){
//alert('change');
jsSite.navigation.tabs();
})
// Since the event is only triggered when the hash changes, we need to trigger
// the event now, to handle the hash the page may have loaded with.
$(window).hashchange();
setInterval(function(){
tips();
}, 200);
$('.language-navigation select').change(function(e){
window.location = $(this).val();
});
$('.case-filter a').click(function(e){
e.preventDefault();
});
if($('.js-page-header-random').length > 0) {
var rand = Math.round(Math.random() * 11)+1;
$('.page-image').css('background-image','url(/src/Frontend/Themes/Soda/Core/Layout/Images/Headerimages2/rotatie/' + rand + '.jpg)');
}
$('.toggle-all').click(function(e){
e.preventDefault();
$('.phase').removeAttr('style');
$('.phase').removeClass('selected');
$('.phase').removeClass('open');
$('.donut-slice').removeClass('selected');
if($(this).hasClass('shown')) {
} else {
$('.donut-slice a').trigger('click');
}
$(this).toggleClass('shown');
})
$('.flexslider').flexslider({controlNav:false})
$('.case-widget-item').hover(function(){
$(this).find('.case-widget-content').fadeOut();
$(this).find('.case-widget-hover').fadeIn();
}, function(){
$(this).find('.case-widget-content').fadeIn();
$(this).find('.case-widget-hover').fadeOut();
});
var previous = jsFrontend.locale.get('lbl', 'Previous');
var next = jsFrontend.locale.get('lbl', 'Next');
/*$('.cases-widget').mixItUp({
animation: {
effects: 'fade',
enable: false
},
controls: {
toggleFilterButtons: true,
toggleLogic: 'and'
},
load: {
page: 1
},
pagination: {
limit: ($(window).width() > 800 ? 5 : 4),
loop: false,
generatePagers: true,
maxPagers: 0,
pagerClass: '',
prevButtonHTML: ' ',
nextButtonHTML: ''
},
selectors: {
pagersWrapper: '.pager-list',
pager: '.pager'
}
});*/
$('.phase a.close').click(function(e){
e.preventDefault();
var id = $(this).data('id');
$('.phase.phase-id-' + id).removeAttr('style');
$('.donut-slice.phase-id-' + id).removeClass('selected');
})
$('.donut-slice a').click(function(e){
//e.preventDefault();
var id = $(this).data('id');
$('.phase.phase-id-' + id).toggle();
$(this).parent().toggleClass('selected');
/*$('html,body').stop().animate({
scrollTop: $('.phase.phase-id-' + id).offset().top - $('.phases-donut-inner').height()},
'slow');*/
})
$('.donut-slice a').hover(function(){
$(this).find('span').css('background-color', $(this).data('color-dark'));
$(this).parent('.phase-id-7').css('background-color', $(this).data('color-light'));
}, function(){
$(this).find('span').css('background-color', '#b1b1b1');
$(this).parent('.phase-id-7').removeAttr('style');
})
$(".phase").on("tap click",function(e){
$(this).toggleClass('open');
//e.preventDefault();
});
// browser window scroll (in pixels) after which the "back to top" link is shown
var offset = 300,
//browser window scroll (in pixels) after which the "back to top" link opacity is reduced
offset_opacity = 1200,
//duration of the top scrolling animation (in ms)
scroll_top_duration = 700,
//grab the "back to top" link
$back_to_top = $('.cd-top');
//hide or show the "back to top" link
$(window).scroll(function(){
( $(this).scrollTop() > offset ) ? $back_to_top.addClass('cd-is-visible') : $back_to_top.removeClass('cd-is-visible cd-fade-out');
if( $(this).scrollTop() > offset_opacity ) {
$back_to_top.addClass('cd-fade-out');
}
});
//smooth scroll to top
$back_to_top.on('click', function(event){
event.preventDefault();
$('body,html').animate({
scrollTop: 0 ,
}, scroll_top_duration
);
});
$('.toggle-all').trigger('click');
$('.phase').show();
jsSite.controls.init();
jsSite.contentFixes.init();
jsSite.forms.init();
jsSite.navigation.init();
if($('#popup').length > 0){
if(utils.cookies.readCookie('popup') == null) {
$.fancybox({
type: "inline",
href: "#popup"
});
}
}
$(document).on('click', '.fancybox-close', function () {
utils.cookies.setCookie('popup', 'hide',7);
});
}
}
jsSite.controls =
{
// init, something like a constructor
init: function()
{
jsSite.controls.bindTargetBlank();
},
// bind target blank
bindTargetBlank: function()
{
$('a.js-target-blank').attr('target', '_blank');
}
}
jsSite.contentFixes =
{
// init, something like a constructor
init: function()
{
jsSite.contentFixes.equalHeights();
},
equalHeights: function()
{
if($('.js-equal-heights').length > 0)
{
imagesLoaded( '.js-equal-heights', function() {
$('.js-equal-heights').equalHeights();
});
$(window).on("debouncedresize", function( event )
{
$('.js-equal-heights').equalHeights();
});
}
}
}
jsSite.forms =
{
// init, something like a constructor
init: function()
{
jsSite.forms.bindFocus();
jsSite.forms.bindSubmit();
jsSite.forms.bindSubmitAjaxCM();
},
bindSubmit: function()
{
$('.js-submit-form').click(function(){
$(this).closest('form').submit();
return false;
});
},
bindSubmitAjaxCM: function()
{
$('.js-ajax-cm').submit(function(e){
e.preventDefault();
var emailField = $(this).find('input[type=email]');
var label = $("label[for='"+ emailField.attr('id') +"']");
emailField.parent().removeClass('errorArea');
$.getJSON(
this.action + "?callback=?",
$(this).serialize(),
function (data) {
if (data.Status === 400)
{
label.find('span').remove();
emailField.parent().addClass('errorArea');
label.append($( "" + jsFrontend.locale.err('EmailIsInvalid') + "" ))
}
else
{
emailField.parent().removeClass('errorArea');
label.find('span').remove();
}
}
);
});
},
bindFocus: function()
{
$('.js-focus').first().focus();
$('.js-focus-on-first').find("input:text, textarea").first().focus();
}
}
jsSite.navigation =
{
// init, something like a constructor
init: function()
{
jsSite.navigation.responsive();
jsSite.navigation.tabs();
},
tabs: function(){
var hash = window.location.hash;
// Bind an event to window.onhashchange that, when the hash changes, gets the
// hash and adds the class "selected" to any matching nav link.
if(hash.indexOf('#tab-') != -1){
var tab = hash.slice(1);
var target = $('.tab-content[data-tab-name=' + tab + ']');
//console.log(target);
if(target.length > 0){
$('.tab-content.tab-selected').removeClass('tab-selected');
target.addClass('tab-selected');
// console.log($('.phase-strategies').offset());
setTimeout(
function()
{
$('html,body').stop().animate({
scrollTop: $('.tab-navigation').show().offset().top
},
'slow');
}, 500);
$('.js-tab').closest('li').parent().find('li.selected').removeClass('selected');
$('.js-tab[data-tab-name=' + tab + ']').parent().addClass('selected');
}
}
$('.js-tab').click(function(e){
e.preventDefault();
var t = $(this).data('tab-name');
$(this).closest('li').parent().find('li.selected').removeClass('selected');
$(this).closest('li').addClass('selected');
$('.tab-content.tab-selected').removeClass('tab-selected');
$('.tab-content[data-tab-name=' + t + ']').addClass('tab-selected');
window.location.hash = t;
return false;
})
},
responsive: function()
{
var $navigationContainer = $('.navigation-container'),
$toggle = $('.js-toggle');
$toggle.click(function()
{
$toggle.toggleClass('is-expanded');
$navigationContainer.toggleClass('is-expanded');
return false;
});
}
}
$(function() {
$(jsSite.init);
});