(function($){ Array.prototype.in_array = function(v){ for(var i = 0, l = this.length;i < l;i++) if(this[i] === v) return true; return false; } $.getScript( '/js/config/chat.js?rand= + Math.random()', function(){ var confirmHoliday = function(unixTimestamp){ var d = new Date(unixTimestamp * 1000), year = d.getFullYear(), month = d.getMonth() + 1, date = d.getDate(), day = d.getDay(); if( CHAT_DAY_OF_THE_WEEK.in_array(day) || CHAT_SHOP_HOLIDAYS.in_array(year + '-' + month + '-' + date) || CHAT_HOLIDAYS.in_array(month + '-' + date) )return true; return false; }, confirmTime = function(unixTimestamp, start,end){ var d = new Date(unixTimestamp * 1000), hour = d.getHours(); return start <= hour && hour < end?false:true; }, unixTimestamp = parseInt(new Date() / 1000); if( confirmHoliday(unixTimestamp) || confirmTime(unixTimestamp, CHAT_TIME[0], CHAT_TIME[1]) ){ var timer = setInterval(function(){ if($('.swan-chat-container--expanded')[0]){ $('.swan-chat-container--expanded').eq(0).append('\
\ ' + CHAT_MESSAGE['alamode'] + '\
\