var check_double_click = false; var list_loading = 0; var buy_loading = 0; // 구매 var cPage = 1; // 서치 페이지 더보기 페이징 // 메인 이동 function mHomeLocation(args) { if(args == undefined) args = new Object(); if(args.mCate !== undefined ) { mCateClickCount(args.mCate); } if(args.mCate == 'TOPTOON') { delete args.mCate; args.todo = 'm_toptoon'; args.ref = 'mo_menu'; mAlianceLocation(args); return false; } if(args.mCate == 'HIBOOK') { delete args.mCate; args.todo = 'm_hibook'; args.ref = 'mo_menu'; mAlianceLocation(args); return false; } if(args.mCate == 'MUS') { delete args.mCate; args.todo = 'm_music'; mAlianceLocation(args); return false; } if(args.mCate == 'CTV') { delete args.mCate; args.todo = 'm_cantv'; mAlianceLocation(args); return false; } if(args.mCate == 'FTV') { delete args.mCate; args.todo = 'm_fulltv'; mAlianceLocation(args); return false; } if(args.mCate == 'PTV') { delete args.mCate; args.todo = 'm_pandatv'; mAlianceLocation(args); return false; } if(args.mCate == 'ADT' && args.mSubCate == 'FREE') { mEventLocation({"todo":"event_adt1803"}) return false; } if(args.mCate == 'ADT' && args.mSubCate == 'TOPTOY') { window.open('http://toptoy.co.kr/?PID=sharebox'); return false; return false; } if(args.mCate == 'ADT' && args.mSubCate == 'BBMODEL') { delete args.mCate; args.todo = 'm_bbmodel'; mAlianceLocation(args); return false; } if(args.mCate == 'ADT' && args.mSubCate == 'ASMR') { delete args.mCate; args.todo = 'm_hearheart'; mAlianceLocation(args); return false; } if(args.mCate == 'TAZZANG') { if(confirm("3월 31일부로 웹게임 서비스가 종료됩니다.\n환전 된 포인트는 서비스 종료 이후 복구 및 환불되지 않습니다.\n위 내용 확인 후 이용하여 주시기 바랍니다.")){ window.open('/contents/tazzang.php '); return false; }else{ return false; } } location.href= "/index.php" + mJsonToGetUrl(args); } function mHomeLocationLayer(val) { location.href= "/index.php?todo=auth"; } function mHomeLayer(type) { if(type == 'close') { if(sAppType != 'from_app_browser') { // 앱 처리 if(window.SHAREBOX_HANDLER && window.SHAREBOX_HANDLER.go_back) { window.SHAREBOX_HANDLER.go_back(); return; } } location.href= "/index.php"; } } //마이 페이지 이동 function mMypageLocation(args) { if(args == undefined) args = new Object(); location.href= "/mypage/index.php" + mJsonToGetUrl(args); } // 제휴 이동 (음악, 하이북, 탑툭, 캔티비 등등) function mAlianceLocation(args) { if(args == undefined) args = new Object(); location.href= "/contents/aliance.php" + mJsonToGetUrl(args); } // 콘텐츠 페이지 (view) function mContentsPopup(args) { var type = '_blank'; if(args == undefined) args = new Object(); if($.cookie('p_id') == 'movieholic') { } else { // 로그인 체크 if($.cookie('userid') == undefined || $.cookie('userid') == '') { $('html, body').stop().animate({scrollTop : '0'}); alert('로그인 후 이용해 주세요'); mLayerLogin('open'); return false; } // 성인 인증 레이어 if(args.adult != undefined && args.adult != ''){ if($.cookie('flag_adult') != "1" && args.adult == '1') { $('html, body').stop().animate({scrollTop : '0'}); mAdultLayer('open') return false; } delete args.adult; } } // 레이어 옵션 if(args.type == 'self') { type = '_self'; delete args.type; } window.open('/contents/index.php' + mJsonToGetUrl(args) , type); } // 공지사항 이동 function mNoticeLocation(args) { if(args == undefined) args = new Object(); location.href= "/notice/index.php" + mJsonToGetUrl(args); } // 쿠폰등록 이동 function mCouponLocation(args) { if(args == undefined) args = new Object(); location.href= "/coupon/index.php" + mJsonToGetUrl(args); } // 충전소 이동 function mChargeLocation(args) { if(args == undefined) args = new Object(); location.href= "/charge/index.php" + mJsonToGetUrl(args); } // 이벤트 list 이동 function mEventLocation(args) { if(args == undefined) args = new Object(); location.href= "/event/index.php" + mJsonToGetUrl(args); } // 무료충전소 이동 function mFreeChargeLocation(args) { if(args == undefined) args = new Object(); location.href= "/charge/freecharge.php" + mJsonToGetUrl(args); } // 약관 이동 function mCompanyLocation(args) { if(args == undefined) args = new Object(); location.href= "/company/index.php" + mJsonToGetUrl(args); } // 안드로이드 이동 - 바로가기앱 설정페이지 function CallAndroid(sPage, sUserID) { if(sPage == 'setting') { Android.moveSettingActivity(sUserID); } } // SEARCH function mSearchLocation(args) { if(args == undefined) args = new Object(); if(args.sCate == undefined) { args.sCate = ''; } if(args.sCate != 'MVO' && args.sCate != 'DRA' && args.sCate != 'MED' && args.sCate != 'ANI' && args.sCate != 'EBO' && args.sCate != 'ADT') { args.sCate = ''; } var reg = /[\{\}\/?.,;:|\*~`!^\-_+<>@\#$%&\\\=\'\"]/gi //특수문자 검증 if(reg.test(args.sTitle)){ //특수문자가 있다면 back alert('검색어에 특수문자를 사용하실 수 없습니다.'); $('#sTitle').val(''); $('#sTitle').focus(); return false; } /*if(args.sTitle != "" && args.sTitle != undefined && args.sTitle.length == 1) { alert('검색어는 2자이상 입력하셔야 합니다.'); return false; }*/ if(location.host == 'm.sharebox.ne.kr' && args.p_id == 'naverkey') { if (!wcs_add) var wcs_add={}; wcs_add["wa"] = "s_48e941aab5b7"; if (!_nasa) var _nasa={}; wcs.inflow(); wcs_do(_nasa); } location.href= "/search/index.php" + mJsonToGetUrl(args); } // JSON TO GETURL function mJsonToGetUrl(args) { var str = ""; if(args != undefined) { str = "?"; for( var key in args ) { str += key + "=" + args[key] + "&"; } } return str; } // SERCH FORM VALUE ( type : 클릭된 위치) // 검색창 에서 사용, cate sort, except, 더보기 버튼 클릭시 사용 function mSearchValue(type, mode) { var args = new Object(); args.sTitle = ($('#sTitle').val() != undefined) ? $('#sTitle').val() : ''; args.sCate = ($('#sCate').val() != undefined) ? $('#sCate').val() : ''; args.sSort = ($('#sSort').val() != undefined) ? $('#sSort').val() : ''; args.sSeller = ($('#sSeller').val() != undefined) ? $('#sSeller').val() : ''; if( type == 'except'){ args.sCopyrightEx = ($('#sCopyrightEx').prop('checked') == true) ? $('#sCopyrightEx').val() : ''; args.sAdultEx = ($('#sAdultEx').prop('checked') == true) ? $('#sAdultEx').val() : ''; } if(mode == 'return') { // 값 리턴(더보기에서 사용 return args; } else { // 로케이션 mSearchLocation(args); } } // 일반회원가입 - 사용 function mMemberJoin(option) { if(list_loading == 0) { list_loading = 1; if($('#join_userid').val().length < 4) { alert('아이디는 영문 또는 숫자 4자 이상 12자 이하로 입력하세요.'); list_loading = 0; return false; } else if($('#join_userpw1').val().length < 10) { alert('비밀번호는 10자리 이상 설정하셔야 합니다.'); list_loading = 0; return false; } else if($('#join_userpw1').val() != $('#join_userpw2').val()) { alert('입력한 비밀번호가 다릅니다. 다시 확인해주세요.'); list_loading = 0; return false; } var last_char = $('#join_userid').val().substr($('#join_userid').val().length-2, 2); if(last_char.toUpperCase() == "AS"){ alert("아이디의 마지막은 '"+last_char+"' 로 끝날 수 없습니다"); return; } if($("input:checkbox[id='join_sign1']").is(":checked") == true && $("input:checkbox[id='join_sign2']").is(":checked") == true && $("input:checkbox[id='join_sign3']").is(":checked") == true) { var join_sign = 'on'; } else { var msg = "이용약관과 개인정보 수집 및 모든약관에 동의하시겠습니까?"; if(confirm(msg)) { $("input:checkbox[id='join_sign1']").prop('checked', true); $("input:checkbox[id='join_sign2']").prop('checked', true); $("input:checkbox[id='join_sign3']").prop('checked', true); $("input:checkbox[id='join_email_allow']").prop('checked', true); $("input:checkbox[id='join_all']").prop('checked', true); list_loading = 0; return false; } else { list_loading = 0; return false; } } if(check_double_click == false) { check_double_click = true; mJoinNormal(option); } else { alert('현재 처리중이오니 잠시만 기다려 주세요.'); return 0; } } } // 일반회원가입 - 사용 function mJoinNormal(option) { try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/join_ok.php?temp=" + temp, data: { join_userid:$('#join_userid').val(), join_userpw1:$('#join_userpw1').val(), join_userpw2:$('#join_userpw2').val(), join_email1:$('#join_email1').val(), join_email2:$('#join_email2').val(), join_email_allow:$("input:checkbox[id='join_email_allow']").is(":checked"), join_sign1:$("input:checkbox[id='join_sign1']").is(":checked"), join_sign2:$("input:checkbox[id='join_sign2']").is(":checked"), join_sign3:$("input:checkbox[id='join_sign3']").is(":checked"), coupon:$('#giftcard_coupon').val(), option:option, app:'' }, success : function(data) { console.log(data); var service_t = data.split('|'); if(service_t[1] != '' && service_t[1] != undefined) { alert(service_t[1]); } list_loading = 0; check_double_click = false; if(option == "intro2") { if(service_t[0] == "OK") { $('#pop_join').hide(); $('#pop_pay').show(); } else { alert(service_t[0]); } } else if(service_t[0] == "OK_PID") { alert("회원가입이 되신것을 축하드립니다."); } else if(service_t[0] == "COUPON") { alert("회원가입이 되신것을 축하드립니다"); mCouponLocation(); } else if(service_t[0] == "OK_EVENT1") { alert("회원가입이 되신것을 축하드립니다"); mEventLocation({'todo' : 'event_smms'}); } else if(service_t[0] == "OK_EVENT4") { alert("OK캐시백 보너스 지급이 완료 되었습니다!"); mChargeLocation(); } else if(service_t[0] == "OK_EVENT5") { mEventLocation({'todo' : 'event_okdt'}); } else if(service_t[0] == "OK_EVENT10") { alert("회원가입 축하포인트 500B가 지급되었습니다. 지금 바로 무료이용해보세요."); if(service_t[2] == 'charge') { mChargeLocation(); } else if(service_t[2] == 'main') { mHomeLocation(); } else { mChargeLocation(); } } else if(service_t[0] == "OK_EVENT11") { //alert("해당 IP 에서는 다른 아이디로 신규 가입 포인트 지급이 완료되었습니다.웹툰 무료 이용권 2장이 지급되었습니다."); if(service_t[2] == 'charge') { mChargeLocation(); } else if(service_t[2] == 'main') { mHomeLocation(); } else { mChargeLocation(); } } else if(service_t[0] == "OK_EVENT12") { alert("쉐어박스 한가위 이벤트!\n가위바위보 참여권도 놓치지 마세요!"); mEventLocation({'todo' : 'event_chusuk202009'}); } else if(service_t[0] == "OK_EVENT14") { mHomeLocation(); } else if(service_t[0] == "OK_EVENT15") { mHomeLocation({'mCate' : 'FAV'}); } else if(service_t[0] == "ECLOUD") { mHomeLocation(); mAuthLayer('open'); } else if(service_t[0] == "OK_EVENT24") { // 파격정액권 해당 페이지 이동 location.href='/event/index.php?todo=event_flat30_2311&'; return; } else if(service_t[0] == "OK") { alert("정상적으로 회원가입이 완료되었습니다."); window.onbeforeunload = ""; if(option == 'intro') { mChargeLocation(); } else { //mHomeLocation({'mCate' : 'FAV'}); mEventLocation({'todo' : 'event_mail1000'}); } } } }); } catch (e) { list_loading = 0; } } // 모바일 SSL 회원가입 - 사용중 function mJoinSslCallback(res) { var status = res.status; var msg = res.msg; var attend = res.attend; var return_url = res.return_url; var caller = res.caller; var option = res.option; if(msg) alert(msg); if(attend) alert(attend); if(status == 'OK') { if(option == 'intro2') { if(return_url == 'OK') { $('#pop_join').hide(); $('#pop_pay').show(); } } else if(return_url == 'OK_PID') { alert("회원가입이 되신것을 축하드립니다."); } else if(return_url == 'COUPON') { mCouponLocation(); } else if(return_url == 'OK_EVENT1') { mEventLocation({'todo' : 'event_smms'}); } else if(return_url == 'OK_EVENT4') { alert("OK캐시백 보너스 지급이 완료 되었습니다!"); mChargeLocation(); } else if(return_url == 'OK_EVENT5') { mEventLocation({'todo' : 'event_okdt'}); } else if(return_url == "OK_EVENT10") { alert("회원가입 축하포인트 500B가 지급되었습니다. 지금 바로 무료이용해보세요."); mChargeLocation(); } else if(return_url == "OK_EVENT11") { //alert("해당 IP 에서는 다른 아이디로 신규 가입 포인트 지급이 완료되었습니다.웹툰 무료 이용권 2장이 지급되었습니다."); mChargeLocation(); } else if(return_url == "OK_EVENT12") { alert("쉐어박스 한가위 이벤트!\n가위바위보 참여권도 놓치지 마세요!"); mEventLocation({'todo' : 'event_chusuk202009'}); } else if(return_url == "OK_EVENT14") { mHomeLocation(); } else if(return_url == "OK_EVENT15") { mHomeLocation({'mCate' : 'FAV'}); } else if(return_url == "ECLOUD") { mHomeLocationLayer('auth'); } else if(return_url == 'OK') { mEventLocation({'todo' : 'event_mail1000'}); } } } // 패스워드 변경 - 사용 function mMemberPwChange() { if(list_loading == 0) { list_loading = 1; $.ajax({ type: "POST", url: "/mypage/mypage_ok.php", data: { todo:'my_pass_modify', sAgent:'M', userpw:$('#change_userpw1').val(), userpw_change:$('#change_userpw2').val(), userpw_change_re:$('#change_userpw3').val() }, cache : false, dataType :'json', success : function(res) { list_loading = 0; return mPwdChangeSslCallback(res); }, error : function(request,status,error) { mPwdChangeNormal(); } }); } } // 패스워드 변경 - 사용 function mPwdChangeSslCallback(res) { var status = res.status; var msg = res.msg; var return_url = res.return_url; var caller = res.caller; if(msg) { alert(msg); } if(status == 'OK') { mHomeLocation(); } } // 패스워드 변경 - 사용 function mPwdChangeNormal() { try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/password_change.php?temp=" + temp, data: { change_userpw1:$('#change_userpw1').val(), change_userpw2:$('#change_userpw2').val(), change_userpw3:$('#change_userpw3').val() }, success : function(data) { console.log(data); list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else if(data == "OK") { //alert('비밀번호가 변경되었습니다.'); //mMemberLogout(); try { $.ajax({ type: "POST", url: "/util/logout.php", success: function () { list_loading = 0; alert('비밀번호가 변경되었습니다.\n다시 로그인 해주세요.'); mHomeLocation(); } }); } catch (e) { list_loading = 0; } } else { alert(data); } } }); } catch (e) { list_loading = 0; } } // 로그아웃 function mMemberLogout() { if(list_loading == 0) { list_loading = 1; try { $.ajax({ type: "POST", url: "/util/logout.php", success: function () { list_loading = 0; alert('로그아웃 되었습니다.'); mHomeLocation(); } }); } catch (e) { list_loading = 0; } } } //찜하기 function mZzimStateChange(page, idx) { if(list_loading == 0) { list_loading = 1; try { $.ajax({ type: "POST", url: "/search/index.php", data: { todo : 'zzim', idx : idx }, dataType : 'json', success : function(data) { list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else if(data.state == "NOTLOGIN") { alert('로그인 후 이용해 주세요.'); mLayerLogin('open'); } else if(data.state == "RTN01") { alert('해당 컨텐츠의 찜하기가 해제되었습니다.'); if(page == 'mypage') { mMypageLocation({'todo' : 'm_zzim'}); } else if(page == 'contents') { mListZzimIconChange('zzimIcon_'+idx); } else if(page == 'view') { $('#viewZzim').text('찜하기'); $('#viewZzimBtn').removeClass('font_green2'); $('#viewZzimBtn').addClass('font_silver'); $('#viewZzim').removeClass('font_green2'); $('#viewZzim').addClass('font_silver'); } } else if(data.state == "RTN02") { alert('해당 컨텐츠의 찜하기가 완료되었습니다.'); if(page == 'contents') { mListZzimIconChange('zzimIcon_'+idx); } else if(page == 'view') { $('#viewZzim').text('찜해제'); $('#viewZzimBtn').addClass('font_green2'); $('#viewZzimBtn').removeClass('font_silver'); $('#viewZzim').addClass('font_green2'); $('#viewZzim').removeClass('font_silver'); } } } }); } catch (e) { list_loading = 0; } } } // 받은 내역 삭제 function mDownFileDel(idx) { if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/downfile_del.php?temp=" + temp, data: { no:idx }, success : function(data) { list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else if(data == "OK") { alert('해당 내역이 삭제되었습니다.'); mMypageLocation( {"todo" : "m_downfile", "tab" : "contents"} ) } else { alert(data); mMypageLocation( {"todo" : "m_downfile", "tab" : "contents"} ) } } }); } catch (e) { list_loading = 0; } } } // 받은 내역 탑툰 삭제 function mTopToonDel(idx) { if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/toptoonLog_del.php?temp=" + temp, data: { no:idx }, success : function(data) { list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else if(data == "OK") { alert('해당 내역이 삭제되었습니다.'); mMypageLocation( {"todo" : "m_downfile", "tab" : "toptoon"} ) } else { alert(data); mMypageLocation( {"todo" : "m_downfile", "tab" : "toptoon"} ) } } }); } catch (e) { list_loading = 0; } } } // 받은 내역 뮤직 삭제 function mMusicDel(idx) { if(list_loading == 0) { list_loading = 1; try { $.ajax({ type: "POST", url: "/mypage/index.php", data: { todo : 'musicDelete', idx : idx }, dataType : 'json', success : function(data) { list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else if(data.status == 200) { alert('해당 내역이 삭제되었습니다.'); mMypageLocation( {"todo" : "m_downfile", "tab" : "music"} ) } else { alert(data); mMypageLocation( {"todo" : "m_downfile", "tab" : "music"} ) } } }); } catch (e) { list_loading = 0; } } } // // 받은 내역 웹소설 삭제 function mHibookDel(idx) { if(list_loading == 0) { list_loading = 1; try { $.ajax({ type: "POST", url: "/mypage/index.php", data: { todo : 'hibookDelete', idx : idx }, dataType : 'json', success : function(data) { list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else if(data.status == 200) { alert('해당 내역이 삭제되었습니다.'); mMypageLocation( {"todo" : "m_downfile", "tab" : "hibook"} ) } else { alert(data); mMypageLocation( {"todo" : "m_downfile", "tab" : "hibook"} ) } } }); } catch (e) { list_loading = 0; } } } // 자녀 보호 기능 function mMemberShieldChange() { if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); var shieldState = 0; if($('#shieldState').val() == "0" || $('#shieldState').val() == ""){ shieldState = 1; } $.ajax({ type: "POST", url: "/util/shield_change.php", data: { change_userpw:$('#protectuserpw').val(), shield_use : shieldState }, success : function(data) { list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation() } else if(data == "OK") { alert('청소년 자녀 보호 지킴이 옵션이 변경되었습니다.'); window.location.reload(); } else { alert(data); } } }); } catch (e) { list_loading = 0; } } } // 자녀 보호 기능 SNS function mMemberShieldChangeSns() { if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); var shieldState = 0; if($('#shieldState').val() == "0" || $('#shieldState').val() == ""){ shieldState = 1; } $.ajax({ type: "POST", url: "/util/shield_change.php", data: { change_userpw:"SNSLOGINUSER", shield_use : shieldState }, success : function(data) { alert(data); list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation() } else if(data == "OK") { alert('청소년 자녀 보호 지킴이 옵션이 변경되었습니다.'); window.location.reload(); } else { alert(data); } } }); } catch (e) { list_loading = 0; } } } // 약관 호출 function mPoilcyAjax(todo) { if(todo == undefined) history.back(); $.ajax({ type: "POST", url: "/company/index.php", data: { todo : todo, }, dataType : 'html', success : function(data) { $('#poilcy').html(data); } }); } // 문의 내역 삭제 function mOne2oneDel(csno) { if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/one2one_del.php?temp=" + temp, data: { no:csno }, async: true, success : function(data) { list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else if(data == "OK") { alert("1:1 문의가 삭제되었습니다"); mMypageLocation({'todo' : 'm_one2one'}) } else { alert(data); } } }); } catch (e) { } } } // 1:1 문의 등록 function mOne2oneReg() { if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/one2one_reg.php?temp=" + temp, data: { one2one_title:$('#one2one_title').val(), one2one_memo:$('#one2one_memo').val(), phone1:$('#phone1').val(), phone2:$('#phone2').val(), phone3:$('#phone3').val(), return_sms:$("input:checkbox[id='return_sms']").is(":checked") }, async: true, success : function(data) { list_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation() } else if(data == "OK") { alert("1:1 문의가 등록되었습니다"); mMypageLocation({'todo' : 'm_one2one'}); } else { alert(data); } } }); } catch (e) { } } } // 아이디 찾기 function mMemberFindId() { if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/find_id.php?temp=" + temp, data: { find_name:$('#find_name').val(), find_gender:$('#find_gender').val(), find_date1:$('#find_date1').val(), find_date2:$('#find_date2').val(), find_date3:$('#find_date3').val() }, success : function(data) { list_loading = 0; $('#findid_box').html(data); $('#findid_box').show(); } }); } catch (e) { list_loading = 0; } } } // 인증코드 & 패스워드 변경 function mMemberFindPw(step) { if(step == 2){ var regId1 = /^[A-Za-z]*$/; var regId2 = /^[0-9]*$/; var pwd = $('#find_pw_word').val(); if( pwd.length<10 || pwd.length>20 ) { alert('비밀번호는 영문, 숫자 조합 10자 이상 20자 이하로 입력하세요'); return; } if(!regId1.test(pwd) && !regId2.test(pwd) ) { }else{ alert('비밀번호는 영문, 숫자 조합 10자 이상 20자 이하로 입력하세요'); return; } } if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/find_pw.php?temp=" + temp, data: { step:step, find_pw_site:$("#find_pw_site option:selected").val(), find_pw_id:$('#find_pw_id').val(), find_pw_phone1:$('#find_pw_phone1').val(), find_pw_phone2:$('#find_pw_phone2').val(), find_pw_phone3:$('#find_pw_phone3').val(), find_pw_code:$('#find_pw_code').val(), find_pw_word:$('#find_pw_word').val() }, success : function(data) { list_loading = 0; if(data == "OK3") { alert("패스워드 변경이 완료되었습니다."); mHomeLocation(); } else if(data == "OK2") { alert("이미 발송된 문자가 있습니다."); $('#passwd_btn1').hide(); $('#fine_ok').show(); } else if(data == "OK1") { alert("인증문자가 발송 되었습니다."); $('#passwd_btn1').hide(); $('#fine_ok').show(); } else { alert(data); } } }); } catch (e) { list_loading = 0; } } } // 상품권 등록 var giftcard_loading = 0; function mGiftcardReg() { if(giftcard_loading == 0) { giftcard_loading = 1; try { $.ajax({ type: "POST", url: "/util/giftcard_reg.php", data: { number1:$('#number1').val().replace(/-/g, "") }, dataType : "json", success : function(data) { giftcard_loading = 0; if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else { if(data.messageType == 'alert') { alert(data.message); } if(data.code == 'NOAUTH'){ mCouponAuth('open'); } else if(data.code == 'OK'){ mHomeLocation(); } } } }); } catch (e) { giftcard_loading = 0; } } } // 쿠폰 바로인증 인증 function mAuthProc() { if(list_loading == 0) { list_loading = 1; try { var temptime = new Date(); var temp = temptime.getTime(); $.ajax({ type: "POST", url: "/util/auth_proc.php?temp=" + temp, data: { name:$('#auth_username').val(), gender:$('#auth_gender').val(), birth:$('#auth_birth1').val() + $('#auth_birth2').val() + $('#auth_birth3').val(), birth_year:$('#auth_birth1').val(), backurl:$('#auth_backurl').val() }, success : function(data) { if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); } else { list_loading = 0; if(data == "OK") { alert('본인인증이 완료되었습니다.'); mCouponAuth('close'); } else if(data == "OK_EVENT1") { alert('수능이벤트 3일정액권이 지급되었습니다.'); mEventLocation({'todo' : 'event_su181115'}); } else if(data == "OK_EVENT2") { alert('이벤트 대상자가 아닙니다.\n이벤트는 18~22세만 참여가능합니다.'); mEventLocation({'todo' : 'event_su181115'}); } else if(data == "OK_EVENT3") { alert('본인인증으로 이미 참여한 이력이 있습니다\n본 이벤트는 1회만 참여 가능합니다.'); mEventLocation({'todo' : 'event_su181115'}); } else if(data == "OK_EVENT4") { alert('본인인증이 완료되었습니다.'); mCouponAuth('close'); mEventLocation({'todo' : 'event_su2022'}); } else { alert(data); } } } }); } catch (e) { list_loading = 0; } } } // 휴대폰 인증 function mPhoneAuth() { mCouponAuth('close'); window.open('/util/auth.php?auth=phone', 'hp', 'width=445, height=750, resizable=0, scrollbars=no, status=0, titlebar=0, toolbar=0, left=200, top=100'); } // 아이핀 인증 function mIpinAuth() { mCouponAuth('close'); window.open('/util/auth.php?auth=ipin', 'hp', 'width=445, height=550, resizable=0, scrollbars=no, status=0, titlebar=0, toolbar=0, left=200, top=100'); } // 신고하기 function mContentsRequest(idx, singo) { if(!singo){ alert("신고 유형을 선택해주세요"); return; } if(list_loading == 0) { list_loading = 1; $.ajax({ type: "POST", url: "/contents/index.php", data: { todo: 'contentsSingo', idx: idx, singo: singo, content : $('#badWrite').val() }, dataType : 'json', success: function (data) { list_loading = 0; alert(data.msg); if(data.state == 200) { location.reload(); } } }); } } // 불법 촬영물 등 피해신고 function mContentsHelp() { if(!$('#singo_subject').val()){ alert("제목을 입력해주세요"); $('#singo_subject').focus(); return; } if(!$('#singo_idx').val()){ alert("컨텐츠번호를 입력해주세요"); $('#singo_idx').focus(); return; } if(!$('#singo_title').val()){ alert("컨텐츠제목을 입력해주세요"); $('#singo_title').focus(); return; } if(!$('#singo_content').val()){ alert("신고내용을 입력해주세요"); $('#singo_content').focus(); return; } if(list_loading == 0) { list_loading = 1; $.ajax({ type: "POST", url: "/contents/index.php", data: { todo: 'contentsHelp', subject : $('#singo_subject').val(), idx : $('#singo_idx').val(), title : $('#singo_title').val(), phone : $('#singo_phone').val(), content : $('#singo_content').val() }, dataType : 'json', success: function (data) { list_loading = 0; alert(data.msg); if(data.state == 200) { location.reload(); } } }); } } // 충전소 상품 결제 function mChargeProc(cGoods, method) { var arrGoods = ['M207', 'M208', 'M209', 'M210', 'M211', 'M212']; var arrMethod = ['culture', 'book', 'game', 'happy', 'cryptopay']; if(jQuery.inArray(cGoods, arrGoods) > -1) { if(jQuery.inArray(method, arrMethod) > -1) { if(!confirm('<특별이벤트 상품 구매 유의사항>\n\n- 상품권(문화, 해피, 도서, 게임) 결제 시 해당 금액의 VAT(부가세) 10%가 제외 후 적립됩니다.\n- OK캐시백, 카드 포인트, 암호화폐의 경우 적립금 전환 정책에 따라 추가 혜택은 적립되지 않습니다.')) { return false; } } } mChargeLayer('close'); var url = "/util/charge_proc.php?cGoods=" + cGoods + "&method=" + method; var popcheck = window.open(url + "&pop=1", '_blank'); if(popcheck == null) { location = url; } } // 오토페이 결제 function mChargeAutopay(userid, type) { var payflatUrl = "https://np.sharebox.co.kr"; if(type == "phone_auto") { url_set = '/pay/mcash/phone/autopay.php?is_mobile=1&userid='+userid; } else if(type == "phone") { url_set = '/pay/galaxia/autopay.php?type=A&is_mobile=1&userid='+userid; } else if(type == "ars") { url_set = '/main/pay/phonebill_auto/step1_20150318.php?type=A&is_mobile=1&userid='+userid; } else if(type == "card") { url_set = '/main/pay/card_auto/CardBillingAuth_20150318.php?type=A&is_mobile=1&userid='+userid; } else if(type == "card_auto") { url_set = '/pay/mcash/card/autopay_step1.php?is_mobile=1&userid='+userid; } else if(type == "card_auto_3sale") { url_set = '/pay/daou/card/cardAuto.php?is_mobile=1&userid='+userid; } else if(type == "card_auto_30day_sale") { url_set = '/pay/daou/card/cardAuto.php?type=30day&is_mobile=1&userid='+userid; } else if(type == "toptoon_phone_auto") { url_set = '/pay/mcash/toptoon_phone/autopay.php?is_mobile=1&userid='+userid; } else if(type == "toptoon_card_auto") { url_set = '/pay/mcash/toptoon_card/cardAutopay.php?is_mobile=1&userid='+userid; } else if(type == "kakao_auto") { url_set = '/pay/kakao/autopay_step1.php?is_mobile=1&userid='+userid; } url_set = payflatUrl + url_set; var popcheck = window.open(url_set, '_blank'); if(popcheck == null) { location = data; } } // 오토페이 결제2 function mChargeAutopay2(userid, type, cGoods) { var payflatUrl = "https://np.sharebox.co.kr"; if(type == "card_auto_30day") { url_set = '/pay/sbsvc/card/autopay_flat.php?is_mobile=1&userid='+userid+'&cGoods='+cGoods; } else if(type == "phone_auto_30day") { url_set = '/pay/sbsvc/phone/autopay_flat.php?is_mobile=1&userid='+userid+'&cGoods='+cGoods; } else if(type == "kakao_auto_30day") { url_set = '/pay/kakao/flat30_autopay_step1.php?is_mobile=1&userid='+userid+'&cGoods='+cGoods; } else if(type == "card_auto_30day_100") { url_set = '/pay/sbsvc/card/autopay_flat100.php?is_mobile=1&userid='+userid+'&cGoods='+cGoods; } else if(type == "phone_auto_30day_100") { url_set = '/pay/sbsvc/phone/autopay_flat100.php?is_mobile=1&userid='+userid+'&cGoods='+cGoods; } else if(type == "kakao_auto_30day_100") { url_set = '/pay/kakao/flat30_autopay_flat100_step1.php?is_mobile=1&userid='+userid+'&cGoods='+cGoods; } url_set = payflatUrl + url_set; var popcheck = window.open(url_set, '_blank'); if(popcheck == null) { location = data; } } // search 최근 본 컨텐츠 function mLatestViewList() { if(list_loading == 0) { try { $.ajax({ type: "POST", url: "/search/index.php", data: { todo : 'latestViewList', }, dataType : 'json', success : function(list) { list_loading=0; if(list != undefined){ // mContentsForm 에서 append로 넣어 주기 때문에 삭제후 새로 넣어준다. $('#dataLoad').html(''); var html = mContentsForm(list); $('#dataLoad').html(html); } else { $('#latest').append('
최근 본 컨텐츠가 없습니다.
') } }, beforeSend : function() { $('#contents_loading').show(); list_loading = 1; }, complete:function() { $('#contents_loading').hide(); list_loading = 0; }, }); } catch (e) { list_loading = 0; } } } // SEARCH function mContentsSearch() { // 제외 처리 하는 값들까지 가져오기 위헤서 except로 줌 var args = mSearchValue('except', 'return'); if(args.sSeller != '' && args.sSeller != undefined) { $('.sh_ctnlist').hide(); $('.ctn_mini').hide(); } if(list_loading == 0) { list_loading = 1; try { $.ajax({ type: "POST", url: "/search/index.php", data: { todo : 'searchContetsList', sTitle : args.sTitle, sCate : args.sCate, sSort : args.sSort, sCopyrightEx : args.sCopyrightEx, sAdultEx : args.sAdultEx, sSeller : args.sSeller, cPage : cPage }, dataType : 'json', success : function(list) { list_loading=0; var cateTitle = '전체'; switch (args.sCate) { case 'MVO' : cateTitle = '영화'; break; case 'DRA' : cateTitle = '드라마'; break; case 'MED' : cateTitle = '예능'; break; case 'ANI' : cateTitle = '애니'; break; case 'EBO' : cateTitle = '이북'; break; case 'ADT' : cateTitle = '성인'; break; } if(list.noStr == '1') { if(list.noStrCopyRight == '불법촬영물') { $('#searchNoStr').html(mSearchNoStrForm2(args.sTitle)); } else { $('#searchNoStr').html(mSearchNoStrForm(args.sTitle)); } $('#searchNoStr').show(); } if(cPage > 10 && args.sCate == 'ADT') { alert('더이상 검색 결과가 없습니다.'); return false; } if(list.data != undefined){ var html = mContentsForm(list); $('#dataLoad').append(html); if(cPage == 1) { if(args.sSeller == '' || args.sSeller == undefined) { var searchResult = mSearchResultMsg(args.sTitle, list.cateCnt, cateTitle); $('#searchResultMsg').html(searchResult); } else { $('.sh_info').hide(); } } cPage += 1; mHighlightSearchedValue(args.sTitle); } else { if(cPage == 1){ if(list.noStr != '1') { $('#noData').show(); } $('#isData').hide(); $('.sh_info').hide(); } else { alert('더이상 검색 결과가 없습니다.'); } } }, beforeSend : function() { $('#contents_loading').show(); list_loading = 1; }, complete:function() { $('#contents_loading').hide(); list_loading = 0; }, }); } catch (e) { list_loading = 0; } } } // VIEW 회차별 첫회부터 보기 function mRurnView(idx) { var sort = ($('#vRurnChange').prop('checked') == true) ? 'ASC' : 'DESC'; try { $.ajax({ type: "POST", url: "/contents/index.php", data: { todo : 'rurnView', idx : idx, sort : sort }, dataType : 'json', success : function(list) { if(list != undefined) { var html = mRurnViewForm(list); var items = 3; $('#rurnView').trigger('destroy.owl.carousel'); $('#rurnView').html(html); $('#rurn').show(); $('#rurnView').owlCarousel({ // 회차정보 items: items }); if($('#vRurnChange').is(":checked") == false) { var owl = $(".owl-carousel").data('owlCarousel'); owl.to(Math.floor(list.dataView.index/items)); } } } }); } catch (e) { list_loading = 0; } } // 메인 어제 놓친방송 디테일 function mYesterDayPosterDetail(no) { if(list_loading == 0) { list_loading = 1; $('#ydpDetailImg').attr('src', $('#ydpImg' + no).attr('src')); $('#ydpDetailTitle').text($('#ydpTitle' + no).val()); $('#ydpDetailActor').text('출연 : ' + $('#ydpActor' + no).val()); $('#ydpDetailSupervisor').text('감독 : ' + $('#ydpSupervisor' + no).val()); $('#ydpDetailMemo').text('줄거리 : ' + $('#ydpMemo' + no).val()); $('#ydpDetailMidx').val($('#ydpMidx' + no).val()); $('#ydpDetailNo').val($('#ydpNo' + no).val()); if($('#ydpMarkIcon' + no).val() == 'Y') { $('#ydpMarkIcon').attr('class', 'ic_bmk'); } else { $('#ydpMarkIcon').attr('class', ''); } sort = ($('#ydpDetailCheck').prop('checked') == true) ? 'ASC' : 'DESC'; try { $.ajax({ type: "POST", url: "/index.php", data: { todo : 'yesterDayPosterDetail', idx : $('#ydpDetailMidx').val(), sort : sort }, dataType : 'json', success : function(list) { list_loading = 0; if(list != undefined) { var html = mYesterDayPosterForm(list); $('#ydpDetailNextContents').html(html.next); $('#ydpDetailContentsList').html(html.list); mYesterDayEpisodeMoreLayer(); mYesterDayPosterLayer('open', no); } } }); if($('#ydpCate').val() === 'DRA' || $('#ydpCate').val() === 'MED') { searchMainContensList({'title' : $('#ydpTitle' + no).val(), 'cate' : $('#ydpCate').val()}); } } catch (e) { list_loading = 0; } //$('#ydpDetailTitle').text() } } function searchMainContensList(args) { if(args == undefined) args = new Object(); if(args.cate == undefined || args.cate == '') return false; if(args.title == undefined || args.title == '') return false; if(args.click == undefined || args.click == '') args.click=''; if(args.start == undefined || args.start == '') args.start=0; $.ajax({ type: "POST", url: "/search/index.php", data: { todo : 'searchMainContensList', title : args.title, cate : args.cate, start : args.start }, dataType : 'json', success : function(list) { if(list.info != undefined) { list.info.page_start = args.start; var html = mContentsForm(list.info); $('#dataLoad').html(html); $('#mainCatePageing').html(list.page); $('#mRealSortNew').hide(); $('#mRealSortPopularitys').hide(); if(args.click == 'paging') { var offset = $("#mainCateTitle").offset(); $('html, body').animate({scrollTop : offset.top}, 400); } } } }); } // main 실시간 인기자료 function mRealPopularitysList(args) { if(args == undefined) args = new Object(); if(args.category == undefined || args.category == '') args.category='ALL'; if(args.sort == undefined || args.sort == '') args.sort='Popularitys'; if(args.start == undefined || args.start == '') args.start=0; if(args.click == undefined || args.click == '') args.click=''; $('.btn_won_tot li').removeClass('on'); $('#mRealCate li').removeClass('on'); $('#mRealSort'+ args.sort).addClass('on'); $('#mRealCate'+ args.category).addClass('on'); $.ajax({ type: 'POST', url: "/index.php", data: { todo : 'realPopularitysList', category: args.category, sort : args.sort, start : args.start }, dataType: 'json', success: function(list) { if(list.info != undefined){ if(args.sort == 'Popularitys'){ $('#realPopularitysTitle').html('

