$(document).ready(function(){var login=$('#login_page');var admin=$('#admin_wrap');var log=$('#log_page');$(window).resize(function(e){windowWidth=window.innerWidth;windowHeight=window.innerHeight;}).resize();var app={common:function(){$(window).resize(function(e){admin.css('min-height',windowHeight-110);}).resize();$(window).load(function(){admin.fadeIn(50);});var picker=$('.datepicker').datepicker({autoclose:!0,language:"ko",format:"yyyy-mm-dd",});$('.prev').html('<span></span>');$('.next').html('<span></span>');var chkin=$('.datepicker_prev');var chkot=$('.datepicker_next');var datepicker_prev=new Object;var datepicker_next=new Object;if(chkin.length!==0){var opt={format:'yyyy-mm-dd',language:'tm',autoclose:!0} datepicker_prev=chkin.datepicker(opt);if($('.datepicker_prev.datepicker_limit').length!==0)opt.startDate=get_today();}if(chkot.length!==0){var opt={format:'yyyy-mm-dd',language:'tm',autoclose:!0,};opt.startDate=chkin.length!==0?calculation_date(chkin.val(),1,'+'):$('[name*="v_sttdate"]').val();datepicker_next=chkot.datepicker(opt);}if(chkin.length!==0&&chkot.length!==0){datepicker_prev.on('changeDate',function(){var click=new convert_date($(this));var click_date=click.getUnix();var out_date=date_unix(datepicker_next.val());if(click_date>=out_date)datepicker_next.datepicker('setDate',click.getOpdt(+0));datepicker_next.datepicker('setStartDate',click.getOpdt(+0));});}$('.close_button').bind("click",function(e){var tg=$(this);tg.closest('.popup').fadeOut('fast');tg.closest('.popup .box').removeClass('pop_show');if($('body .pop_show').length<1){$('body').removeClass('body_none_scroll');}});var memu=$('.menu');memu.find('> li > a').click(function(){var tg=$(this);if(tg.next().length>0){if (tg.next().is(':visible')===false){$('.sub_arrow').removeClass('fa-angle-up').addClass('fa-angle-down');tg.find('.sub_arrow').removeClass('fa-angle-up').addClass('fa-angle-up');memu.find('.sub').slideUp(300);}else if(tg.find('.sub_arrow').hasClass('fa-angle-up')){tg.find('.sub_arrow').removeClass('fa-angle-up').addClass('fa-angle-down');}tg.next().slideToggle(300);}});toastr.options={"progressBar":!0,"timeOut":2000,} $('#updateReplyButton').click(function(){if(!confirm('�뺣쭚 ���ν븯�쒓쿋�듬땲源�?'))return false;$.ajax({type:"POST",url:"/review/ajax_update_review",dataType:"json",data:$('#replyForm').serialize(),success:function(obj){if(obj.stt=="ok"){alert('�뺤긽�곸쑝濡� 泥섎━�먯뒿�덈떎.');window.location.reload();}else{$('.page_loader').hide();alert('response error - 愿�由ъ옄 臾몄쓽 �붾쭩 : updateReplyButton');}},beforeSend:function(){$('.page_loader').show();},error:function(e){console.log(e.responseText);console.log('response error - 愿�由ъ옄 臾몄쓽 �붾쭩 : updateReplyButton');}});});},loginPage:function(){var v_UserId=$('#v_UserId');var v_UserPassword=$('#v_UserPassword');$(window).load(function(){login.fadeIn(function(){v_UserId.focus();});});$('#v_UserId, #v_UserPassword').focusout(function(){var tg=$(this);tg.attr('value',tg.val());if(tg.hasClass('is-invalid')&&tg.val()!=''){tg.removeClass('is-invalid');}});$('.login_btn').unbind('click').click(function(){if(v_UserId.val()=='' ){v_UserId.next('.invalid-feedback').text('�꾩씠�붾� �낅젰�댁<�몄슂.');v_UserId.addClass('is-invalid').focus();return false;}if(v_UserPassword.val()==''){v_UserPassword.next('.invalid-feedback').text('鍮꾨�踰덊샇瑜� �낅젰�댁<�몄슂.');v_UserPassword.addClass('is-invalid').focus();return false;}$('.page_loader').show();$('#myForm').submit();});},logPage:function(){function pop_ipinfo(){var v_VisitIp=$(this).data('visitip');$.ajax({type:"POST",url:BASE+"/log/ajax_get_ipinfo",dataType:"json",data:{'v_VisitIp':v_VisitIp},success:function(obj){if(obj.state=="ok"){popView($('.visit_pop'));var data=obj.data;$('#v_Ip').text(v_VisitIp);$('#v_Country').text('['+data['country']+']'+data['r1']+' '+data['r2']+' '+data['r3']);$('#v_Location').text(data['lat']+', '+data['long']);if(data['country']!='KR'){$('#v_Map').css('background','none').html('<p><a href="https://www.google.com/maps/place/'+data['lat']+','+data['long']+ '" target="_blank" class="google_link" >�댁쇅 �묒냽�먯엯�덈떎. 援ш�濡� 蹂닿린</a></p>');}else{var map=new daum.maps.Map(document.getElementById('v_Map'),{center:new daum.maps.LatLng(data['lat'],data['long']),level:4});var markerPosition=new daum.maps.LatLng(data['lat'],data['long']);var marker=new daum.maps.Marker({position:markerPosition});marker.setMap(map);}}else{alert('response error - 愿�由ъ옄 臾몄쓽 �붾쭩 : pop_ipinfo');}},beforeSend:function(){$('.page_loader').show();},complete:function(){$('.page_loader').hide();},error:function(e){console.log(e.responseText);console.log('response error - 愿�由ъ옄 臾몄쓽 �붾쭩 : pop_ipinfo');}});}$('.check_ip').click(pop_ipinfo);},} if(admin.length>0)app.common();if(login.length>0)app.loginPage();if(log.length>0)app.logPage();});function popView(tg){tg.fadeIn('fast');tg.find('.box').addClass('pop_show');$('body').addClass('body_none_scroll');}function popClose(tg){tg.fadeOut('fast');tg.find('.box').removeClass('pop_show');if($('body .pop_show').length<1){$('body').removeClass('body_none_scroll');}}function confirm_submit(){if(confirm('�뺣쭚 ���ν븯�쒓쿋�듬땲源�?')){on_submit();}}function popReply(ts,v_ReviewNo){$('#v_ReviewNo').val(v_ReviewNo);$('#v_ReplyDescriptions').val($(ts).closest('tr').find('.reply').text());popView($('.reply_pop'));}