/* Hear, O Israel: The LORD our God is one LORD: And thou shalt love the LORD thy God with all thine heart, and with all thy soul, and with all thy might. That ye love one another; as I have loved you, that ye also love one another. P.o.L. : pol623@naver.com http://www.pol27.com Copyright (c) 2016 - Path of Life */ var map, aNumber = 0;; var myLatLng = {lat: 37.511455, lng: 127.104941}; var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var filter = "win16|win32|win64|mac"; var player, mv01 = 0; $(function() { $('.icon-bar').css("transition", ".4s"); // if($(document).width() <= 768 ) $(".navbar-default .navbar-collapse").css("background", "#f8f8f8"); $(".navbar-default .navbar-brand").css("color", "#fff"); $(".navbar-default .navbar-nav>li>a").css("color", "#fff"); $('.navbar-toggle').on("click", function() { if(!$('.navbar-collapse').hasClass('in')) { $('.icon-bar:nth-child(2)').css("transform","rotate(-30deg)"); } else { $('.icon-bar:nth-child(2)').css("transform","rotate(0deg)"); } }); $(".nav>li>a").on("click", function() { if($('.navbar-collapse').hasClass('in')) { $('.navbar-toggle').trigger('click'); $('.navbar-collapse').removeClass('in'); } }); if($('#topslider').length) { $('#topslider').slidesjs({ play : { active: false, effect : "fade", interval: 8000, auto: true, swap: false, }, effect: { fade : { speed: 1000, crossfade: true } }, pagination : { effect : "fade", active: true }, navigation : { effect : "fade", active: true }, callback : { loaded : function(number) { setLoadMain(number); }, start : function(number) { setStartMain(number); }, complete : function(number) { setComMain(number); } } }); } if($('#aboutus').length) { $('#aboutus').slidesjs({ play : { auto: false, swap: false }, pagination : { active: false }, callback : { loaded : function(number) { aNumber = number; setHeightJs($('#aboutus'), $('#aboutus .slidesjs-container'), $('#aboutus .slidesjs-control'), $('#aboutus .slidesjs-slide:nth-child(' + number + ')')); }, start : function(number) { }, complete : function(number) { aNumber = number; if(number != 5) { setHeightJs($('#aboutus'), $('#aboutus .slidesjs-container'), $('#aboutus .slidesjs-control'), $('#aboutus .slidesjs-slide:nth-child(' + number + ')')); } else { var orgHeight = $('.org .director').height() + $('.org .subdirector').height() + $('.org .departments').height(); setHeightChat($('#aboutus'), $('#aboutus .slidesjs-container'), $('#aboutus .slidesjs-control'), orgHeight); } } } }); } if($('#snotice>tbody').length) { $('#snotice').addClass("swiper-container"); $('#snotice>tbody').addClass("swiper-wrapper"); $('#snotice>tbody>tr').addClass("swiper-slide"); var sNotice = new Swiper('.swiper-container', { direction : 'vertical', loop: true, autoplay: 4000, autoplayDisableOnInteraction: false, nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev' }); } $(".navbar a, a[href='#body'], a[href='#cornerstone'], a[title='ABOUT'], a[title='PRODUCT']").on('click', function(event) { if (this.hash !== "") { event.preventDefault(); var hash = this.hash; $('html, body').animate({ scrollTop: $(hash).offset().top }, 900, function(){ window.location.hash = hash; }); } }); if($('.board_output_gallery_img').length) { $('.board_output_gallery_img>a').removeAttr("href"); } var aboutTop = $('#about').offset().top - 100, pieRowTop = $('.pie-row').offset().top - 600, intShowChart = 0, intPieChart = 0; $(window).scroll(function() { var winTop = $(window).scrollTop(); if(winTop == 0) { $('.navbar-default').addClass("trans-background"); $(".navbar-default .navbar-brand").css("color", "#fff"); $(".navbar-default .navbar-nav>li>a").css("color", "#fff"); } else { $('.navbar-default').removeClass("trans-background"); $(".navbar-default .navbar-brand").css("color", "#777"); $(".navbar-default .navbar-nav>li>a").css("color", "#777"); } if(winTop > 768) { //$('#updown').css("display", "block"); $('#quickup').css("display", "block"); } else { //$('#updown').css("display", "none"); $('#quickup').css("display", "none"); } showSideMenuBar(winTop, 200); $(".slideanim").each(function(){ var pos = $(this).offset().top; if (pos < winTop + 600) { $(this).addClass("slide"); } }); if(!intShowChart && $('#container').length && aboutTop < winTop) { $('#container').highcharts({ chart: { type: 'column' }, colors: [ '#7cb5ec', '#10386c' ], title: { text: '' }, subtitle: { text: '' }, xAxis: { categories: ['Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug'] }, yAxis: { title: { text: '' } }, plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: false }, series: { animation: { duration: 2000 } } }, series: [{ name: 'In', data: [9.5, 14.5, 18.4, 21.5, 25.2, 26.5] }, { name: 'Out', data: [5.7, 8.5, 11.9, 15.2, 17.0, 16.6] }], exporting: { enabled: false } }); intShowChart++; } if(!intPieChart && ('#piechart').length && pieRowTop < winTop) { $('#piechart').highcharts({ chart: { type: 'pie', backgroundColor: '#f6f6f6' }, colors: [ '#90ed7d', '#7cb5ec', '#434348', '#f7a35c', '#8085e9' ], title: { text: '' }, series: [{ name: 'Brands', colorByPoint: true, data: [{ name: 'Cafe24', y: 56.33 }, { name: 'PoL27', y: 24.03, sliced: true, selected: true }, { name: 'Dontknow', y: 10.38 }, { name: 'Maptri', y: 4.77 }, { name: 'Gori', y: 0.91 }, { name: 'Unknown', y: 0.2 }] }], exporting: { enabled: false } }); intPieChart++; } }); $(window).resize(function() { if($('#aboutus').length) { if(aNumber != 5) { setHeightJs($('#aboutus'), $('#aboutus .slidesjs-container'), $('#aboutus .slidesjs-control'), $('#aboutus .slidesjs-slide:nth-child(' + aNumber + ')')); } else { var orgHeight = $('.org .director').height() + $('.org .subdirector').height() + $('.org .departments').height(); setHeightChat($('#aboutus'), $('#aboutus .slidesjs-container'), $('#aboutus .slidesjs-control'), orgHeight); } } if(mv01) { var w = $('#ser02 .modal-body').width() - 30; var h = w/1.77; setPlayerSize(w, h); } }); $('.familysite').change(function() { window.open($('.familysite option:selected').val(), "_blank"); }); $("div[data-target='#ser02']").on('click', function() { if(player === undefined) { player = new YT.Player('mv01', { height : '100%', width : '100%', playerVars : { 'autoplay' : 0, 'controls' : 1, 'loop' : 0, 'showinfo' : 0, 'rel' : 0, 'disablekb' : 1, 'modestbranding' : 1 }, events : { 'onReady' : onPlayerReady, 'onStateChange' : onPlayerStateChange } }); } }); $('#ser02').on('show.bs.modal', function() { mv01 = 1; }); $('#ser02').on('hide.bs.modal', function() { pauseVideo(); mv01 = 0; }); $('#coll01').on("show.bs.collapse", function() { $('#coll02').collapse('hide'); $('#coll03').collapse('hide'); gotoThe('.last-product img'); }); $('#coll02').on("show.bs.collapse", function() { $('#coll01').collapse('hide'); $('#coll03').collapse('hide'); gotoThe('.last-product img'); }); $('#coll03').on("show.bs.collapse", function() { $('#coll01').collapse('hide'); $('#coll02').collapse('hide'); gotoThe('.last-product img'); }); if($('#tfaq').length) { $('#tfaq>tbody').addClass("panel-group"); $('#tfaq>tbody').attr("id", "accordion"); $('#tfaq>tbody').attr("role", "tablist"); $('#tfaq>tbody').attr("aria-multiselectable", "true"); $('#tfaq>tbody>tr').removeClass('board_output_2_tr'); $('#tfaq>tbody>tr').addClass('panel panel-default'); $('#tfaq>tbody>tr>td:nth-child(2)').addClass("panel-heading"); $('#tfaq>tbody>tr>td:nth-child(2)').attr("role", "tab"); $('#tfaq>tbody>tr>td:nth-child(2)').removeClass('bd_out1'); $('#tfaq>tbody>tr>td:nth-child(2)').removeAttr('width'); $('#tfaq>tbody>tr>td:nth-child(2)').removeAttr('style'); $('#tfaq>tbody>tr>td:nth-child(2)>a').attr("role", "button"); $('#tfaq>tbody>tr>td:nth-child(2)>a').attr("data-toggle", "collapse"); $('#tfaq>tbody>tr>td:nth-child(2)>a').attr("data-parent", "#accordinon"); $('#tfaq>tbody>tr>td:nth-child(2)>a').attr("aria-expanded", "false"); $('#tfaq>tbody>tr>td:nth-child(3)').removeAttr("width"); $('#tfaq>tbody>tr>td:nth-child(3)').removeAttr("style"); $('#tfaq>tbody>tr>td:nth-child(3)').attr("role", "tabpanel"); $('#tfaq>tbody>tr>td:nth-child(3)').addClass("panel-collapse collapse"); $('#tfaq>tbody>tr>td:nth-child(3)').css({"height" : "0", "overflow" : "hidden"}); $('#tfaq>tbody>tr:nth-child(1)>td:nth-child(2)').attr("id", "headingOne"); $('#tfaq>tbody>tr:nth-child(1)>td:nth-child(2)>a').attr("href", "#collapseOne"); $('#tfaq>tbody>tr:nth-child(1)>td:nth-child(2)>a').attr("aria-controls", "collapseOne"); $('#tfaq>tbody>tr:nth-child(1)>td:nth-child(3)').attr("id", "collapseOne"); $('#tfaq>tbody>tr:nth-child(1)>td:nth-child(3)').attr("aria-labelledby", "headingOne"); $('#tfaq>tbody>tr:nth-child(2)>td:nth-child(2)').attr("id", "headingTwo"); $('#tfaq>tbody>tr:nth-child(2)>td:nth-child(2)>a').attr("href", "#collapseTwo"); $('#tfaq>tbody>tr:nth-child(2)>td:nth-child(2)>a').attr("aria-controls", "collapseTwo"); $('#tfaq>tbody>tr:nth-child(2)>td:nth-child(3)').attr("id", "collapseTwo"); $('#tfaq>tbody>tr:nth-child(2)>td:nth-child(3)').attr("aria-labelledby", "headingTwo"); $('#tfaq>tbody>tr:nth-child(3)>td:nth-child(2)').attr("id", "headingThree"); $('#tfaq>tbody>tr:nth-child(3)>td:nth-child(2)>a').attr("href", "#collapseThree"); $('#tfaq>tbody>tr:nth-child(3)>td:nth-child(2)>a').attr("aria-controls", "collapseThree"); $('#tfaq>tbody>tr:nth-child(3)>td:nth-child(3)').attr("id", "collapseThree"); $('#tfaq>tbody>tr:nth-child(3)>td:nth-child(3)').attr("aria-labelledby", "headingThree"); $('#tfaq>tbody>tr:nth-child(4)>td:nth-child(2)').attr("id", "headingFour"); $('#tfaq>tbody>tr:nth-child(4)>td:nth-child(2)>a').attr("href", "#collapseFour"); $('#tfaq>tbody>tr:nth-child(4)>td:nth-child(2)>a').attr("aria-controls", "collapseFour"); $('#tfaq>tbody>tr:nth-child(4)>td:nth-child(3)').attr("id", "collapseFour"); $('#tfaq>tbody>tr:nth-child(4)>td:nth-child(3)').attr("aria-labelledby", "headingFour"); } if($('#inside').length) { $('#inside>tbody').attr("id", "inside-block"); // $('#inside>tbody').attr("data-interval", "false"); $('#inside>tbody').attr("data-ride", "carousel"); $('#inside>tbody').addClass("carousel slide"); $('#inside>tbody>tr').attr("role", "listbox"); $('#inside>tbody>tr').addClass("carousel-inner"); $('#inside>tbody>tr>td').addClass('item'); $('#inside>tbody>tr>td:first-child').addClass('active'); } if($('#contact').length) { $('#contact input').addClass('form-control'); $('#contact textarea').addClass('form-control'); $('#contact input[name="name"]').attr("placeholder", "NAME"); $('#contact input[name="receiver_email"]').attr("placeholder", "E-MAIL"); $('#contact textarea').attr("placeholder", "CONTENTS"); } $('#collapseOne, #collapseTwo, #collapseThree, #collapseFour').on("show.bs.collapse", function() { $(this).addClass("setHeightColl"); }); $('#collapseOne, #collapseTwo, #collapseThree, #collapseFour').on("hide.bs.collapse", function() { $(this).removeClass("setHeightColl"); }); function showSideMenuBar(w, m) { if(w >= m) { $('#side-menu-bar').css({'transform' : 'matrix(1, 0, 0, 1, 0, 0)'}); } else { $('#side-menu-bar').css({'transform' : 'translate(220%, 0%) matrix(0.76604, 0.64278, -0.64278, 0.76604, 0, 0)'}); } } // $('.face').on('click', function() { // var facebookWindow = window.open('https://www.facebook.com/sharer/sharer.php?u=' + document.URL, 'facebook-popup', 'height=350,width=600'); // if(facebookWindow.focus) { facebookWindow.focus(); } // return false; // }); // $('.twitter').on('click', function() { // var twitterWindow = window.open('https://twitter.com/share?url=' + document.URL, 'twitter-popup', 'height=350,width=600'); // if(twitterWindow.focus) { twitterWindow.focus(); } // return false; // }); setTimeout(initMap(), 7000); var filter = "win16|win32|win64|mac", isMobile = 0, isFrameset = 0, isToggle = 0; var serverURL = "http://" + POLServerIp + ":" + POLServerPort; var name = "손님" var room = "12"; var socket, mobile = "PoLB004", showchat, hidecontents; var delta = 300, timer = null, mwidth = 0, rwidth = 0, omwidth = 0, orwidth = 0; $('#openchat').bind('click', function() { $('#chatroom').css({'opacity' : '1', 'visibility' : 'visible', 'top' : '0'}); }); $('.chat-top-close').bind('click', function() { $('#chatroom').css({'opacity' : '0', 'visibility' : 'hidden', 'top' : '500px'}); }); if(navigator.platform) { if(0 > filter.indexOf(navigator.platform.toLowerCase())) { isMobile = 1; mobile += " Mobile"; } } socket = io.connect(serverURL); socket.on("connect_error", function(err) { getConfig(); $('#openchat').css('display', 'none'); $('#chatroom').css({'opacity' : '0', 'visibility' : 'hidden', 'top' : '500px'}); socket.io.engine.hostname = POLServerIp; socket.io.opts.hostname = POLServerIp socket.io.uri = "http://" + POLServerIp + ":" + POLServerPort; }); socket.on("connection", function(data) { if(data.type == "connected") { socket.emit("connection", {type : "join", name : name, room : room, sip : sip, mobile : mobile}); $('#openchat').css('display', 'flex'); } }); socket.on("system", function(data) { writeMessage("system", "system", data.message, ""); }); socket.on("message", function(data) { writeMessage("order", data.name, data.message, ""); }); socket.on("disconnect", function(data) { $('#openchat').css('display', 'none'); $('#chatroom').css({'opacity' : '0', 'visibility' : 'hidden', 'top' : '500px'}); }); // $(window).bind("beforeunload", function() { // socket.emit("leave", {name : name, message : "leave", sip : sip}); // socket.close(); // }); $("#name-input").keydown(function(key) { if(key.which == 13) { $("#message-input").focus(); } }); $("#message-button").click(function() { var msg = $("#message-input").val().replace(//gi, ">"); if($('#name-input').val().length <= 0) { alert("이름을 설정해 주세요."); $('#name-input').focus(); return false; } name = $('#name-input').val(); if(msg != "") { socket.emit("user", {name : name, message : msg, sip : sip}); writeMessage("me", name, msg, sip); $("#message-input").val(""); $("#message-input").focus(); } }); $("#message-input").keydown(function (key) { var msg = $("#message-input").val().replace(//gi, ">"); if(key.keyCode == 13 && msg != ""){ if($('#name-input').val().length <= 0) { alert("이름을 설정해 주세요."); $('#name-input').focus(); return false; } name = $('#name-input').val(); socket.emit("user", {name : name, message : msg, sip : sip}); writeMessage("me", name, msg, sip); $("#message-input").val(""); $("#message-input").focus(); } }); function writeMessage(type, name, message, sip) { var html = "", printName = name; if(type != "system" ) { if(sip != "") { html = "

{USER}

{MESSAGE}

"; } else { if(printName == "Path of Life") { printName = "폴27"; html = "

{USER}

{MESSAGE}

"; } else { html = "

{USER}

{MESSAGE}

"; } } } else if(type == "system") { html = "
×{MESSAGE}
" } html = html.replace("{USER}", printName); html = html.replace("{MESSAGE}", message); $(html).appendTo(".pol-message"); $('.pol-message').scrollTop($('.pol-message')[0].scrollHeight); } function getConfig() { $('#pol-chat-config').remove(); var head= document.getElementsByTagName('head')[0]; var script= document.createElement('script'); script.type= 'text/javascript'; script.id = 'pol-chat-config'; script.src= 'http://pol27.com/pol/js/pol27.chat.config.00.js'; head.appendChild(script); } var constyle = [ 'background: linear-gradient(#D33106, #571402)' , 'border: 1px solid #3E0E02' , 'color: white' , 'display: block' , 'text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3)' , 'box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 5px 3px -5px rgba(0, 0, 0, 0.5), 0 -13px 5px -10px rgba(255, 255, 255, 0.4) inset' , 'line-height: 200px' , 'font-family: Verdana' , 'font-size: 100px' , 'text-align: center' , 'font-weight: bold' ].join(';'); console.log('%cPATH OF LIFE©', constyle); }); function onTop() { $('html').animate({ scrollTop: 0 }, 500); return false; } function initMap() { if(document.getElementById('googleMap')) { map = new google.maps.Map(document.getElementById('googleMap'), { center: myLatLng, zoom: 12, scrollwheel: false }); var marker = new google.maps.Marker({ icon: '/bizdemo36713/img/pol/img/maptip.png', position: myLatLng, animation: google.maps.Animation.BOUNCE, map: map, title: 'Path of Life' }); } } function setHeightJs(a, b, c , d) { a.height(d.height()); b.height(d.height()); c.height(d.height()); } function setHeightChat(a, b, c, d) { a.height(d); b.height(d); c.height(d); } function onYouTubeIframeAPIReady() { } function onPlayerReady(event) { var w = $('#mv01').width(); var h = w/1.77; setPlayerSize(w, h); player.loadVideoById({'videoId': 'saJUhDbeHGQ', 'startSeconds' : 0, 'endSeconds' : 126, 'suggestedQuality' : 'highres'}); } var done = false; function onPlayerStateChange(event) { if(event.data == YT.PlayerState.BUFFERING) { } if(event.data == YT.PlayerState.ENDED) { event.target.seekTo(0, true); } } function stopVideo() { player.stopVideo(); } function pauseVideo() { player.pauseVideo(); } function setPlayerSize(w, h) { player.setSize(w, h); } function gotoThe(a) { var hereiam = $(a).offset().top + $(a).height(); $('html, body').animate({ scrollTop: hereiam }, 900, function(){ }); } function setLoadMain(number) { dh(number, 1) } function setStartMain(number) { dh(number, 0); } function setComMain(number) { dh(number, 1); } function dh(number, f) { switch(number) { case 1: if(f) { $('#topslider .slidesjs-slide:nth-child(1)>#p').addClass('showfirstp').delay(1000).queue(function() { $('#topslider .slidesjs-slide:nth-child(1)>.string').addClass('showfirsts'); $(this).dequeue(); }); } else { $('#topslider .slidesjs-slide:nth-child(1)>#p').removeClass('showfirstp'); $('#topslider .slidesjs-slide:nth-child(1)>.string').removeClass('showfirsts'); } break; case 2: if(f) { $('#topslider .slidesjs-slide:nth-child(2)>#p').addClass('showsecondp').delay(1000).queue(function() { $('#topslider .slidesjs-slide:nth-child(2)>.string').addClass('showseconds'); $(this).dequeue(); }); } else { $('#topslider .slidesjs-slide:nth-child(2)>#p').removeClass('showsecondp'); $('#topslider .slidesjs-slide:nth-child(2)>.string').removeClass('showseconds'); } break; case 3: if(f) { $('#topslider .slidesjs-slide:nth-child(3)>#p').addClass('showthirdp').delay(1000).queue(function() { $('#topslider .slidesjs-slide:nth-child(3)>.string').addClass('showthirds'); $(this).dequeue(); }); } else { $('#topslider .slidesjs-slide:nth-child(3)>#p').removeClass('showthirdp'); $('#topslider .slidesjs-slide:nth-child(3)>.string').removeClass('showthirds'); } break; } }