var iOS=['iPad','iPhone','iPod'].indexOf(navigator.platform)>=0;var jamesbond=document.getElementById('bond').play();function isPlaying(playerId){var player=document.getElementById(playerId);return!player.paused&&!player.ended&&0{$('.play').fadeIn();$('.play').addClass("safarimode")}).then(()=>{})}});$(window).scroll(function(event){var scroll=$(window).scrollTop();var navpos=$("main#home").height();var marquetop=$("#marque").offset().top;var marquebtm=$("#marque").offset().top+$("#marque").outerHeight();var lookbooktop=$("#lookbook").offset().top;var lookbookbtm=$("#lookbook").offset().top+$("#lookbook").outerHeight();var ventetop=$("#vente").offset().top;var ventebtm=$("#vente").offset().top+$("#vente").outerHeight();var contacttop=$("#contact").offset().top;var contactbtm=$("#contact").offset().top+$("#contact").outerHeight();var bottom_of_screen=$(window).scrollTop()+$(window).height();var top_of_screen=$(window).scrollTop();$("main#lookbook .center").attr("style","position:absolute;");if((bottom_of_screen>marquetop)&&(top_of_screenlookbooktop)&&(top_of_screenventetop)&&(top_of_screencontacttop)&&(top_of_screennavpos){$("nav ul").fadeIn(500);$("ul.langswitch").remove();$("main#home h1,a").attr("style","position:absolute;");if($('.play').hasClass("safarimode")){$('.play').addClass("inbackground")}else{document.getElementById('bond').pause()}}else{$("nav ul").fadeOut(500);if($('.play').hasClass("safarimode")){$('.play').removeClass("inbackground")}else{document.getElementById('bond').play()} $("main#home h1,a").attr("style","position:fixed;")}});$('#preloader').fadeOut(1200,function(){$(this).remove()});$('.play').click(function(){if($('.play').hasClass("active")){document.getElementById('bond').pause()}else{document.getElementById('bond').play()} $('.play').toggleClass('active');return!1});$("#lang").click(function(event){var lang=$(this).data("lang");window.location.href="?lang="+lang;return!1;event.preventDefault()});$('a.scroll').on('click',function(){var page=$(this).attr('href');var speed=900;$('html, body').animate({scrollTop:$(page).offset().top},speed);return!1});if(iOS){}else{window.setInterval(function(){var nextimg=parseInt($("img#visualhobbs").data("picture"))+1;if(nextimg==5){nextimg=1} $("img#visualhobbs").animate({opacity:0.4},{duration:800,complete:function(){$(this).attr("src","img/"+$(this).data("pic"+nextimg));$(this).data("picture",nextimg)}}).animate({opacity:1},{duration:700})},4000)} $("form#contact-form").submit(function(event){var formData={'name':$('form input[name=name]').val(),'email':$('form input[name=email]').val(),'content':$('textarea').val()};$.ajax({type:'POST',url:'mailing.php',data:formData,dataType:'json',encode:!0}).done(function(data){});$("svg.send-icn").addClass("sent");$("form").fadeOut(500);$("div.thanks").fadeIn(500);event.preventDefault();return!1});$("main#home").fadeIn();mapboxgl.accessToken='pk.eyJ1IjoiamJrYWxveWEiLCJhIjoiY2lvOHo4eTJ2MDA5M3Vza25ubmo5Y282eSJ9.katDGEnm9DEQaBBrWt8Vag';var map=new mapboxgl.Map({container:'map',style:'mapbox://styles/mapbox/dark-v9',zoom:14,center:[2.2994676,48.8687986]});map.on('load',function(){map.on('click','points',function(e){$("div.card").removeClass("show");$("div.card."+e.features[0].properties.description).addClass("show");$('html, body').animate({scrollTop:$("div.card."+e.features[0].properties.description).offset().top},850)}) map.loadImage('http://hobbscashmere.com/img/pin2.png',function(error,image){if(error)throw error;map.addImage('pin',image);map.addLayer({"id":"points","type":"symbol","source":{"type":"geojson","data":{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"description":"hobbs","icon":"pin"},"geometry":{"type":"Point","coordinates":[2.2994676,48.8687986]}},{"type":"Feature","properties":{"description":"peninsula","icon":"pin"},"geometry":{"type":"Point","coordinates":[2.2911653,48.8710645]}}]}},"layout":{"icon-image":"pin","icon-size":0.15}})})});$('body').on('click','.maplinker',function(){var iOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;var url="";if(iOS===!0){url="http://maps.apple.com/?ll="+$(this).data("ll")}else{url="http://maps.google.com/maps?daddr="+$(this).data("addr")} window.open(url,'_blank')});$(".custom-select").each(function(){var classes=$(this).attr("class"),id=$(this).attr("id"),name=$(this).attr("name");var template='
';template+=''+$(this).attr("placeholder")+'';template+='
';$(this).find("option").each(function(){template+=''+$(this).html()+''});template+='
';$(this).wrap('
');$(this).hide();$(this).after(template)});$(".custom-option:first-of-type").hover(function(){$(this).parents(".custom-options").addClass("option-hover")},function(){$(this).parents(".custom-options").removeClass("option-hover")});$(".custom-select-trigger").on("click",function(){$('html').one('click',function(){$(".custom-select").removeClass("opened")});$(this).parents(".custom-select").toggleClass("opened");event.stopPropagation()});$(".custom-option").on("click",function(){var category=$(this).data("value");$('div.grid').each(function(){$(this).fadeOut(600);$(this).addClass("notvisible");$(this).removeClass("visible")}) $('div.grid.'+category).fadeIn(600);$('div.grid.'+category).removeClass("notvisible").addClass("visible");$(this).parents(".custom-select-wrapper").find("select").val($(this).data("value"));$(this).parents(".custom-options").find(".custom-option").removeClass("selection");$(this).addClass("selection");$(this).parents(".custom-select").removeClass("opened");$(this).parents(".custom-select").find(".custom-select-trigger").text($(this).text())});/* JS by Jean-Baptiste KALOYA */