/* * With Moustrap we bind the ctrl+shif+1 keys to open the acb-panel * we check if the panel is already open * The click functions to open/close the acb-panel from the buttons * And the bubble function is called if the acb-panel open to close the bubble */ (function($) { $(document).ready(function(){ Mousetrap.bind('0', acbKeyStroke); if ($.cookie('stay-open') != undefined) { if ($.cookie('stay-open') == 'show') { $("#acb-page").show(); $(".acb-panel").show(); $("#acb-onoff").hide(); } if ($.cookie('stay-open') == 'hide') { } } function acbKeyStroke(){ if($('.acb-panel').css('display') == 'none'){ bubble(); tutorial(); $(".acb-panel").stop().slideToggle("slow"); $("#acb-page").stop().slideToggle("slow"); $("#acb-onoff").stop().slideToggle("fast"); $("#voiceDiv").hide(); $("#voiceDiv-EN").hide(); $.cookie('stay-open', 'show', {path: '/'} ); } else{ $(".acb-panel").stop().slideToggle("slow"); $("#acb-page").stop().slideToggle("slow"); $("#acb-onoff").stop().slideToggle("fast"); $("#acb-infoPage").hide(); $.cookie('stay-open', 'hide', {path: '/'}); } } $("#acb-onoff").click(function(){ bubble(); tutorial(); $(".acb-panel").stop().slideToggle("slow"); $("#acb-page").stop().slideToggle("slow"); $("#acb-onoff").hide(); $("#voiceDiv").hide(); $("#voiceDiv-EN").hide(); $.cookie('stay-open', 'show', {path: '/'} ); }); $("#acb-flip-top").click(function(){ $(".acb-panel").stop().slideToggle("slow"); $("#acb-page").stop().slideToggle("slow"); $("#acb-onoff").stop().slideToggle("fast"); $("#acb-infoPage").hide(); $.cookie('stay-open', 'hide', {path: '/'}); }); }); function bubble(){ var vid = document.getElementById("intro-voice"); $(".oval-thought").css('display','none'); $(".smallCircle").css('display','none'); $(".bigCircle").css('display','none'); if (vid !=null) { vid.autoplay = false; vid.load(); } } function tutorial(){ if ($.cookie('tutorial') != 'hide') { $.cookie('tutorial', 'hide', {expires:9999,path: '/'} ); $(".arrow_box").delay(1000).fadeIn(); $(".arrow_box").delay(4000).fadeOut(); $(".arrow_box").css("display", "table"); } } })(jQuery);