jQuery().ready(function(){
$('html').addClass('js');
$('html').removeClass('no-js');
var deviceAgent = navigator.userAgent.toLowerCase();
ismobile = (deviceAgent.match(/(iphone|ipod|ipad)/) ||
deviceAgent.match(/(android)/) ||
deviceAgent.match(/(iemobile)/) ||
deviceAgent.match(/iphone/i) ||
deviceAgent.match(/ipad/i) ||
deviceAgent.match(/ipod/i) ||
deviceAgent.match(/blackberry/i) ||
deviceAgent.match(/bada/i));
var isipad = navigator.userAgent.match(/iPad/i) != null;
var isiphone = (navigator.userAgent.match(/iPhone/i) != null) || (navigator.userAgent.match(/iPod/i) != null);
if (isipad)$('html').addClass('ipad');
if (isiphone)$('html').addClass('iphone');
if (ismobile)$('html').addClass('ismobile');
var event = (isipad) ? 'touchstart' : 'click';
//event = (isipad) ? 'touchstart' : 'mouseenter';
var event2 = (isipad) ? '' : 'mouseleave';
if (ismobile) $(".textblock h3").find('br').replaceWith(" ");
$(window).scroll(function() {
if($(this).scrollTop() > 500) {
$('#toTop').fadeIn();
} else {
$('#toTop').fadeOut();
}
});
$('#toTop').hide().click(function() {
$('body,html').animate({scrollTop:0},800);
});
/*
$(".pure-u-sm-1-2 .image-title").fitText(1, { minFontSize: '20px', maxFontSize: '30px' });
$(".pure-u-sm-1-3 .image-title").fitText(1, { minFontSize: '16px', maxFontSize: '26px' });
poptrox
$('.main_content .textblock a.poptrox.smal').not('ismobile').attr('data-poptrox', 'iframe,800x280');
$('.ismobile .main_content .textblock a.poptrox.smal').attr('data-poptrox', 'iframe,800x480');
$('.main_content .textblock a.poptrox.wide').attr('data-poptrox', 'iframe,3000x700');
$('.main_content .textblock a.poptrox.smal').parent().poptrox({
usePopupCaption: false,
overlayColor: "#ffffff",
popupPadding: 0,
windowMargin: 0
});$("h2").fitText(1, { minFontSize: '10px', maxFontSize: '22px' });
*/
var element = $('#header');
var watcher = scrollMonitor.create( element );
watcher.lock();
watcher.stateChange(function() {
$(element).toggleClass('fixed', this.isAboveViewport);
//(this.isAboveViewport) ? $("#logo").attr("src","../img/hilmar-juckel2.png") : $("#logo").attr("src","../img/hilmar-juckel.png");
});
$(".lightbox .ltb").fancybox();
$(".lightbox2 .ltb").fancybox();
$('.eheight').matchHeight();
$(".textblock_video").fitVids();
$('.nav-item-facebook_rwd > a').attr('target','_blank').attr('class','extlink fontello');
$('.sharefb').bind( "click", function(e){
trace("fb");
$(e.target).css('background-position', '0px -48px');
setFacebook();
e.preventDefault();
});
//$('img').jcaption();
$('img').jcaption({
autoWidth: true,
copyStyle: true,
animate: true,
show: {height: "show"},
hide: {height: "hide"}
});
$('img.lazy').jail({
//triggerElement : 'div.jail',
event : 'scroll',
timeout : 100
});
/*
$('a[href*=#]').bind( "click", function(e){
var anchor = $(this);
var anchor_ = anchor.attr('href').split('#')[1];
if (!anchor_) return
$('html, body').stop().animate({
scrollTop: ($("#" + anchor_).offset().top) -115
}, 1000);
e.preventDefault();
});
*/
});
function trace(s) {
try { console.log(s) } catch (e) { alert(s) }
};
$( window ).resize(function() {
if ($( "body" ).width() > 760) {
} else {
$('#header, header').removeClass();
//trace($( "body" ).width());
}
});
window.addEventListener("load", function(){
window.cookieconsent.initialise({
palette:{
popup: {background: '#fff', text: '#000', link: '#000'},
button: {background: "#fff"}
},
layout: 'basic',
elements: {
header: ' ',
message: '{{message}}',
messagelink: '{{message}} {{link}}',
dismiss: '{{dismiss}}',
allow: '{{allow}}',
deny: '{{deny}}',
link: '{{link}}',
close: '{{close}}',
},
position: 'bottom',
revokable: false,
content: {
message: 'Thomas Bechtold Architekten nutzt das Facebook-Plugin. Informationen zu Ihrer Nutzung unserer Website finden Sie unter',
link: 'Datenschutz',
href: '../de/datenschutz.html#cookies',
dismiss: 'Ok'
},
compliance: {
'info': '{{dismiss}}',
'opt-in': '{{dismiss}}{{allow}}',
'opt-out': '{{deny}}{{dismiss}}'
},
onStatusChange: function(status) {
},
location: false,
law: {
regionalLaw: false,
}
})
});