var cache = { };
var cnt_request_status = true;
$(document).ready(function() {
cache["loadimg"] = $("
").attr("src", "http://image.eduhouse.net/2009_iae/image/loadinfo_s.gif");
$.extend({
woaiaeXhr: null,
woaiaeAbort: false,
aftLogin: function(p_userData) {
// Login 성공하면 지사별 상담전화 tab에 담당 지사 정보 표시하도록 변경.
$.ajax({
url: '/service/common/svc_ep_summary.asp',
type: 'POST',
data: "",
dataType: 'json',
error: function() {
// 로그인 성공 후 담당 지사를 보여주기 위한 서비스 호출.
// 실패하더라도 전체 사이트 사용에는 별 문제가 없으므로 무시한다.
},
success: function(p_data) {
//alert(p_data.result);
if (p_data.epInfoTxt)
{
$("#br_phone_list").remove();
$("#br_zone2 div.tab_btm").remove();
var arrEpInfo = unescape(p_data.epInfoTxt).split("[split]");
$("#br_zone2").append(
"
" +
"
" + p_userData.user_name + " 회원님의 담당지사는
[" + arrEpInfo[2] + "] 입니다.
" +
"
" + arrEpInfo[2] + " 연락처는," +
"
전화 : " + arrEpInfo[3] + ", 담당 EP 전화 : " + arrEpInfo[9] + " 입니다.
" +
"
찾아오시는 길 : " + arrEpInfo[8] + " 입니다.
" +
"

" +
"
" +
"");
}
}
});
return ;
}
});
// 메인배너 이벤트 핸들러 설정
$("#mainBanner > li.off").live("mouseover", function() {
$("#mainBanner > li.on").removeClass("on").addClass("off");
$(this).removeClass("off").addClass("on");
var idx = parseInt($(this).attr("value"), 10) - 1;
$("#main_big_bnr_list > li:first").css("margin-top", idx * 288 * -1);
});
// 메인배너 영역에 페이징 필요없으면(4개 이하) 페이징 부분 hidden 처리
if (4 >= $("#mainBanner > li").length)
{
$("div.main_bnr_zone div.tab_btm").remove();
}
else
{
var bnrPageCnt = Math.floor(($("#mainBanner > li").length - 1) / 4) + 1;
$("#main_bnr_page").text("1/" + String(bnrPageCnt));
}
$("div.main_bnr_zone div.page_btn .prev_lnk").click(function() {
var arrPaging = $("#main_bnr_page").text().split("/");
if (2 == arrPaging.length)
{
var currPage = parseInt(arrPaging[0], 10);
if (1 < currPage)
{
currPage--;
var dx = (currPage - 1) * $("div.main_bnr_zone").width() * -1;
$("#mainBanner").animate({"margin-left": dx},
1000,
function() {
$("#mainBanner > li:eq(" + ((currPage - 1) * 4) + ")").trigger("mouseover");
});
$("#main_bnr_page").text(String(currPage) + "/" + arrPaging[1]);
}
}
});
$("div.main_bnr_zone div.page_btn .next_lnk").click(function() {
var arrPaging = $("#main_bnr_page").text().split("/");
if (2 == arrPaging.length)
{
var currPage = parseInt(arrPaging[0], 10);
var totPage = parseInt(arrPaging[1], 10);
if (currPage < totPage)
{
currPage++;
var dx = (currPage - 1) * $("div.main_bnr_zone").width() * -1;
$("#mainBanner").animate({marginLeft: dx},
1000,
function() {
$("#mainBanner > li:eq(" + ((currPage - 1) * 4) + ")").trigger("mouseover");
});
$("#main_bnr_page").text(String(currPage) + "/" + arrPaging[1]);
}
}
});
// 뉴스Tab 이벤트 핸들러 설정
$("#news ul.tab_list > li").click(function() {
//trace("aa");
tab_change("tab_list", "news_zone", this);
});
// 국가별 학교뉴스 read
$("#news_tab_btm > li > a").click(function() {
read_news_list("2", this.title);
return false;
});
// 국가별 통신원 read
$("#rpt_tab_btm_l > li > a").click(function() {
read_reporter_list(this.title);
return false;
});
// 지사Tab 이벤트 핸들러 설정
$("#branch ul.tab_list > li").click(function() {
//trace("aa");
if (this.value == "1" || this.value == "2")
{
if (this.value == "2")
$("#branch ul.tab_list > li.more").hide();
else
$("#branch ul.tab_list > li.more").show();
tab_change("tab_list", "br_zone", this);
}
else
;
});
// 지사 이벤트 페이지 이동
$("#br_evt_page_btn > a").click(function() {
var brPagingText = $("#br_banner_page").text();
var arrBrPaging = brPagingText.split("/");
// paging 정보는 "현재페이지/총페이지" 형태. 따라서 length가 2와 같아야 올바른 형태이다
if (2 == arrBrPaging.length)
{
var nwPageNo = parseInt(arrBrPaging[0], 10);
if (this.id == "br_next")
{
if (nwPageNo < parseInt(arrBrPaging[1],10))
{
nwPageNo++;
}
else
{
alert("마지막 페이지입니다.");
return false;
}
}
else
{
if (nwPageNo > 1)
{
nwPageNo--;
}
else
{
alert("첫 페이지입니다.");
return false;
}
}
read_br_event("4", nwPageNo, 3);
}
return false;
});
// 지사별 상담전화 설정
$("#br_phone_list > ul.area > li.off").live("click", function() {
$("#br_phone_list > ul.area > li.on").removeClass("on").addClass("off");
$(this).removeClass("off").addClass("on");
read_area_br_list(this.value);
});
// 지사별 상담전화: 지사명 클릭 시 지사 Popup open
$("#br_zone2 a[rel='internal_br_lnk']").live("click", function() {
open_jisa_popup(this.href.replace(/^.*#/, ""));
return false;
});
// What's on at iae
$("#whatson_img_list > li.off").live("mouseover", function() {
$("#whatson_img_list > li.on").removeClass("on").addClass("off");
$(this).removeClass("off").addClass("on");
// // 이전 ajax 호출에 대한 응답이 완료되기 전이면 호출을 중단시킨다.
// if ($.woaiaeXhr != null && $.woaiaeXhr.readyState != 4)
// {
// $.woaiaeAbort = true;
// $.woaiaeXhr.abort();
// }
read_whtsonatiae_summary(this.value);
});
// 과정찾기 레이어 open/close
$("#search_c > div.thisform > p").click(function() {
if ($("#p_school").hasClass("hidden"))
{
var pos = dvf_getPosition(this);
$("#p_school").removeClass("hidden").css("left", pos.x).css("top", pos.y + this.offsetHeight + 2);
}
else
{
$("#p_school").addClass("hidden");
}
});
$("#p_school span.close").click(function() {
document.frm_search_sch_opt.reset();
$("#cnt_sch_search").empty().hide();
if (!$("#p_school").hasClass("hidden"))
$("#p_school").addClass("hidden");
});
//$("#p_school > div.que > ul.select > li > input:radio").click(function() {
// $("#p_school > div.que > ul.select > li > select[name='sel_country']").attr("disabled", ("Y" != this.value));
//});
$("#p_school > div.que :input").change(function() {
var frm = document.frm_search_sch_opt;
if ("sel_country_yn" == this.name)
{
if ("Y" == this.value)
{
frm.sel_country.disabled = false;
}
else
{
frm.sel_country.disabled = true;
frm.sel_country.value = "";
}
}
if ("sel_country_yn" == this.name || "sel_country" == this.name || "sel_openCourse" == this.name)
{
if ("" != frm.sel_country.value || 0 < $(frm.sel_openCourse).filter(":checked").length)
{
if (cnt_request_status)
{
cnt_request_status = false;
var countryVal = "";
if ("" != frm.sel_country.value)
{
var countryVal = frm.sel_country.value.split("|")[0];
}
var param = "sel_course="+ frm.sel_course.value +
"&country_code="+ countryVal +
"&sel_openCourse=" + $(frm.sel_openCourse).filter(":checked").val();
var load_page = "/service/study_info/svc_sch_search_cnt.asp?"+param;
$("#cnt_sch_search").show().load(load_page, function() {
cnt_request_status = true;
});
}
}
else
{
$("#cnt_sch_search").html("");
$("#cnt_sch_search").hide();
}
}
});
$("#p_school #btn_search_sch").click(view_search_list);
// 학교명 검색 - Suggest script 연결
$("#txt_search_sch_name")
.focus(function() {
if(this.value == this.defaultValue)
{
this.value='';
}
})
.autocomplete("/service/study_info/svc_sch_suggest_list.asp",
{ minChars:2,
matchSubset:1,
matchContains:1,
matchCase:0,
cacheLength:3,
onItemSelect:
function(p_li) {
open_push_sch_view_popup(p_li.extra[0]);
},
selectOnly:1,
delay:200,
fillCurrItem:true });
$("#frm_search_schnm").submit(function() {
var keywd = $("#txt_search_sch_name");
if ( 3 > keywd.val().length || $.trim(keywd.val()) == keywd.attr("defaultValue") )
{
alert("학교 이름 중 처음 3글자 이상 입력하신 후 검색을 이용하십시오.");
return false;
}
});
// iae Editors' Picks 목록 중 첫번째 dl에 first-child class 설정
// IE6에서는 :first-child 선택자를 인식하지 못하므로 jquery로 처리
if (0 < $("#editor_cont dl:first").length)
{
$("#editor_cont dl:first").addClass("first_child");
}
// 설문조사 이벤트 핸들러 설정
$("#btn_vote").click(function() {
open_voteWin($("#hdn_poll_id").val(), this);
});
$("#btn_poll_result").click(function() {
open_pollResultWin($("#hdn_poll_id").val(), this);
});
$("#p_pollResult span.close, #btn_close_poll").click(function() {
$("#p_pollResult").hide();
});
// 1:1 채팅상담 open
$("#bnr_quick > ul > li.chat > a").click(function() {
dvf_webcall('/service/login/svc_login_user.asp', open_webcall_win);
});
// 학교 동영상 Layer player
$("#media a[rel='sch_player_lnk']").click(function() {
var pos = dvf_getPosition(this);
$("body").append(
$("")
.attr("id", "p_video")
.load(
this.href,
function() {
$("#p_video span.close").live("click", function() {
$("#p_video").remove();
});
$("#p_video div.btn a").live("click",function() {
if ("counsel_lnk" == this.rel)
{
dvf_viewPopCounsel(this.href.replace(/^.*#/, ""));
return false;
}
else if ("dm_req_lnk" == this.rel)
{
dvf_viewPopUserReq(this.href.replace(/^.*#/, ""));
return false;
}
return true;
});
//alert("file_key=" + $("#p_video #movie_url").val());
var flashvars = {
// file_key: $("#p_video #file_key").val(),
allowmaximize: "YES",
full_state: "NO"
};
var params = {
wmode: "opaque",
menu: "false",
scale: "noScale",
allowFullscreen: "true",
allowScriptAccess: "always",
bgcolor: "#FFFFFF"
};
var attributes = {
id:"sch_movie"
};
swfobject.embedSWF($("#p_video #movie_url").val(), "sch_movie", "100%", "100%", "9.0.0", "/swf/expressInstall.swf", flashvars, params, attributes);
})
.css("right", $("body").width() - pos.x + 2)
.css("top", pos.y)
);
return false;
});
// SMS 이벤트 핸들러 설정
$("#sms_msg").focusin(function() {
// focus event는 live 함수로 지정이 안됨. 원인은 모르겠음. ㅡㅡ;
// focus() 함수로도 지정이 안되서 bind 함수로..;;
checkFirst(this);
}).keydown(function(p_evt) {
if ( !textCounter(this, 'inp_msg_len', 80) )
{
alert("최대 입력 가능 문자 수(영문기준:80)를 초과하였습니다.");
p_evt.preventDefault();
while (dvf_byteLength(this.value) > 80)
this.value = this.value.substr(0, (this.value.length - 1));
}
}).keyup(function(p_evt) {
if ( !textCounter(this, 'inp_msg_len', 80) )
{
alert("최대 입력 가능 문자 수(영문기준:80)를 초과하였습니다.");
p_evt.preventDefault()
while (dvf_byteLength(this.value) > 80)
this.value = this.value.substr(0, (this.value.length - 1));
}
});
$("#btn_sms_init").click(reset_sms_form);
$("#btn_sms_send").click(send_sms);
// 환율정보 읽어오기
read_exchange_data(function(p_exchangeData) {
if (p_exchangeData.exchange_list.length > 0)
{
var frSelect = $("#rate select[name='exchange_fr_nat']");
var toSelect = $("#rate select[name='exchange_to_nat']");
var frIdx = -1;
var toIdx = -1;
for (var idx = 0; idx < p_exchangeData.exchange_list.length; idx++)
{
var datarec = p_exchangeData.exchange_list[idx];
var opt = "";
frSelect.append(opt);
toSelect.append(opt);
if ("krw" == datarec.curr_name)
{
frIdx = idx;
}
if ("usd" == datarec.curr_name)
{
toIdx = idx;
}
}
frSelect[0].selectedIndex = frIdx;
toSelect[0].selectedIndex = toIdx;
$("#btn_exch_cal").click(function() {
var from = frSelect.val();
var to = toSelect.val();
var amount = $("#ex_amount").val();
amount = amount.replace(/ |,|\t/g,'');
if(isNaN(amount) || amount == '') {
alert("숫자를 입력하세요.");
$("#ex_amount").val('');
$("#ex_amount").focus();
return false;
} else {
//alert(from +"|"+ to);
var result = ((amount * from) / to).toFixed(2);
$("#ex_result").text("= " + dvf_commify(result));
}
});
}
});
if ("" != document.frm_init.runfunc.value)
{
switch(document.frm_init.runfunc.value)
{
case "1":
//상담예약 팝업
F_popReservTop();
break;
case "2":
//웹콜 팝업
dvf_webcall('/service/login/svc_login_user.asp', open_webcall_win);
break;
}
}
});
function chk_paramOptionVal(){
var frm = document.seaach_sch_opt_frm;
var ret_param = "";
ret_param = 'sel_course='+ frm.sel_course.value +'&country_code='+ frm.country_code.value +'&state_code='+ frm.state_code.value +'&city_code='+ frm.city_code.value +'&sel_openCourse=' + frm.sel_openCourse.value + '&sel_operationTyp='+ frm.sel_operationTyp.value +'&sel_schoolTyp=' + frm.sel_schoolTyp.value + '&sel_rateKorean='+frm.sel_rateKorean.value +'&sel_residenceTyp='+frm.sel_residenceTyp.value;
if (frm.txt_search_sch_name.value != "학교 이름으로 찾기 ")
{
ret_param = ret_param + '&txt_search_sch_name=' + encodeURI(frm.txt_search_sch_name.value);
}
return ret_param;
}
// 뉴스 탭 핸들링
function tab_change(p_parentClass, p_preTabID, p_this)
{
// 이미 선택된 tab이면 바로 return
if ($(p_this).hasClass("on"))
return;
var currOn = $(p_this).parents("ul."+p_parentClass).find("li.on");
currOn.removeClass("on");
var idx = currOn.attr("value");
$("#" + p_preTabID + idx).addClass("hidden");
$(p_this).addClass("on");
idx = $(p_this).attr("value");
$("#" + p_preTabID + idx).removeClass("hidden");
}
// 뉴스 읽어오기
function read_news_list(p_ntype, p_natCd)
{
var param = {ntype: p_ntype,
natCd: p_natCd,
page_no: "1",
page_size:"8"};
$.ajax({
url: "/service/news/svc_news_list.asp",
type: 'POST',
data: param,
dataType: 'json',
async: true,
//timeout: 3000,
error: function(p_req, p_status, p_err) {
//alert('ERR1');
alert("학교뉴스를 읽는 중 오류가 발생하였습니다. 잠시 후 이용바랍니다.");
},
success: function(p_data) {
var newsList = $("#nsn_news_list");
newsList.empty();
if (p_data.newsCnt <= 0)
{
newsList.append("등록된 뉴스가 없습니다.");
}
else
{
for (var idx = 0; idx < p_data.newsList.length; idx++)
{
newsList.append("[" + p_data.newsList[idx].nat_name + "]" + dvf_html2entity(dvf_ellipsisStr(unescape(p_data.newsList[idx].title),45)) + "");
}
}
}
});
}
// 국가별 통신원 소식 읽어오기
function read_reporter_list(p_natCd)
{
var param = {natCd: p_natCd,
summary_len: 70,
page_no: 1,
page_size:5};
$.ajax({
url: "/service/reporter/svc_article_list.asp",
type: 'POST',
data: param,
dataType: 'json',
async: true,
//timeout: 3000,
error: function(p_req, p_status, p_err) {
//alert('ERR1');
alert("통신원 소식을 읽는 중 오류가 발생하였습니다. 잠시 후 이용바랍니다.");
},
success: function(p_data) {
var reporterList = $("#reporter_list");
reporterList.empty();
if (p_data.newsCnt <= 0)
{
reporterList.append("등록된 글이 없습니다.");
}
else
{
for (var idx = 0; idx < p_data.dataList.length; idx++)
{
var datarec = p_data.dataList[idx];
var dtlPageUrl = "/reporter/reporter_article_view.asp?" +
"?mth=all&natCd=" + datarec.nation_code + "&pageNo=1&repArtCd=" + datarec.report_article_code +
"&seq=" + datarec.seq;
reporterList.append(
"");
}
}
}
});
}
// 지사 이벤트 읽어오기
function read_br_event(p_zoneID, p_pageNo, p_pageSize)
{
var param = {zone_id: p_zoneID,
page_no: p_pageNo,
page_size: p_pageSize};
$.ajax({
url: "/service/common/svc_banner_event_read.asp",
type: 'POST',
data: param,
dataType: 'json',
async: true,
//timeout: 3000,
error: function(p_req, p_status, p_err) {
//alert('ERR1');
alert("지사 이벤트를 읽는 중 오류가 발생하였습니다. 잠시 후 이용바랍니다.");
},
success: function(p_data) {
var brEventList = $("#br_zone1 > div.branch_cont1");
brEventList.empty();
if (p_data.bannerCnt <= 0)
{
brEventList.append("등록된 글이 없습니다.
");
}
else
{
for (var idx = 0; idx < p_data.bannerList.length; idx++)
{
var datarec = p_data.bannerList[idx];
var lnkUrl = "";
if (datarec.typeID == "2")
{
if (datarec.isHtml == "Y")
{
lnkUrl = unescape(datarec.contents);
}
else
{
lnkUrl = "javascript:click_winBanner('"+ datarec.ZoneID +"', '" + datarec.bannerID + "', '" + datarec.redirURL + "');";
}
}
else
{
if (datarec.isHtml == "Y")
{
lnkUrl = "/event/iae_br_event_view.asp?zone_id="+ datarec.ZoneID +"&banner_id=" + datarec.bannerID;
}
else
{
if(datarec.redirURL != "" )
lnkUrl = "javascript:click_innerBanner('"+ datarec.ZoneID +"', '" + datarec.bannerID + "', '" + datarec.redirURL + "');\"";
else
lnkUrl = "";
}
}
brEventList.append(
"" +
"- " + dvf_ellipsisStr(unescape(datarec.title),30) + "
" +
"
" +
"- 이벤트기간 : " + datarec.frDate + " - " + datarec.toDate + "
" +
"- 이벤트 신청 및 자세히 보기
" +
"
");
}
var brPaging = $("#br_banner_page");
var arrBrPaging = brPaging.text().split("/");
brPaging.text(p_pageNo + "/" + arrBrPaging[1]);
}
}
});
}
// 지사 전화번호 목록 조회
function read_area_br_list(p_area_idx)
{
var param = {area_idx: p_area_idx};
$.ajax({
url: "/service/common/svc_area_br_read.asp",
type: 'POST',
data: param,
dataType: 'json',
async: true,
//timeout: 3000,
error: function(p_req, p_status, p_err) {
//alert('ERR1');
alert("지사 목록 조회 중 오류가 발생하였습니다. 잠시 후 이용바랍니다.");
},
success: function(p_data) {
var brPhoneList = $("#br_phone_list > ul.br_phone");
brPhoneList.empty();
if (p_data.br_cnt <= 0)
{
brPhoneList.append("해당지역에는 아직 지사가 개설되지 않았습니다.
");
}
else
{
for (var idx = 0; idx < p_data.br_list.length; idx++)
{
var datarec = p_data.br_list[idx];
var phoneNum = "";
if (datarec.tel_no != "")
{
phoneNum = datarec.tel_no + (datarec.hot_line != "" ? (" / " + datarec.hot_line) : "");
}
else
{
phoneNum = datarec.hot_line;
}
brPhoneList.append("" + unescape(datarec.group_name) + "|" + phoneNum + "");
}
}
}
});
}
// What's on at iae
function read_whtsonatiae_summary(p_evtCode)
{
var param = {event_code: p_evtCode};
$.woaiaeXhr = $.ajax({
url: "/service/news/svc_whtsonatiae_summary.asp",
type: 'POST',
data: param,
dataType: 'json',
async: true,
//timeout: 3000,
error: function(p_req, p_status, p_err) {
//alert('ERR1');
$.woaiaeXhr = null;
if ($.woaiaeAbort)
{
$.woaiaeAbort = false;
//trace("err:" + p_err + ",status:" + p_status + ",readyState:" + p_req.readyState);
}
else
{
alert("What's on at iae 정보 조회 중 오류가 발생하였습니다. 잠시 후 이용바랍니다.");
}
},
success: function(p_data) {
$.woaiaeXhr = null;
if (p_data.evt_code != "")
{
$("#whatson_img_title").empty()
.append("" +
dvf_ellipsisStr(unescape(p_data.evt_title),45) + "")
.append("" + p_data.evt_regdate + "");
$("#whatson_img_summary").empty()
.append(dvf_ellipsisStr(unescape(p_data.evt_summary),125))
.append("자세히 보기");
}
}
});
}
// SMS 이벤트 핸들러
function checkFirst(txtField)
{
if (txtField.defaultValue == txtField.value)
{
txtField.style.color = "#000000";
txtField.value = "";
}
}
function Length(txtField)
{
return (txtField.value.length + (escape(txtField.value)+"%u").match(/%u/g).length-1);
}
function textCounter(txtField, cntFieldNm, maxLen)
{
if (Length(txtField) > maxLen)
{
return false;
//txtField.value = txtField.value.substr(0, (txtField.value.length - 1));
}
else
{
$("#" + cntFieldNm).html(String(Length(txtField)) + "byte");
return true;
}
}
function reset_sms_form()
{
$("#sms_msg").val($("#sms_msg").attr("defaultValue")).css("color", "#044f95");
$("#rcv_telno").val("");
$("#sender_telno").val("");
$("#inp_msg_len").html("0byte");
}
function send_sms()
{
var rcvTelno = $("#rcv_telno");
if ($.trim(rcvTelno.val()) == "")
{
alert("받는사람의 전화번호를 기입해주세요!");
rcvTelno.focus();
return;
}
if (!isMobilePhoneNum(rcvTelno.val()))
{
alert("전화번호를 잘못입력하셨습니다. 확인 후 이용바랍니다.");
rcvTelno.focus();
return;
}
var senderTelno = $("#sender_telno");
if ($.trim(senderTelno.val()) == "")
{
alert("보내는사람의 전화번호를 기입해주세요!");
senderTelno.focus();
return;
}
if (!isMobilePhoneNum(senderTelno.val()))
{
alert("전화번호를 잘못입력하셨습니다. 확인 후 이용바랍니다.");
senderTelno.focus();
return;
}
var smsMsg = $("#sms_msg");
if (smsMsg.attr("defaultValue") == smsMsg.val() || $.trim(smsMsg.val()) == "")
{
alert("메세지 내용을 기입해주세요!");
smsMsg.focus();
return;
}
//var param = "rcv_telno=" + rcvTelno.val() +
// "&sender_telno=" + senderTelno.val() +
// "&sms_msg=" + encodeURIComponent(smsMsg.val());
var param = {rcv_telno: rcvTelno.val(),
sender_telno: senderTelno.val(),
sms_msg: escape(smsMsg.val())};
$.ajax({
url: "/service/common/svc_send_sms.asp",
type: 'POST',
data: param,
dataType: 'json',
async: true,
//timeout: 3000,
error: function(p_req, p_status, p_err) {
//alert('ERR1');
alert("SMS 발송 요청 중 오류가 발생하였습니다. 잠시 후 이용바랍니다.");
},
success: function(p_data) {
if (!p_data.no_login)
{
if (p_data.is_succ)
{
alert("발송 되었습니다.");
reset_sms_form();
if (p_data.last_cbmoney)
{
//$("#sms_usable_cnt").html(dvf_maskNumber(Math.floor(p_data.last_cbmoney/100)));
//$("#remain_cbmoney").html(dvf_maskNumber(p_data.last_cbmoney));
}
}
else
{
switch(p_data.reason_code)
{
case "lack":
alert("사이버머니가 부족합니다. 이용안내를 참고하십시오.");
break;
case "diff":
alert("발송자 전화번호가 회원정보와 일치하지않습니다.");
break;
case "trns":
alert("통신사 사정으로 인해 발송에 실패하였습니다. 잠시 후 이용바랍니다.");
break;
default:
alert("시스템 문제로 인해 발송에 실패하였습니다. 잠시 후 이용바랍니다.");
break;
}
}
}
else
{
alert("로그인 후 사용하십시오.");
// Login하지 않은 경우 로그인 popup을 띄워 Login 확인한 후
// 다시 수행해야 할 부분을 aftLogin callback 함수에 정의한다.
jQuery.extend({
aftLogin: function() {
send_sms();
}
});
// Login popup open. 로그인 layer popup을 화면 중앙에 표시
open_loginPop(null);
}
}
});
}
function isMobilePhoneNum(p_phoneNum)
{
var hpRgExp = /^01[016789]-?[0-9]{3,4}-?[0-9]{4}$/;
return hpRgExp.test(p_phoneNum);
}
function read_exchange_data(p_loadCallback)
{
$.ajax({
url: "/service/common/svc_get_exchange.asp",
type: 'POST',
data: {},
dataType: 'json',
async: true,
//timeout: 3000,
error: function(p_req, p_status, p_err) {
//alert('ERR1');
//alert("환율정보 Loading 중 오류가 발생하였습니다. 잠시 후 이용바랍니다.");
},
success: function(p_data) {
$.extend({exchangeData: p_data});
if ("function" == typeof(p_loadCallback))
{
p_loadCallback($.exchangeData);
}
// $(p_data).find("country").each(function(idx) {
// trace("[" + idx + "]name=" + $(this).find("name").text() +
// ",rate=" + $(this).find("rate").text() +
// ",price=" + $(this).find("price").text() +
// ",continent=" + $(this).find("continent").text());
// });
}
});
}
function open_voteWin(p_pollID, p_btnDom)
{
var answerDom = $(".js_vote_ans:checked");
if (answerDom.length <= 0)
{
alert("설문조사 예시 항목을 선택해 주세요.");
return;
}
var param = "poll_id=" + p_pollID + "&answer=" + answerDom[0].value;
for (var idx = 1; idx < answerDom.length; idx++)
{
param += "," + answerDom[idx].value;
}
$.ajax({
url: "/service/common/svc_poll_ins.asp",
type: 'POST',
data: param,
dataType: 'json',
//timeout: 3000,
error: function() {
alert("설문 답변 등록 중 오류 발생. 잠시 후 이용바랍니다.");
},
success: function(p_data) {
// Login 여부 체크
if (p_data.no_login)
{
// Login하지 않은 경우 로그인 popup을 띄워 Login 확인한 후
// 다시 수행해야 할 부분을 aftLogin callback 함수에 정의한다.
jQuery.extend({
aftLogin: function() {
open_voteWin(p_pollID, p_btnDom);
}
});
// Login popup open
open_loginPop();
}
else
{
if (p_data == undefined )
{
alert("설문조사 등록에 실패하였습니다.");
return;
}else if(p_data != undefined & p_data.err_msg != undefined){
alert(p_data.err_msg);
return;
}
var voteWindow = $("#p_pollResult");
voteWindow.find("#poll_num").html(p_data.pollID);
voteWindow.find("#poll_term").html(p_data.pollFrDate + " ~ " + p_data.pollToDate);
voteWindow.find("#poll_question").html(p_data.pollQs);
voteWindow.find("#resultTotal").html(p_data.resultTot + "명");
var ansContainer = voteWindow.find(".poll_ans_list");
ansContainer.empty();
for (var idx = 0; idx < p_data.choiceList.length; idx++)
{
var datarec = p_data.choiceList[idx];
var ansRec = $("")
.append("" + datarec.answer + "
" +
"" + datarec.resultPer + "%(" + datarec.result + "명)
" +
"" +
"");
ansContainer.append(ansRec);
}
voteWindow.find("div.poll_txt p").removeClass("hidden");
voteWindow
.css("left", Math.floor(($(window).width() - voteWindow.width()) / 2) + $(window).scrollLeft())
.css("top", Math.floor(($(window).height() - voteWindow.height()) / 2) + $(window).scrollTop())
.show();
//Poll QnA. 상담팝업으로
$("#btn_poll_qna").click(function(){
F_popQWrite("6", p_data.voterAnsId);
});
}
}
});
}
function open_pollResultWin(p_pollID, p_btnDom)
{
var param = "poll_id=" + p_pollID;
$.ajax({
url: "/service/common/svc_poll_read.asp",
type: 'POST',
data: param,
dataType: 'json',
//timeout: 3000,
error: function() {
alert("설문조사 읽기 오류!!");
},
success: function(p_data) {
// Login 여부 체크
if (p_data.no_login)
{
// Login하지 않은 경우 로그인 popup을 띄워 Login 확인한 후
// 다시 수행해야 할 부분을 aftLogin callback 함수에 정의한다.
jQuery.extend({
aftLogin: function() {
open_pollResultWin(p_pollID, p_btnDom);
}
});
// Login popup open
open_loginPop();
}
else
{
if (p_data == undefined )
{
alert("설문조사 내용이 없습니다.");
return;
}
else if (p_data.err_msg != undefined)
{
alert(p_data.err_msg);
return;
}
var voteWindow = $("#p_pollResult");
voteWindow.find("#poll_num").html(p_data.pollID);
voteWindow.find("#poll_term").html(p_data.pollFrDate + " ~ " + p_data.pollToDate);
voteWindow.find("#poll_question").html(p_data.pollQs);
voteWindow.find("#resultTotal").html(p_data.resultTot + "명");
var ansContainer = voteWindow.find(".poll_ans_list");
ansContainer.empty();
for (var idx = 0; idx < p_data.choiceList.length; idx++)
{
var datarec = p_data.choiceList[idx];
var ansRec = $("")
.append("" + datarec.answer + "
" +
"" + datarec.resultPer + "%(" + datarec.result + "명)
" +
"" +
"");
ansContainer.append(ansRec);
}
voteWindow.find("div.poll_txt p").addClass("hidden");
voteWindow
.css("left", Math.floor(($(window).width() - voteWindow.width()) / 2) + $(window).scrollLeft())
.css("top", Math.floor(($(window).height() - voteWindow.height()) / 2) + $(window).scrollTop())
.show();
}
}
});
}
function close_poll_window()
{
document.getElementById("p_pollResult").style.display = "none";
return false;
}
function view_search_list()
{
var frm = document.frm_search_sch_opt;
var param = "?courseCd=" + frm.sel_course.value;
var selCountry = "";
if ("" != frm.sel_country.value)
{
// 학교 검색 페이지에는 nationCode를 전달.
selCountry = frm.sel_country.value.split("|")[1];
}
var openCourse = "";
if (0 < $(frm.sel_openCourse).filter(":checked").length)
{
openCourse = $(frm.sel_openCourse).filter(":checked").val();
}
if ("" == selCountry && "" == openCourse)
{
alert("국가 또는 어학연수 목적 중 한가지 이상을 선택하십시오.");
}
else
{
param += "&natCd=" + selCountry + "&sel_openCourse=" + openCourse;
if ($("#chkbx_basic_info").attr("checked"))
param += "&view_sch_basicinfo=Y";
if ($("#chkbx_course_dtl").attr("checked"))
param += "&view_courseDtl=Y";
document.location.href = "/study_info/search_englangsch_list.asp" + param;
}
}
function open_jisa_popup(p_jisaCode)
{
var url = "/user_support/pop_network.asp?grCd=" + p_jisaCode;
var popJisa = window.open(url, "popJisa", "width=817,height=685,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes");
popJisa.focus();
}
function notice_closeWin1(p_id){
if ( document.getElementById(p_id).checked == true ){
notice_setCookie1(p_id, "done" , 1); // 1=하룻동안 공지창 열지 않음
}
document.getElementById("layer_"+p_id).style.display = 'none';
}
function notice_setCookie1( name, value, expiredays ){
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
// Sliding Banner
function OpenSlidingPanel() {
$("#expandPanelBanner_Panel").slideDown("1000");
$("#expandPanelBanner_Panel_Ex").fadeOut('fast');
$("#expandPanelBanner_Panel").fadeIn('slow');
}
function CloseSlidingPanel() {
$("#expandPanelBanner_Panel").slideUp("1000");
$("#expandPanelBanner_Panel").fadeOut('fast');
$("#expandPanelBanner_Panel_Ex").fadeIn('slow');
}
function OpenEventBranchR(){
/*
var pop_Lwin = window.open('/event/ex/index.asp','Lwin','top=0, left=0, width=1000,height=730,resizable=yes,scrollbars=yes');
pop_Lwin.focus();
*/
F_popExhiReserv();
}