function DetailsWindow(url){ window.open( url, "new", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=740,height=600"); } $(function () { $('a[href^="#"]').click(function(){ var speed = 500; var href= $(this).attr("href"); var target = $(href == "#" || href == "" ? 'html' : href); var position = target.offset().top; $("html, body").animate({scrollTop:position}, speed, "swing"); return false; }); var topBtn = $('#pagetop'); $(window).scroll(function () { if ($(this).scrollTop() > 150) { topBtn.removeClass('nofix'); topBtn.addClass('fixed'); } else { if (topBtn.hasClass('fixed')) { topBtn.addClass('nofix'); } topBtn.removeClass('fixed'); } }); topBtn.click(function () { $('body,html').animate({ scrollTop: 0 }, 1000); return false; }); $('#Gnavi').hide(); $('.open_menu').click(function () { $('#Gnavi').slideDown(); $('.close_menu').fadeIn(); }); $('.close_menu').click(function () { $('#Gnavi').slideUp(); $('.close_menu').fadeOut(); }); }); $(function () { var video = document.getElementById('video2'); $('#openModal').click(function(){ $('#modalArea').fadeIn(); video.play(); }); $('#closeModal , #modalBg').click(function(){ video.pause(); video.currentTime = 0; $('#modalArea').fadeOut(); }); });