function isKorean(objStr) { for (i = 0; i < objStr.length; i++) { if (((objStr.charCodeAt(i) > 0x3130 && objStr.charCodeAt(i) < 0x318F) || (objStr.charCodeAt(i) >= 0xAC00 && objStr.charCodeAt(i) <= 0xD7A3))) { return false; // 한글 포함이면 false 반환 } else { return true; // 한글 미포함이면 true 반환 } } } function search_contents_check(frm) { var server_host = "fileis.com"; if(server_host.indexOf("nfile.kr") >= 0 && !m_id) { alert("로그인후 이용하세요."); return; } var reg = /[^a-z|A-Z|0-9|ㄱ-ㅎ|가-힣|\s]/g var url = "/contents/ajax_search_check.php"; var s_val = frm.s_word.value.replace(reg, "");;//.replace(/\s/gi, ""); frm.s_word.value = s_val if( frm.category1.value == 'nickname' ) { $s_val = frm.sCode.value == '' ? s_val : frm.sCode.value; } var para = "s_group="+frm.category1.value+"&s_word="+encodeURIComponent(s_val); if (s_val) { if (search_contents_form.category1.value =='numbers') { numberNum = isNaN(s_val); if (numberNum == true) { alert('숫자만 가능합니다.'); return; } } else { var han_check= false; if (s_val.length <= 1) { han_check = isKorean(s_val); } if (han_check == true) { alert('한글자 검색은 지원하지 않습니다.'); return; } } $.ajax({ type : 'POST' , url : url , data : para , success: function( msg ) { if(msg == "no_search") { alert("해당 검색어는 검색이 금지된 단어입니다."); return; } else if(msg == "ok") { var frm = document.search_contents_form; frm.action = "/contents/search.php"; frm.submit(); } else { var frm = document.search_contents_form; frm.action = "/contents/search.php"; frm.emCopy.value = 'Y'; frm.submit(); } } }); } else { alert("검색어를 입력하세요."); } } function return_search_contents_check(req) { var result = req.responseText; if(result == "ok") { var frm = document.search_contents_form; frm.action = "/contents/search.php"; frm.submit(); } else { var frm = document.search_contents_form; frm.emCopy.value = 'Y'; frm.action = "/contents/search.php"; frm.submit(); } } function moveCategory1(category1) { if(category1 == "ADT") { if(!m_id) { alert("로그인후 이용하세요."); return; } var is_adult = ""; if(is_adult == "0") { window.open("/member/adult_check.html","Adult_check_window_box","width=532,height=290"); return; } else if(is_adult == "2") { alert("미성년자는 성인컨텐츠에 접근 하실 수 없습니다."); return; } else if(is_adult == "3") { alert("성인인증 해제중입니다.\n\n정보수정 페이지에서 재인증 해주세요."); return; } } movePage("/contents/?category1=" + category1); } function moveCategory2(category2) { var temp = category2.split("_"); movePage("/contents/?category1=" + temp[0] + "&category2=" + category2); }