function gotoHome()
{
document.location.href='/index.php';
}
function changeLanguage(l)
{
if (l=="ko") secDom="www";
else secDom=l;
url="https://"+secDom+".seoulcitybus.com"+window.location.pathname+window.location.search;
document.location.href=url;
}
/*====================================================================================================
서비스
*/
function serviceSeoulCityTourBus()
{
document.location.href='/service/seoulcitytourbus.php';
}
function serviceTourCourse()
{
document.location.href='/service/tour_course_list.php';
}
function serviceTourCourseView(c)
{
if (c=="N")
{
alertLayer("Warning","Being prepared.");
return;
}
document.location.href='/service/tour_course_view.php?code='+c;
}
function serviceBusInfo()
{
document.location.href='/service/bus_info.php';
}
function aboutCitytourBus()
{
document.location.href='/service/about.php';
}
function contactUS()
{
document.location.href='/service/contact_us.php';
}
/*====================================================================================================
서비스
*/
/*====================================================================================================
사이드 아이콘
*/
/*
var hpChat=false;
function chatting()
{
hpChat=true;
//alertLayer("Warning","Being prepared.");
ht.open();
}
$(document).ready(function() {
ht.event.on('happytalk:close', function () {
hpChat=false;
});
$($('#HappytalkIframe').contents().find('#ChatWindow')).on("hide", function(){
console.log("menu off");
});
console.log($('#HappytalkIframe').contents().find('#ChatWindow').attr('id'));
console.log($('#HappytalkIframe').html());
});
*/
function weather()
{
window.open("https://weather.com/ko-KR/weather/today/l/KSXX0037:1:KS");
}
function gotoVisitKorea()
{
window.open("https://korean.visitseoul.net/");
}
function gotoInstagram()
{
//window.open("https://www.instagram.com/seoulcitytourbus.official/");
window.open("https://www.instagram.com/seoultigerbus_official/");
}
function gotoBlog()
{
window.open("https://blog.naver.com/seoultigerbus");
}
/*====================================================================================================
사이드 아이콘
*/
//예약 부분
function reservation(c)
{
if (c==0)
{
document.location.href='/reservation/reservation.php';
}
else if (c=="N")
{
alertLayer("Warning","Being prepared.");
return;
}
else
{
document.location.href='/reservation/reservation.php?code='+c;
}
}
function reservationCheck()
{
document.location.href='/reservation/reservation_check_1.php';
}
function reservationGuide()
{
document.location.href='/reservation/reservation_guide.php';
}
//제휴할인
function allianceList()
{
document.location.href='/alliance/alliance_list.php';
}
//제휴할인 이용안내
function allanceUseInfo()
{
document.location.href='/alliance/alliance_use_info.php';
}
function allianceView(c)
{
}
function allianceRegist(c)
{
document.location.href='/alliance/alliance_regist.php?mode='+c;
}
//고객센터
function customerFAQ()
{
document.location.href='/customer/faq.php';
}
//문의 작성
function customerQNA(c)
{
alertLayer("Warning","Hello!
In order to provide better services, this board is operated for members only.
If you are not a member yet, you can easily sign up and start using it.
If you would like to log in or sign up, please click the button below.");
//memberLogin();
}
//문의 내역
function customerQNA_list()
{
alertLayer("Warning","Hello!
In order to provide better services, this board is operated for members only.
If you are not a member yet, you can easily sign up and start using it.
If you would like to log in or sign up, please click the button below.");
//memberLogin();
}
//공지이벤트
function boardList(t)
{
document.location.href='/board/board_list.php?t='+t;
}
function boardView(t,c)
{
document.location.href='/board/board_view.php?t='+t+'&code='+c;
}
//이용약관
function footerUserTerm()
{
document.location.href='/service/user_term.php';
}
function footerPersonTerm()
{
document.location.href='/service/person_term.php';
}
/*====================================================================================================
모달창 관련
*/
//얼럿 메세지가 회원 전용이라는 메세지가 있을 경우 로그인 창 띄우기
function checkAlertMsg()
{
if ($("#id_alert_msg").html()=="Hello!
In order to provide better services, this board is operated for members only.
If you are not a member yet, you can easily sign up and start using it.
If you would like to log in or sign up, please click the button below.")
{
$("#id_alert_msg").html("");
memberLogin();
}
}
function alertLayer(title,msg)
{
$("#id_alert_title").html(title);
$("#id_alert_msg").html(msg);
common.popOpen("#id_alert_layer");
}
function confirmLayerResult(c)
{
form=document.confirmLayerForm;
g=form.g.value;
obj=form.obj.value;
if (c=="Y")
{
if (g=="CHANNEL_NICKNAME")
{
//네이버로 가입 후 닉네임 입력시 창을 닫을 경우 가입이 안되며 메인 페이지로 이동
document.location.href='/index.php';
}
if (g=="CHANGE_NEW_PWD")
{
document.location.href='/index.php';
}
if (g=="CANCEL_RESERVED")
{
if (cancelPrc)
{
cancelReservationStart();
}
}
if (g=="MEMBER_OUT")
{
outMemberGO();
}
if (g=="REVIEW_DELETE")
{
common.popClose("#id_confirm_layer");
hidFrm.location.href='/service/toure_coure_review_delete.php?code='+obj
}
if (g=="QNA_DELETE")
{
common.popClose("#id_confirm_layer");
hidFrm.location.href='/customer/qna_delete.php?code='+obj
}
}
else
{
if (g=="CHANNEL_NICKNAME")
{
//네이버로 가입 후 닉네임 입력시 창을 닫을 경우 가입을 계속 할 경우
common.popClose("#id_confirm_layer");
}
if (g=="CHANGE_NEW_PWD")
{
common.popClose("#id_confirm_layer");
}
if (g=="CANCEL_RESERVED")
{
common.popClose("#id_confirm_layer");
common.popClose(obj);
}
if (g=="MEMBER_OUT")
{
common.popClose("#id_confirm_layer");
}
if (g=="REVIEW_DELETE")
{
common.popClose("#id_confirm_layer");
}
if (g=="QNA_DELETE")
{
common.popClose("#id_confirm_layer");
}
}
}
function confirmLayer(obj,g)
{
var title="";
var msg="";
//채널 닉네임
if (g=="CHANNEL_NICKNAME")
{
title="Warning";
msg="If you close the window, registration will not be completed. Are you sure you want to cancel your registration?";
}
//비밀번호 변경
if (g=="CHANGE_NEW_PWD")
{
title="Warning";
msg="If you close the window, you cannot change your password again. Are you sure you want to cancel?";
}
//비밀번호 변경
if (g=="CANCEL_RESERVED")
{
title="Warning";
msg="Would you like to cancel your reservation?";
}
//멤버 탈퇴
if (g=="MEMBER_OUT")
{
title="Warning";
msg="If you cancel, recovery is impossible. Would you like to delete your membership?";
}
//리뷰 삭제
if (g=="REVIEW_DELETE")
{
title="Warning";
msg="Are you sure you want to delete the review?";
}
//QNA 삭제
if (g=="QNA_DELETE")
{
title="Warning";
msg="Are you sure you want to delete the review?";
}
form=document.confirmLayerForm;
form.g.value=g;
form.obj.value=obj;
if (title!="" && msg!="")
{
$("#id_confirm_title").html(title);
$("#id_confirm_msg").html(msg);
common.popOpen("#id_confirm_layer");
}
}
function delayLayerResult(c)
{
form=document.delayLayerForm;
g=form.g.value;
obj=form.obj.value;
if (c=="Y")
{
if (g=="CHANGE_MEMBER_INFO")
{
//정보 수정 후 리로드
document.location.reload();
}
if (g=="ADMIN_SET_PWD")
{
//비밀번호 변경 페이지로 이동한다.
document.location.href='/member/mypage.php';
}
if (g=="CHANGE_NEW_PWD")
{
//암호 변경창 닫고 로그인창 연다.
//common.popClose(obj);
//common.popClose("#id_delay_layer");
//memberLogin();
document.location.href='/index.php';
}
if (g=="CANCEL_RESERVED")
{
//정보 수정 후 리로드
//document.location.reload();
document.location.href='/reservation/reservation_check_1.php';
}
if (g=="ALLIANCE_REGIST")
{
//정보 수정 후 리로드
document.location.reload();
}
if (g=="QNA_REGIST")
{
//정보 등록후 qna 리스트 페이지로 이동
customerQNA_list();
}
if (g=="CONTACT_US_REGIST")
{
//정보 등록후 메인 페이지로 이동
document.location.href='/index.php';
}
if (g=="MEMBER_OUT")
{
parent.location.href='/index.php';
}
if (g=="REVIEW_REGIST")
{
parent.location.href='/service/tour_course_review.php?code='+obj;
}
}
}
function delayOkLayer(obj,g)
{
var title="";
var msg="";
if (g=="CHANGE_MEMBER_INFO")
{
title="Confirm";
msg="Information has been corrected.";
}
if (g=="ADMIN_SET_PWD")
{
title="Confirm";
msg="Please register a new password.";
}
if (g=="CHANGE_NEW_PWD")
{
title="Confirm";
msg="A new password has been applied. Please log in again";
}
if (g=="CANCEL_RESERVED")
{
title="Confirm";
msg="Cancellation has been processed.";
}
if (g=="ALLIANCE_REGIST")
{
title="Confirm";
msg="Registered.";
}
if (g=="QNA_REGIST")
{
title="Confirm";
msg="Registered.";
}
if (g=="CONTACT_US_REGIST")
{
title="Confirm";
msg="Registered.";
}
if (g=="MEMBER_OUT")
{
title="Confirm";
msg="Your membership has been deleted.";
}
if (g=="REVIEW_REGIST")
{
title="Confirm";
msg="Registered.";
}
form=document.delayLayerForm;
form.g.value=g;
form.obj.value=obj;
if (title!="" && msg!="")
{
$("#id_delay_title").html(title);
$("#id_delay_msg").html(msg);
common.popOpen("#id_delay_layer");
}
}
/*====================================================================================================
모달창 관련
*/
/*====================================================================================================
회원 관련
*/
var s_email="";
var s_nickname="";
//이메일 중복 검사
function duplicateEmail(g)
{
if (g=="WEB") email=$("#id_reg_email").val();
if (g=="NAVER") email=$("#id_reg_email_name").val();
if (!email || $.trim(email)=="")
{
alertLayer("Warning","Please enter your email address.");
return;
}
$.ajax({
url: "/load_json/load_email.php",
data: {
email : email ,
},
method: "POST",
dataType: "json" // 서버에서 보내줄 데이터의 타입
})
.done(function(json) {
duplicateEmail_result(json);
})
.fail(function(xhr, status, errorThrown) {
alertLayer("Warning","communication error");
})
}
//이메일 중복 결과
function duplicateEmail_result(json)
{
if (json.msg=="exist")
{
alertLayer("Warning","This is a duplicate email. Check it out by signing up.");
}
if (json.msg=="error")
{
alertLayer("Warning","It is not an email format.");
}
if (json.msg=="none")
{
alertLayer("Warning","You can use this email for sign-up.");
s_email=json.email
}
}
//닉네임 중복 검사
function duplicateNickname(g)
{
if (g=="WEB") nickname=$("#id_reg_nick").val();
if (g=="CHANNEL") nickname=$("#id_reg_nick_channel").val();
if (!nickname || $.trim(nickname)=="")
{
alertLayer("Warning","Please enter your nickname.");
return;
}
$.ajax({
url: "/load_json/load_nick.php",
data: {
nickname : nickname ,
},
method: "POST",
dataType: "json" // 서버에서 보내줄 데이터의 타입
})
.done(function(json) {
duplicateNickname_result(json);
})
.fail(function(xhr, status, errorThrown) {
alertLayer("Warning","communication error");
})
}
//닉네임 중복 결과
function duplicateNickname_result(json)
{
if (json.msg=="exist")
{
alertLayer("Warning","This is a duplicate nickname.");
}
if (json.msg=="error_length")
{
alertLayer("Warning","Nicknames can be at least 2 to 15 characters long.");
}
if (json.msg=="error_bad")
{
alertLayer("Warning","Your nickname contains prohibited words.");
}
if (json.msg=="error")
{
alertLayer("Warning","Nicknames can only be in Korean, English, and numbers.");
}
if (json.msg=="none")
{
alertLayer("Warning","This is a nickname that you can sign up for.");
s_nickname=json.nickname;
}
}
//웹 가입
function registMemberCheck()
{
form=document.memberRegistForm;
gEmail=form.email.value;
gNickname=form.nickname.value;
if (!gEmail || $.trim(gEmail)=="")
{
alertLayer("Warning","Please enter your email address.");
form.email.focus();
return;
}
if (!gNickname || $.trim(gNickname)=="")
{
alertLayer("Warning","Please enter your nickname.");
form.nickname.focus();
return;
}
if (!s_email || s_email!=gEmail)
{
alertLayer("Warning","Please check your email for duplicates.");
return;
}
if (!s_nickname || gNickname!=s_nickname)
{
alertLayer("Warning","Please check for duplicate nicknames.");
return;
}
if (!form.pwd.value || $.trim(form.pwd.value)=="")
{
alertLayer("Warning","Please enter a password.");
form.pwd.focus();
return;
}
if (form.pwd.value!=form.pwd_chk.value)
{
alertLayer("Warning","Passwords do not match. Please re-enter");
form.pwd_chk.focus();
return;
}
if (!$("input[name=ad_agree]").is(":checked"))
{
alertLayer("Warning","Please select whether to agree or decline to receive advertising information.");
return;
}
if (!$('#id_agree').is(':checked'))
{
alertLayer("Warning","To sign up, you must agree to the Privacy Policy and Terms of Use.");
form.agree.focus();
return;
}
form.method='post';
form.action='/member/member_web_join.php';
form.target='hidFrm';
form.submit();
}
//로그인 창 보이기
function memberLogin()
{
common.popClose("#id_join_check_result_layer");
form=document.memberLoginForm;
form.email.value="";
form.pwd.value="";
common.popOpen("#id_login_layer");
}
//회원가입 완료후 로그인 진행
function reLogin()
{
common.popClose("#id_member_regist_complete_layer");
memberLogin();
}
//로그인 진행
function memberLoginProcess()
{
form=document.memberLoginForm;
if (!form.email.value || $.trim(form.email.value)=="")
{
alertLayer("Warning","Please enter your email address.");
return;
}
if (!form.pwd.value || $.trim(form.pwd.value)=="")
{
alertLayer("Warning","Please enter a password.");
return;
}
form.method='post';
form.target='hidFrm';
form.action='/member/login.php';
form.submit();
}
//회원 가입창 보이기
function memberRegist()
{
//로그인창은 기본적으로 닫는다.
common.popClose("#id_login_layer");
form=document.memberRegistForm;
form.email.value="";
form.nickname.value="";
form.pwd.value="";
form.pwd_chk.value="";
s_email="";
s_nickname="";
$('input[name="ad_agree"]').each(function() {
$(this).prop('checked',false);
});
$("#id_agree").prop("checked",false);
common.popOpen("#id_member_regist_layer");
}
//가입확인창 보이기
function memberConfirm()
{
//로그인창은 기본적으로 닫는다.
common.popClose("#id_login_layer");
form=document.joinCheckForm;
form.email.value="";
common.popOpen("#id_join_check_layer");
}
//가입확인창 이메일 입력
function memberJoinCheck()
{
form=document.joinCheckForm;
if (!form.email.value || $.trim(form.email.value)=="")
{
alertLayer("Warning","Please enter your email address.");
form.email.focus();
return;
}
form.method='post';
form.target='hidFrm';
form.action='/member/member_check.php';
form.submit();
}
//가입확인창 이메일 결과
function memberJoinCheck_result(msg,id_type)
{
common.popClose("#id_join_check_layer");
$("#id_join_check_result_msg").html(msg);
if (id_type!="WEB")
{
$("#id_join_check_result_pwd_btn").hide();
$("#id_join_check_result_btn").addClass("ac");
}
else
{
$("#id_join_check_result_btn").removeClass("ac");
}
common.popOpen("#id_join_check_result_layer");
}
//비밀번호 찾기 창 보이기
function memberSearchPwd()
{
form=document.searchPwdForm;
form.email.value="";
common.popClose("#id_join_check_result_layer");
common.popClose("#id_login_layer");
common.popOpen("#id_search_pwd_layer");
}
function memberSearchPwd_check()
{
form=document.searchPwdForm;
if (!form.email.value || $.trim(form.email.value)=="")
{
alertLayer("Warning","Please enter your email address.");
form.email.focus();
return;
}
form.method='post';
form.target='hidFrm';
form.action='/member/search_email.php';
form.submit();
}
function changeNewPwd()
{
form=document.changePwdForm;
if (!form.pwd.value || $.trim(form.pwd.value)=="")
{
alertLayer("Warning","Please enter a password.");
form.pwd.focus();
return;
}
if (form.pwd.value!=form.pwd_chk.value)
{
alertLayer("Warning","Passwords do not match. Please re-enter");
form.pwd_chk.focus();
return;
}
form.method='post';
form.target='hidFrm';
form.action='/member/change_email_post.php';
form.submit();
}
function memberMyInfo()
{
document.location.href='/member/mypage.php';
}
//로그아웃
function memberLogout()
{
/*
document.location.href='/member/logout.php';
*/
document.location.href='/member/logout.php';
}
$(document).ready(function() {
$("#id_search_email").on("click",function() {
duplicateEmail("WEB");
});
$("#id_search_nick").on("click",function() {
duplicateNickname("WEB");
});
$("#id_search_nick_channel").on("click",function() {
duplicateNickname("CHANNEL");
});
});
/*====================================================================================================
회원 관련
*/
//심플 가입====================================================================================================
//페이스북======================================================
window.fbAsyncInit = function() {
FB.init({
appId : '683387049951931',
cookie : false,
xfbml : true,
version : 'v15.0',
});
FB.AppEvents.logPageView();
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function facebook_statusChangeCallback(response)
{
return response.status;
}
function logOutFacebook()
{
re=facebook_statusChangeCallback(response);
if (re==="connected")
{
FB.logout(function(response) {
// Person is now logged out
});
}
}
function simpleRegistFacebook()
{
alertLayer("Warning","Being prepared.");
/*
FB.getLoginStatus(function(response) {
re=facebook_statusChangeCallback(response);
if (re==="connected")
{
//이미 FB로그인 상태
//로그인 프로세스로 이동
}
else
{
//FB 로그인 창 오픈
FB.login(function(response) {
FB.api('/me', 'get', {fields: 'name,email'}, function(r) {
console.log(r);
})
}, {scope: 'public_profile,email'});
}
});
*/
}
//페이스북======================================================
function simpleRegistApple()
{
document.location.href='/api/call_apple.php';
}
function simpleRegistGoogle()
{
//alertLayer("Warning","Being prepared.");
document.location.href='/api/call_google.php';
}
/*
function simpleRegistGoogle_TEST()
{
//alertLayer("Warning","Being prepared.");
document.location.href='/api/call_google.php';
}
*/
function simpleRegistKakao()
{
//alertLayer("Warning","Being prepared.");
Kakao.Auth.login({
success: function (response) {
Kakao.API.request({
url: '/v2/user/me',
success: function (response) {
console.log(response);
form=document.kakaoForm;
form.id.value=response.id;
form.email.value=response.kakao_account.email;
form.name.value=response.kakao_account.profile.nickname;
form.method='post';
form.action='/api/callback_kakao.php';
form.submit();
},
fail: function (error) {
console.log(error)
},
})
},
fail: function (error) {
console.log(error)
},
})
}
//카카오로그아웃
function logOutKakao()
{
if (Kakao.Auth.getAccessToken())
{
Kakao.API.request({
url: '/v1/user/unlink',
success: function (response) {
console.log(response);
document.location.href='/member/logout.php';
},
fail: function (error) {
console.log(error)
},
})
Kakao.Auth.setAccessToken(undefined)
}
}
function simpleRegistNaver(url)
{
document.location.href=url;
}
function confirmCheck()
{
confirmLayer("Warning","If you close the window, registration will not be completed. Are you sure you want to cancel your registration?");
}
function registMemberCheck_channel(m)
{
form=document.memberRegistChannelForm;
gEmail=form.email.value;
gNickname=form.nickname.value;
form.channel.value=m;
if (!gEmail || $.trim(gEmail)=="")
{
alertLayer("Warning","Please enter your email address.");
//document.location.href='/index.php';
return;
}
if (!gNickname || $.trim(gNickname)=="")
{
alertLayer("Warning","Please enter your nickname.");
form.nickname.focus();
return;
}
if (!s_nickname || gNickname!=s_nickname)
{
alertLayer("Warning","Please check for duplicate nicknames.");
return;
}
if (!$("input[name=ad_agree_channel]").is(":checked"))
{
alertLayer("Warning","Please select whether to agree or decline to receive advertising information.");
return;
}
/*
if (!$('#id_agree_channel').is(':checked'))
{
alertLayer("Warning","To sign up, you must agree to the Privacy Policy and Terms of Use.");
form.agree.focus();
return;
}
*/
form.method='post';
form.action='/member/member_channel_join.php';
form.target='hidFrm';
form.submit();
}
//심플 가입====================================================================================================
var mobChk=false;
function Mobile()
{
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
if (Mobile())
{// 모바일일 경우
mobChk=true;
}
function pageBack()
{
history.go(-1);
}