$(document).ready(function(){if($('.tx_mobility_cars').length){$('.tx_mobility_cars .mobility_cars_category .category_header').on('click',function(e){if(!$(e.target).hasClass('mapTrigger')){e.preventDefault();if($(this).parent().hasClass('active')){history.pushState('',document.title,window.location.pathname)}else{history.pushState('',document.title,window.location.pathname+$(this).find('.category_toggle')[0].hash)}
cars_category_content()}});$('.tx_mobility_cars .mobility_cars_category .category_mobile .back').on('click',function(e){var category=$(window.location.hash);history.pushState('',document.title,window.location.pathname);$('body').removeClass('overlay');$('.mobility_cars_category').removeClass('active');$('html, body').scrollTop(category.offset().top)});window.onpopstate=function(){cars_category_content()};if(window.location.hash){cars_category_content()}
var rows=4;cars_category_list(rows,'init');$(window).resize(function(){if(this.resized){clearTimeout(this.resized)}
this.resized=setTimeout(function(){cars_category_list(rows,'resize')},250)});$('.tx_mobility_cars .mobility_cars_category .show_more').on('click',function(){var parent=$(this).parent();parent.find('.more_infos').addClass('show');parent.find('.show_less').addClass('show');$(this).removeClass('show')});$('.tx_mobility_cars .mobility_cars_category .show_less').on('click',function(){var parent=$(this).parent();parent.find('.more_infos').removeClass('show');parent.find('.show_more').addClass('show');$(this).removeClass('show')})}});function cars_category_content(){$('body').removeClass('overlay');$('.mobility_cars_category').removeClass('active');if(window.location.hash){$('body').addClass('overlay');var category=$(window.location.hash);category.addClass('active');if($(window).width()<=960){$('html, body').scrollTop(category.offset().top)}}}
function cars_category_list(total_columns,type){$('.more_infos').each(function(){var list=$(this);var items=list.find('li');if(items.length>total_columns){list.height(items.eq(total_columns).position().top);if(type==='init'){list.next('.show_more').addClass('show')}}})}
$(document).ready(function(){if($('.mobility_bcs').length){var detectBackOrForward=function(onBack,onForward){hashHistory=[window.location.hash];historyLength=window.history.length;return function(){var hash=window.location.hash,length=window.history.length;if(hashHistory.length&&historyLength==length){if(hashHistory[hashHistory.length-2]==hash){hashHistory=hashHistory.slice(0,-1);onBack()}else{hashHistory.push(hash);onForward()}}else{hashHistory.push(hash);historyLength=length}}};$(window).on('popstate',function(event){checkBcsOverlayHash()});$('body').append('<div id="mobilityIbcsOverlay"><p class="subscriptionContentHeader"></p><div class="subscriptionContent"></div></div>');if(window.location.hash.substring(1)){checkBcsOverlayHash()}
$('.mobility_bcs .mobileBcs .singleSubscription .subscriptionHeader').click(function(){openBcsOverlay($(this));window.location.hash='#bcs'+$(this).attr('data-bcs')});$('#mobilityIbcsOverlay .subscriptionContentHeader').click(function(){closeBcsOverlay();history.pushState('',document.title,window.location.pathname)});function checkBcsOverlayHash(){locationHash=window.location.hash.substring(1);if(locationHash){if(locationHash.indexOf('bcs')>-1&&locationHash.length==4){var bcsID=locationHash.replace('bcs','');openBcsOverlay($('.mobileBcs .subscriptionHeader[data-bcs="'+bcsID+'"]'))}else{closeBcsOverlay()}}else{closeBcsOverlay()}}
function openBcsOverlay(element){$('#mobilityIbcsOverlay .subscriptionContentHeader').html(element.html());$('#mobilityIbcsOverlay .subscriptionContent').html(element.siblings('.subscriptionContent').html());$('body').addClass('bcsOverlayOpen')}
function closeBcsOverlay(){$('body').removeClass('bcsOverlayOpen')}
$('.mobility_bcs .desktopBcs .hoverRow .bcsCol').mouseenter(function(){if($(this).hasClass('subscription1Col')&&$('.mobility_bcs .desktopBcs .hoverRow .subscription1Col > p > a.detail-link').length){$('.mobility_bcs .desktopBcs .hoverRow .subscription1Col').addClass('hover')}
if($(this).hasClass('subscription2Col')&&$('.mobility_bcs .desktopBcs .hoverRow .subscription2Col > p > a.detail-link').length){$('.mobility_bcs .desktopBcs .hoverRow .subscription2Col').addClass('hover')}
if($(this).hasClass('subscription3Col')&&$('.mobility_bcs .desktopBcs .hoverRow .subscription3Col > p > a.detail-link').length){$('.mobility_bcs .desktopBcs .hoverRow .subscription3Col').addClass('hover')}
if($(this).hasClass('subscription4Col')&&$('.mobility_bcs .desktopBcs .hoverRow .subscription4Col > p > a.detail-link').length){$('.mobility_bcs .desktopBcs .hoverRow .subscription4Col').addClass('hover')}});$('.mobility_bcs .desktopBcs .hoverRow .bcsCol').mouseleave(function(){if($(this).hasClass('subscription1Col')){$('.mobility_bcs .desktopBcs .hoverRow .subscription1Col').removeClass('hover')}
if($(this).hasClass('subscription2Col')){$('.mobility_bcs .desktopBcs .hoverRow .subscription2Col').removeClass('hover')}
if($(this).hasClass('subscription3Col')){$('.mobility_bcs .desktopBcs .hoverRow .subscription3Col').removeClass('hover')}
if($(this).hasClass('subscription4Col')){$('.mobility_bcs .desktopBcs .hoverRow .subscription4Col').removeClass('hover')}});$('.mobility_bcs .desktopBcs .optionRow .openClose').click(function(){$(this).closest('.optionRow').toggleClass('open')})}});$(document).ready(function(){if($('.mobility_ics').length){var detectBackOrForward=function(onBack,onForward){hashHistory=[window.location.hash];historyLength=window.history.length;return function(){var hash=window.location.hash,length=window.history.length;if(hashHistory.length&&historyLength==length){if(hashHistory[hashHistory.length-2]==hash){hashHistory=hashHistory.slice(0,-1);onBack()}else{hashHistory.push(hash);onForward()}}else{hashHistory.push(hash);historyLength=length}}};$(window).on('popstate',function(event){checkIcsOverlayHash()});$('body').append('<div id="mobilityIicsOverlay"><p class="subscriptionContentHeader"></p><div class="subscriptionContent"></div></div>');if(window.location.hash.substring(1)){checkIcsOverlayHash()}
$('.mobility_ics .mobileIcs .singleSubscription .subscriptionHeader').click(function(){openIcsOverlay($(this));window.location.hash='#ics'+$(this).attr('data-ics')});$('#mobilityIicsOverlay .subscriptionContentHeader').click(function(){closeIcsOverlay();history.pushState('',document.title,window.location.pathname)});function checkIcsOverlayHash(){locationHash=window.location.hash.substring(1);if(locationHash){if(locationHash.indexOf('ics')>-1&&locationHash.length==4){var icsID=locationHash.replace('ics','');openIcsOverlay($('.mobileIcs .subscriptionHeader[data-ics="'+icsID+'"]'))}else{closeIcsOverlay()}}else{closeIcsOverlay()}}
function openIcsOverlay(element){$('#mobilityIicsOverlay .subscriptionContentHeader').html(element.html());$('#mobilityIicsOverlay .subscriptionContent').html(element.siblings('.subscriptionContent').html());$('body').addClass('icsOverlayOpen')}
function closeIcsOverlay(){$('body').removeClass('icsOverlayOpen')}
$('.mobility_ics .desktopIcs .hoverRow .icsCol').mouseenter(function(){if($(this).hasClass('subscription1Col')&&$('.mobility_ics .desktopIcs .hoverRow .subscription1Col > p > a.detail-link').length){$('.mobility_ics .desktopIcs .hoverRow .subscription1Col').addClass('hover')}
if($(this).hasClass('subscription2Col')&&$('.mobility_ics .desktopIcs .hoverRow .subscription2Col > p > a.detail-link').length){$('.mobility_ics .desktopIcs .hoverRow .subscription2Col').addClass('hover')}
if($(this).hasClass('subscription3Col')&&$('.mobility_ics .desktopIcs .hoverRow .subscription3Col > p > a.detail-link').length){$('.mobility_ics .desktopIcs .hoverRow .subscription3Col').addClass('hover')}
if($(this).hasClass('subscription4Col')&&$('.mobility_ics .desktopIcs .hoverRow .subscription4Col > p > a.detail-link').length){$('.mobility_ics .desktopIcs .hoverRow .subscription4Col').addClass('hover')}});$('.mobility_ics .desktopIcs .hoverRow .icsCol').mouseleave(function(){if($(this).hasClass('subscription1Col')){$('.mobility_ics .desktopIcs .hoverRow .subscription1Col').removeClass('hover')}
if($(this).hasClass('subscription2Col')){$('.mobility_ics .desktopIcs .hoverRow .subscription2Col').removeClass('hover')}
if($(this).hasClass('subscription3Col')){$('.mobility_ics .desktopIcs .hoverRow .subscription3Col').removeClass('hover')}
if($(this).hasClass('subscription4Col')){$('.mobility_ics .desktopIcs .hoverRow .subscription4Col').removeClass('hover')}});$('.mobility_ics .desktopIcs .optionRow .openClose').click(function(){$(this).closest('.optionRow').toggleClass('open')})}})