실시간 인기자료

'); } else if(args.sort == 'New'){ $('#realPopularitysTitle').html('

최신 등록자료

'); } var html = mContentsForm(list.info); $('#dataLoad').html(html); $('#realPageing').html(list.page); if(args.click == 'paging') { var offset = $("#realPopularitysTitle").offset(); $('html, body').animate({scrollTop : offset.top}, 400); } } }, beforeSend : function() { $('#contents_loading').show(); }, complete:function() { $('#contents_loading').hide(); }, }); } // main 무료 할인 자료 function mFreeSaleList(args) { if(args == undefined) args = new Object(); if(args.category == undefined || args.category == '') args.category='ALL'; if(args.start == undefined || args.start == '') args.start=0; $('#mSaleCate li').removeClass('on'); $('#mSaleCate'+ args.category).addClass('on'); $.ajax({ type: 'POST', url: "/index.php", data: { todo : 'freeSaleList', category: args.category, start : args.start }, dataType: 'json', success: function(list) { if(list.info.data != undefined){ var html = mContentsForm(list.info); $('#dataLoad2').html(html); $('#realPageing2').html(list.page); } else { $('#dataLoad2').html('일치하는 자료가 없습니다.'); $('#realPageing2').html(''); } }, beforeSend : function() { $('#contents_loading').show(); list_loading = 1; }, complete:function() { $('#contents_loading').hide(); list_loading = 0; }, }); } // 실기간 급상승 function mRealRankList(category) { var cate = category; if(category == undefined || category == 'ALL') cate=''; $.ajax({ type: 'POST', url: "/index.php", data: { todo : 'realContentsList', category: cate }, dataType: 'json', success: function(list) { var html = ''; if(list.data.length > 0) { var html = mRealRankForm(list); $('.real_cate').removeClass('on'); $('#realCate' + category).addClass('on'); $('#rollRankList').html(html); $('#realRankList').html(html); $('#rollRankList').cycle({ fx: 'scrollUp', speed: 300, timeout: 2000 }); } } }); } // search 인기 컨텐츠 function mPopularitysList() { if(list_loading == 0) { $('#popularity').html(''); try { $.ajax({ type: "POST", url: "/search/index.php", data: { todo : 'popularitysList', }, dataType : 'json', success : function(list) { list_loading=0; if(list != undefined){ var html = mPopularitysForm(list); $('#popularity').html(html); } } }); } catch (e) { list_loading = 0; } } } // 카테고리 클릭수 function mCateClickCount(cate) { var sMode = ''; if(cate == 'onair') sMode = 'quickmenu'; if(cate != undefined && cate != '') { $.ajax({ type: "POST", url: "/contents/cateClick.php", data: { cate: cate, mode: sMode}, async: true, success : function() { } }); } } // 메인 카테고리 컨텐츠 리스트 function mContentsList(args) { if(args == undefined) args = new Object(); if(args.mCate == undefined || args.mCate == '') args.mCate=''; if(args.mSubCate == undefined || args.mSubCate == '') args.mSubCate=''; if(args.sort == undefined || args.sort == '') args.sort=''; if(args.click == undefined || args.click == '') args.click=''; if(args.start == undefined || args.start == '') args.start=0; if(args.sType == undefined || args.sType == '') args.sType=''; $.ajax({ type: 'POST', url: "/index.php", data: { todo : 'mainContentsList', cate: args.mCate, subCate: args.mSubCate, sort: args.sort, sType: args.sType, seller : args.mSeller, start : args.start }, dataType: 'json', success: function(list) { if(list.info != undefined && list.info != '') { list.info.page_start = args.start; var html = mContentsForm(list.info); $('#dataLoad').html(html); $('#mainCatePageing').html(list.page); if(args.click == 'paging') { var offset = $("#mainCateTitle").offset(); $('html, body').animate({scrollTop : offset.top}, 400); } } }, beforeSend : function() { $('#contents_loading').show(); list_loading = 1; }, complete:function() { $('#contents_loading').hide(); list_loading = 0; }, }); } // 댓글 불러오기 function mCommentList(idx) { try { $.ajax({ type: "GET", url: "/contents/list_comment.php?idx=" + idx, async: true, success : function(data) { $('#comment_list').html(data); } }); } catch (e) { } } // 댓글 등록하기 function mCommentReg(idx) { if(list_loading == 0) { if(txtLength($('#comment_write').val()) < 10) { alert("한글 5자이상 입력해주세요.\n\n불성실한 평가나 답변은 포인트가 몰수될 수 있음을 알려드립니다."); } else { if(strCheck2($('#comment_write').val()) == false) { alert("5글자 이상 입력해주세요~\n불성실한 평가나 초성반복 댓글, 욕설, 타인비방등의 댓글 등록시\n포인트 회수와 함께 7일간 댓글이 정지될 수 있습니다."); } else { if(strCheck($('#comment_write').val(), 3)) { if(!confirm("불성실한 댓글등록시 7일간 댓글이 정지됩니다.\n현재 댓글을 등록하시겠습니까?")) { return false; } } list_loading = 1; $.ajax({ type: "POST", url: "/util/comment_reg.php", async: true, data : { idx : idx, comment : $('#comment_write').val(), star_point : $('#star_point').val() }, dataType :'json', success : function(data) { list_loading = 0; if(data.status == "NOTLOGIN") { alert(data.msg); mLayerLogin('open'); } else if(data.status == 200) { alert(data.msg); $('#comment_write').val(''); mCommentList(idx); } else { alert(data.msg); } } }); } } } else { alert("처리중이오니 잠시만 기다려주세요."); return false; } } // 댓글 삭제하기 function mCommentDel(idx, no) { if(!confirm('해당 댓글 내용을 삭제하시겠습니까?')) { return false; } if(list_loading == 0) { list_loading = 1; try { $.ajax({ type: "POST", url: "/util/comment_del.php", async: true, data : { no : no }, dataType :'json', success : function(data) { list_loading = 0; if(data.status == "NOTLOGIN") { alert(data.msg); mLayerLogin('open'); } else if(data.status == 200) { alert(data.msg); mCommentList(idx); } else { alert(data.msg); } } }); } catch (e) { } } } //대댓글 등록 function mComment_reply_action(idx, no) { if($('#comment_reply_'+no).val() == '') { alert('글을 입력해주세요.'); return false; } if(list_loading == 0) { //list_loading = 1; try { $.ajax({ type: "POST", url: "/util/comment_reg.php", async: true, data : { type : 'comment_reply_save', idx : idx, no : no, comment_reply : $('#comment_reply_'+no).val() }, dataType :'json', success : function(data) { list_loading = 0; if(data.status == "NOTLOGIN") { alert(data.msg); mLayerLogin('open'); } else if(data.status == 200) { alert(data.msg); $('#comment_reply_'+idx).val(''); mCommentList(idx); } else { alert(data.msg); } } }); } catch (e) { } } } //대댓글 삭제 function mComment_reply_Delete(idx, no) { if(list_loading == 0) { list_loading = 1; try { $.ajax({ type: "POST", url: "/util/comment_del.php", async: true, data : { type : 'comment_reply_delete', no : no }, dataType :'json', success : function(data) { list_loading = 0; if(data.status == "NOTLOGIN") { alert(data.msg); mLayerLogin('open'); } else if(data.status == 200) { alert(data.msg); mCommentList(idx); } else { alert(data.msg); } } }); } catch (e) { } } } function txtLength(data) { tot_text_len = 0; for(rof = 0; rof < data.length; rof++) { if(data.charCodeAt(rof) > 255) { tot_text_len++; } tot_text_len++; } return tot_text_len; } // 글자 패턴 확인 function strCheck(data, counts) { mem_strings = ''; mem_strings_count = 0; re_message_check = 0; for(rof = 0; rof < data.length; rof++) { if(data.charCodeAt(rof) > 255) { check_String = data.substr(rof, 1); } else { check_String = data.substr(rof, 1); } if(mem_strings == check_String) { mem_strings_count++; } else { mem_strings = check_String; mem_strings_count = 1; } if(mem_strings_count > counts) { re_message_check = 1; break; } } return re_message_check; } // 글자 패턴 확인 function strCheck2(data) { var sCheck = true; for(i = 0; i < data.length; i++) { if(data.charAt(i) < "가" || data.charAt(i) > "힣") { sCheck = false; } else { sCheck = true; return sCheck; } } return sCheck; } var timer; // 타이머 var schInterval; // 인터벌 var chk_search_app = false; // 앱 설치 체크값 function clearTimer() { clearInterval(schInterval); clearTimeout(timer); } function intervalSch() { // 매 인터벌 마다 웹뷰가 활성화 인지 체크 if(document.webkitHidden || document.hidden) {// 웹뷰 비활성화 chk_search_app = true; } } function mButtonLayer(playType, idx) { $('html, body').stop().animate({scrollTop : '0'}); if(playType == 'play') { for(var i=0; i<$('.btn_play_m').length; i++){ var li1 = $($('.btn_play_m')[i]); var li2 = $($('.btn_play_h')[i]); li1.hide(); li2.hide(); } $('#play_m_'+idx).show(); $('#play_h_'+idx).show(); $('#popview_play').attr("class", "popview_dw_layer"); } if(playType == 'down') { for(var i=0; i<$('.btn_dw_m').length; i++){ var li1 = $($('.btn_dw_m')[i]); var li2 = $($('.btn_dw_h')[i]); li1.hide(); li2.hide(); } $('#dw_m_'+idx).show(); $('#dw_h_'+idx).show(); $('#popview_down').attr("class", "popview_dw_layer"); } } function mButtonLayer2(playType, idx) { $('html, body').stop().animate({scrollTop : '0'}); if(playType == 'play') { $('#play_m_'+idx).show(); $('#play_h_'+idx).show(); $('#popview_play_'+idx).attr("class", "popview_dw_layer"); } if(playType == 'down') { $('#dw_m_'+idx).show(); $('#dw_h_'+idx).show(); $('#popview_down_'+idx).attr("class", "popview_dw_layer"); } } // 구매 // idx, contentsId, contentsType 필수 , buyPoint : 구매방법, playType : down, msgType: alert, movieType: ori/HD 띄울 용도로만 사용, adultType: 성인컨텐츠 function mContentsBuy(idx, contentsId, contentsType, buyPoint, playType, msgType, movieType, adultType) { if(buy_loading == 0) { if(playType == 'down') { if(!confirm('무선 네트워크(3G) 접속시 가입하신 요금제에 따라\n별도 과금이 될 수 있습니다. 별도 과금이 되지 않은\nWi-Fi 환경에서의 이용을 권장합니다.')) { return false; } } buy_loading = 1; if($('#playButton').hasClass('btn_playCR') || $('#playButton').hasClass('btn_playCR_adt')) { msgType = ''; } if(msgType == 'alert') { if(buyPoint != undefined) { if(buyPoint == 'fix') { if(!confirm('정액제를 사용하여 구매 하시겠습니까?')) { buy_loading = 0; return false; } } else if(buyPoint == 'coupon') { if(!confirm('쿠폰을 사용하여 구매 하시겠습니까?')) { buy_loading = 0; return false; } } else if(buyPoint == 'bonus') { if(!confirm('보너스를 사용하여 구매 하시겠습니까?')) { buy_loading = 0; return false; } } else if(buyPoint == 'point') { if(!confirm('포인트를 사용하여 구매 하시겠습니까?')) { buy_loading = 0; return false; } } } } $.ajax({ type: "POST", url: "/contents/index.php", data: { todo : 'contentsBuy', idx : idx, buyPoint : buyPoint, playType : playType }, async: true, dataType : "json", success : function(data) { if(data.toString().substring(0, 11) == "LOGIN_ERROR") { alert('다른 기기로 로그인이 되었습니다.\n자동 로그아웃 됩니다.'); mHomeLocation(); return false; } buy_loading = 0; if(data.state == 500) { if(data.msg != undefined && data.msgType != 'confirm') { alert(data.msg); } if (data.code == "LOGIN") { mLayerLogin('open'); } else if (data.code == "LOGIN_PID") { mLayerLogin('open'); } else if (data.code == "CHARGE2") { opener.mChargeLocation(); self.close(); } else if (data.code == "CHARGE") { if (confirm(data.msg)) { opener.mChargeLocation(); self.close(); } } else if (data.code == "ADULTAUTH") { mAdultLayer('open'); } else { location.reload(); } } else if(data.state == 200) { if (data.code == "OK") { /*$('.btn_vL').unbind('click').click(function() { mContentsBuy(idx, contentsId, contentsType, buyPoint, playType, ''); // msgType:alert->'' 얼럿안뜰려고 }).text('다시보기'); $('.btn_vR').unbind('click').click(function() { mContentsBuy(idx, contentsId, contentsType, buyPoint, 'down', ''); // msgType:alert->'' 얼럿안뜰려고 });*/ if(adultType == '1') { $('#playButton').addClass('btn_playCR_adt'); $('#playButton').removeClass('btn_playRE_adt'); } else { $('#playButton').addClass('btn_playCR'); $('#playButton').removeClass('btn_playRE'); } if(contentsType == 'ebook') { $('#fileButton').text('ebook 다시보기'); } else { $('#fileButton').text('다시보기'); } if(contentsType == 'magazine') { $('#fileButton').text('magazine 다시보기'); } else { $('#fileButton').text('다시보기'); } /*if(data.mureka != undefined) { doMurekaJsonPay("SHAREBOX", data.mureka.videoId, data.mureka.copyrDate, data.mureka.memberUserid, data.mureka.bbsUserid, data.mureka.videoPrice, data.mureka.copyrIdx, data.mureka.vcCpUser, data.mureka.murekaHash, data.mureka.vcContentsIDs, data.mureka.mobileIdx, data.mureka.mobileCodeCate, data.mureka.md5Hash, '1'); }*/ } else if (data.code == "REOK") { // 다시보기 } if(contentsType == 'ebook') { mContentsEBook(idx, contentsId); } else if(contentsType == 'ebookNew') { mContentsEBookNew(idx, contentsId); } else if(contentsType == 'magazine') { if(playType=='down') mContentsMovie(idx, contentsId, playType, movieType); else mContentsMagazine(idx, contentsId); } else { mContentsMovie(idx, contentsId, playType, movieType); } } } }); } } // 이북보기 function mContentsEBook(no, ebook) { var temptime = new Date(); var temp = temptime.getTime(); window.open('/contents/ebook.php?temp=' + temp + '&no=' + no + '&ebook=' + ebook, "_self"); //location.reload(); } function mContentsEBookNew(no, ebook) { var temptime = new Date(); var temp = temptime.getTime(); window.open('/contents/ebookNew.php?temp=' + temp + '&no=' + no + '&ebook=' + ebook, "_self"); //location.reload(); } // 매거진보기 function mContentsMagazine(no, magazine) { var temptime = new Date(); var temp = temptime.getTime(); window.open('/contents/magazine.php?temp=' + temp + '&no=' + no + '&magazine=' + magazine, "_self"); //location.reload(); } // 영상보기 function mContentsMovie(no, movie, play_type, movie_type) { var buy_check = 0; $.ajax({ type: "GET", url: "/contents/play.php", async: true, data: {no:no, movie:movie, play_type:play_type, movie_type:movie_type}, success : function(data) { var mureka_data = data.split('|'); // 뮤레카 데이터 전송 /*if(mureka_data[1] == '1' && buy_check == 0) { doMurekaJsonReview("SHAREBOX",mureka_data[2],mureka_data[3],mureka_data[4],mureka_data[5],mureka_data[6],mureka_data[7],mureka_data[8],mureka_data[9],mureka_data[10],mureka_data[11]); }*/ if(data.toString().substring(0, 7) == "http://") { // 앱 처리 if(window.SHAREBOX_HANDLER && window.SHAREBOX_HANDLER.app_play) { // 안드로이드 window.SHAREBOX_HANDLER.app_play(no, movie); return; } else { if($.cookie('store') != '' && $.cookie('store') != undefined) { location.href = mureka_data[0]; } else { var objPopup = window.open(mureka_data[0], 'objPopup', 'width=480, height=275, scrollbars=yes, resizable=yes'); if (objPopup == null || typeof(objPopup) == "undefined") { location.href = mureka_data[0]; } else { location.reload(); } } } } else if(data.toString().substring(0, 4) == "down") { if(movie_type == 'ori') { var sDownType = 'N'; } else { var sDownType = 'H'; } // 앱 처리 if(window.SHAREBOX_HANDLER && window.SHAREBOX_HANDLER.download) { // 앱에서 찜한파일 또는 받은파일을 통해서 들어왔을 경우 var down_data = mureka_data[0].split(';'); var dataJson = new Object(); dataJson.result = 'true'; dataJson.err_code = '0'; dataJson.error_msg = ''; dataJson.data = JSON.parse(down_data[1]); var appData = JSON.stringify(dataJson); window.SHAREBOX_HANDLER.download(appData); return; } else { if(window.SHAREBOX_HANDLER && window.SHAREBOX_HANDLER.is_app) { location.href = "shareboxapp://download?board_idx=" + no + "&file_idx=" + movie + "&user_no=" + $('#nMemIdx').val() + "&down_type=" + sDownType; } else { var sUrlScheme = "shareboxapp://download?board_idx=" + no + "&file_idx=" + movie + "&user_no=" + $('#nMemIdx').val() + "&down_type=" + sDownType; var sUrlEvent = "https://m.sharebox.co.kr/event/index.php?todo=event_app"; location.href = sUrlScheme; schInterval = setInterval(intervalSch, 500); timer = setTimeout(function(){ clearTimer(); if(!chk_search_app) { // 이벤트 페이지로 //location.href = sUrlEvent; } }, 2000); /*if($.cookie('store') != '' && $.cookie('store') != undefined) { opener.location.href = "intent://?idx=" + no + "#Intent;scheme=fileham;package=com.GiftM.google1.ShareBox;end"; } else { location.href = "intent://?idx=" + no + "#Intent;scheme=fileham;package=com.GiftM.google1.ShareBox;end"; }*/ } } } else if(data.toString().substring(0, 4) == "grid") { var gridURL = mureka_data[0]; gridURL = gridURL.replace('grid;', ''); if($.cookie('store') != '' && $.cookie('store') != undefined) { opener.location.href = gridURL; } else { location.href = gridURL; } } else { alert(data); } } }); } // view 판매자 다른자료 function mContentsSeller(args) { if(list_loading == 0) { list_loading = 1; try { if(args == undefined) args = new Object(); if(args.sellerType != 'friend') { if(args.sellerId == undefined || args.sellerId == '') { alert('이용할수 없는 컨텐츠입니다.'); location.href = "/"; return false; } if(args.category == undefined || args.category == '') args.category = 'MVO'; } else { if(args.category == undefined || args.category == '') args.category = 'ALL'; } if(args.start == undefined || args.start == '') args.start = 0; if(args.sellerType == undefined || args.sellerType == '') args.sellerType = 'basic'; $('.v_tab_tb_seller td').removeClass('on'); $('#mSellerCate'+ args.category).addClass('on'); $.ajax({ type: "POST", url: "/contents/index.php", data: { todo : "contentsSellerData", sellerId : args.sellerId, category : args.category, start : args.start, sellerType : args.sellerType }, async: true, dataType : "json", error: function(xhr, error){ list_loading = 0; }, success : function(list) { list_loading = 0; if(list.cate.ALL != undefined) { $('#mSellerCateALL').find('p').html('(' + list.cate.ALL + ')');} if(list.cate.MVO != undefined) { $('#mSellerCateMVO').find('p').html('(' + list.cate.MVO + ')');} if(list.cate.DRA != undefined) { $('#mSellerCateDRA').find('p').html('(' + list.cate.DRA + ')');} if(list.cate.MED != undefined) { $('#mSellerCateMED').find('p').html('(' + list.cate.MED + ')');} if(list.cate.EDU != undefined) { $('#mSellerCateEDU').find('p').html('(' + list.cate.EDU + ')');} if(list.cate.ANI != undefined) { $('#mSellerCateANI').find('p').html('(' + list.cate.ANI + ')');} if(list.cate.EBO != undefined) { $('#mSellerCateEBO').find('p').html('(' + list.cate.EBO + ')');} if(list.cate.ADT != undefined) { $('#mSellerCateADT').find('p').html('(' + list.cate.ADT + ')');} if(list.info.data != undefined) { var html = mViewSellerContentsForm(list.info); $('#sellerDataLoad').html(html); $('#sellerPageing').html(list.page); } else { $('#sellerDataLoad').html('등록된 자료가 없거나 PC에서만 확인 가능한 자료입니다.
게임, 유틸자료는 PC에서 확인해주세요.'); $('#sellerPageing').html(''); } } }); } catch (e) { } } } // 내 친구 자료실 function mContentsFriend(args) { if(list_loading == 0) { list_loading = 1; try { if(args == undefined) args = new Object(); if(args.sellerType != 'friend') { if(args.sellerId == undefined || args.sellerId == '') { alert('이용할수 없는 컨텐츠입니다.'); location.href = "/"; return false; } if(args.category == undefined || args.category == '') args.category = 'MVO'; } else { if(args.category == undefined || args.category == '') args.category = 'ALL'; } if(args.start == undefined || args.start == '') args.start = 0; if(args.sellerType == undefined || args.sellerType == '') args.sellerType = 'basic'; $('.v_tab_tb_seller td').removeClass('on'); $('#mSellerCate'+ args.category).addClass('on'); $.ajax({ type: "POST", url: "/contents/index.php", data: { todo : "contentsSellerData", sellerId : args.sellerId, category : args.category, start : args.start, sellerType : args.sellerType }, async: true, dataType : "json", error: function(xhr, error){ list_loading = 0; }, success : function(list) { list_loading = 0; if(list.cate.ALL != undefined) { $('#mSellerCateALL').find('p').html('(' + list.cate.ALL + ')');} if(list.cate.MVO != undefined) { $('#mSellerCateMVO').find('p').html('(' + list.cate.MVO + ')');} if(list.cate.DRA != undefined) { $('#mSellerCateDRA').find('p').html('(' + list.cate.DRA + ')');} if(list.cate.MED != undefined) { $('#mSellerCateMED').find('p').html('(' + list.cate.MED + ')');} if(list.cate.EDU != undefined) { $('#mSellerCateEDU').find('p').html('(' + list.cate.EDU + ')');} if(list.cate.ANI != undefined) { $('#mSellerCateANI').find('p').html('(' + list.cate.ANI + ')');} if(list.cate.EBO != undefined) { $('#mSellerCateEBO').find('p').html('(' + list.cate.EBO + ')');} if(list.cate.ADT != undefined) { $('#mSellerCateADT').find('p').html('(' + list.cate.ADT + ')');} if(list.info.data != undefined) { var html = mViewFriendContentsForm(list.info); $('#sellerDataLoad').html(html); $('#sellerPageing').html(list.page); } else { $('#sellerDataLoad').html('등록된 자료가 없거나 PC에서만 확인 가능한 자료입니다.
게임, 유틸자료는 PC에서 확인해주세요.'); $('#sellerPageing').html(''); } } }); } catch (e) { } } } // 검색어 function mHighlightSearchedValue(search_value) { if(search_value == '') return; var splitKey = search_value.split(" "); if(splitKey.length > 1) { for(var i=0; i