document.domain = "maegu.com"; var db; var general_trans_flag = 'true'; var chat_trans_flag = 'true'; var protocol = "http://"; var protocol_ssl = "https://"; var maegu_url = protocol+"www.maegu.com"; //var protocol_ssl_maegu = "https://www.maegu.com/"; var protocol_ssl_maegu = "http://www.maegu.com/"; var m_member_error_display; var m_current_location; var m_current_latlng; var m_modify_criteria; var m_modify_sort; var m_friend_members; var m_all; var m_result; var m_members; var m_username; var m_eng_name; var m_name; var m_nation; var m_nationality; var m_language; var m_location; var m_location_detail; var m_mobile; var m_email; var m_confirm_delete; var editor = "#cmt"; var editor_trans = "#editor_trans"; var trans_verify = "#trans_verify1"; var url = "#url"; var src = ""; var count = 0; var original_cmt; var dictionary_flag = "no"; var please_wait = null; var lngName = []; var language_custom = []; var kmj = 0; var setInterval_id = []; var mobile = false; var timer_chat; var timer_ad; //var timer_search; var save_cmt_code = ''; var selected = 0; var latitude; var longitude; var address = ''; var source_list = []; var kk = 0; var sms_send_flag = "no"; var flag_code = ""; var flag_name = ""; var flag = ''; var temp_word_source = ""; var temp_word_dest = ""; var requester; var mouseX = 0; var mouseY = 0; var mouseX1 = 0; var mouseY1 = 0; var requester2; var country_code = ''; var send_window = null; var flag_caret = 'off'; var selected_id = "#cmt"; var input_code_select = ''; var word = ''; var fontSize_zoom = ''; var ui_value = ''; var content = ''; var toggle_flag = false; var country_flag_url = maegu_url+"/common/image/country_flag/"; var noimage_url = maegu_url+"/common/image/profile/noimage1.png" + "?date=" + new Date().getTime(); var profile_image_url = maegu_url+"/common/image/profile/"; var profile_image_thumb_url = maegu_url+"/common/image/profile/thumb/"; var select_search_classify = ''; var obj_tabs; var obj_tabs_chat; var obj_tabs_pr; var obj_tabs_search; var login_status_on_image_path = maegu_url+"/common/image/bullet_online.png"; var login_status_off_image_path = maegu_url+"/common/image/bullet_offline.png"; var user_status_image_path = maegu_url+"/common/image/tag.png" + "?date=" + new Date().getTime(); var current_location_image_path = maegu_url+"/common/image/current_position.png"; var count_chat_square_display = 0; var win_id; var myScroll; var myScroll_private; var CHANNEL_GENERAL = 'maegu_general'; var CHANNEL_LOGIN = 'maegu_login'; var CHANNEL_CHAT = 'maegu_chat'; var NICK_REGEX = /^[a-z0-9\-_]{2,20}$/i; var chat_my_pubid = ''; var mypipe = ''; var tts_element = ''; var title = ''; var window_new_width = ''; var window_new_height = ''; var show_transition = '';//창 나타날 때 효과 var hide_transition = '';//창 사라질 때 효과 var result_address = ''; var apple = ''; var pr_classify = "pr_a"; var script1 = false; var modify_profile_js_flag = 0; var main_ad_timeId = ""; // 메인 광고의 타이머 var pr_ad_timeId = ""; // PR 광고의 타이머 var main_ad_no = 1000000000000; // 메인 광고의 플래그값 var first_app_flag = 0; //app_load가 처음 여부 플래값 var flag_third_party_api = false; //공유 api 처음 여부 플래그값 var maegu_share_url = protocol+"www.maegu.com"; var share_image = []; share_image['ko'] = "http://www.maegu.com/common/image/screenshot_maegu_ko.jpg"; share_image['en'] = "http://www.maegu.com/common/image/screenshot_maegu_en.jpg"; var api_msg = []; /* api_msg['ko'] = "[매구]\n\n구글, 네이버, 페이스북, 트위터, 카카오톡, 라인, 음성 통역 채팅, SNS...\n이 모든 것을 \"한방\"에 끝!"; api_msg['en'] = "[MaeGu]\n\nLet's chat freely with friends around the world without language barriers, in the MaeGu's world!"; */ /* api_msg['ko'] = "[[ 매구정음 ]]\n\n나라말이 서로 달라 문자끼리 서로 맞지 아니할세.\n\n이런 이유로 외국인과 말을 하고자 하여도 언어 장벽으로 인하여 대화 나누기가 힘드니라.\n\n내 이를 어여삐 여겨 음성 번역 채팅 플랫폼을 만드노니.\n\n전세계인으로 하여금 사용법을 쉬이 익혀 소통하게 하고자 할 따름이니라.\n\n- 매구데이 -\n"; api_msg['en'] = "[[ MaeGu Jeongeum ]]\n\nBecause the speech of this country is different from that of each other, it does not match the other letters.\n\nTherefore, even if the ignorant want to communicate, many of them cannot state their concerns due to a language barrier.\n\nSaddened by this, I have voice translation chatting platform newly made.\n\nIt is my wish that all the people may easily learn how to use and that be convenient for daily use.\n\n- MaeGu Day -\n"; */ /* api_msg['ko'] = "[매구]\n\n구글, 네이버, 페이스북, 트위터, 카카오톡, 라인, 음성 통역 채팅, SNS...\n이 모든 것을 \"한방\"에 끝!\n\n스마트폰,스마트TV,태블릿,PC,노트북...기종에 상관없이 사이트에 접속해서 편리하게 사용하실 수 있습니다."; api_msg['en'] = "[MaeGu]\n\nGoogle, Facebook, Twitter, WhatsApp, WeChat, Line, Kakaotalk, Voice translator chat, SNS...\n\"MaeGu\" Can Do Them All \"at a stroke\", HanBang!"; */ api_msg['ko'] = "[매구]\n다국어 번역검색\n실시간 통역채팅\n\n매구는 다국어 번역 검색, 웹사이트 번역, 실시간 통역 채팅을 하실 수 있는 사이트입니다!\n\n이제 별도의 다운로드 없이 PC,노트북,태블릿,스마트폰,스마트TV...기종과 관계없이 매구 사이트에 접속만 하시면 편리하게 사용하실 수 있습니다.\n\n[매구 사이트]\nwww.maegu.com\n\n[매구 사용법 동영상]\nmm.maegu.com\n"; api_msg['en'] = "[MaeGu]\nMultilingual translation searching\nReal time interpretation chatting\n\nMaeGu is a site you can do multilingual translation searching, website translation, real time interpretation chatting!\n\nNow, with no downloading, PC, laptop, tablet, smartphone, smartTV...regardless of the device type, if you only have access to MaeGu, you can use it conveniently.\n\n[MaeGu site]\nwww.maegu.com\n\n[MaeGu manual VOD]\nmm.maegu.com\n"; var dictionary = new Array();//1차원 배열 선언 /* 한국의 경우 사전 url 정의 */ dictionary['ko'] = new Array();//dictionary['ko']에 대한 2차원 배열 선언 dictionary['ko']['p'] = new Array();//dictionary['ko']['p']에 대한 3차원 배열 선언 dictionary['ko']['m'] = new Array();//dictionary['ko']['m']에 대한 3차원 배열 선언 dictionary['ko']['p']['home'] = "http://dic.naver.com"; dictionary['ko']['p']['ko'] = "http://krdic.naver.com/search.nhn?dic_where=krdic&query="; dictionary['ko']['p']['en'] = "http://endic.naver.com/search.nhn?sLn=kr&isOnlyViewEE=N&query="; dictionary['ko']['p']['ja'] = "http://jpdic.naver.com/search.nhn?ie=utf8&query="; dictionary['ko']['p']['zh'] = "http://cndic.naver.com/search/all?q="; dictionary['ko']['p']['zh-TW'] = "http://cndic.naver.com/search/all?q="; dictionary['ko']['p']['fr'] = "http://frdic.naver.com/search.nhn?query="; dictionary['ko']['p']['es'] = "http://spdic.naver.com/search.nhn?query="; dictionary['ko']['p']['de'] = "http://dedic.naver.com/#search/all/q="; dictionary['ko']['p']['vi'] = "http://vndic.naver.com/search.nhn?query="; dictionary['ko']['p']['ru'] = "http://rudic.naver.com/#search/"; dictionary['ko']['p']['la'] = "http://ladic.naver.com/#search/"; dictionary['ko']['p']['pt'] = "http://ptdic.naver.com/#search/"; dictionary['ko']['p']['mn'] = "http://mndic.naver.com/#search/"; dictionary['ko']['p']['id'] = "http://iddic.naver.com/#search/"; dictionary['ko']['p']['tr'] = "http://trdic.naver.com/#search/"; dictionary['ko']['p']['km'] = "http://khdic.naver.com/#search/"; dictionary['ko']['p']['uk'] = "http://uadic.naver.com/#search/"; dictionary['ko']['p']['sq'] = "http://aldic.naver.com/#search/"; dictionary['ko']['m']['home'] = "http://m.dic.naver.com"; dictionary['ko']['m']['ko'] = "http://m.krdic.naver.com/search.nhn?dic_where=krdic&query="; dictionary['ko']['m']['en'] = "http://m.endic.naver.com/search.nhn?sLn=kr&isOnlyViewEE=N&query="; dictionary['ko']['m']['ja'] = "http://m.jpdic.naver.com/search.nhn?ie=utf8&query="; dictionary['ko']['m']['zh'] = "http://m.cndic.naver.com/search/all?q="; dictionary['ko']['m']['fr'] = "http://m.frdic.naver.com/search.nhn?query="; dictionary['ko']['m']['es'] = "http://m.spdic.naver.com/search.nhn?query="; dictionary['ko']['m']['de'] = "http://m.dedic.naver.com/#search/all/q="; dictionary['ko']['m']['vi'] = "http://m.vndic.naver.com/search.nhn?query="; dictionary['ko']['m']['ru'] = "http://m.rudic.naver.com/#search/"; dictionary['ko']['m']['la'] = "http://m.ladic.naver.com/#search/"; dictionary['ko']['m']['pt'] = "http://m.ptdic.naver.com/#search/"; dictionary['ko']['m']['mn'] = "http://m.mndic.naver.com/#search/"; dictionary['ko']['m']['id'] = "http://m.iddic.naver.com/#search/"; dictionary['ko']['m']['tr'] = "http://m.trdic.naver.com/#search/"; dictionary['ko']['m']['km'] = "http://m.khdic.naver.com/#search/"; dictionary['ko']['m']['uk'] = "http://m.uadic.naver.com/#search/"; dictionary['ko']['m']['sq'] = "http://m.aldic.naver.com/#search/"; /* 일본의 경우 사전 url 정의 */ dictionary['ja'] = new Array(); dictionary['ja']['p'] = new Array(); dictionary['ja']['m'] = new Array(); dictionary['ja']['p']['home'] = "http://dic.search.yahoo.co.jp"; dictionary['ja']['p']['ja'] = "http://dic.search.yahoo.co.jp/search?p="; dictionary['ja']['p']['en'] = "http://dic.search.yahoo.co.jp/search?p="; dictionary['ja']['m']['home'] = "http://dic.search.yahoo.co.jp/"; dictionary['ja']['m']['ja'] = "http://dic.search.yahoo.co.jp/search?p="; dictionary['ja']['m']['en'] = "http://dic.search.yahoo.co.jp/search?p="; /* 중국(간체)의 경우 사전 url 정의 */ dictionary['zh'] = new Array(); dictionary['zh']['p'] = new Array(); dictionary['zh']['m'] = new Array(); dictionary['zh']['p']['home'] = "http://www.iciba.com"; dictionary['zh']['p']['zh'] = "http://www.iciba.com/"; dictionary['zh']['p']['en'] = "http://www.iciba.com/"; dictionary['zh']['m']['home'] = "http://wap.iciba.com"; dictionary['zh']['m']['zh'] = "http://wap.iciba.com/cword/"; dictionary['zh']['m']['en'] = "http://wap.iciba.com/cword/"; /* 중국인(번체)의 경우 사전 url 정의 dictionary['zh-TW'] = new Array(); dictionary['zh-TW']['p'] = new Array(); dictionary['zh-TW']['m'] = new Array(); dictionary['zh-TW']['p']['home'] = "http://www.iciba.com"; dictionary['zh-TW']['p']['zh-TW'] = "http://www.iciba.com/"; dictionary['zh-TW']['m']['home'] = "http://wap.iciba.com"; dictionary['zh-TW']['m']['zh-TW'] = "http://wap.iciba.com/cword/"; */ /* var geocoder; var map; var infowindow = new google.maps.InfoWindow(); var marker; */ //google.setOnLoadCallback(lngcode_define); //google.maps.event.addDomListener(window, 'load', google_map_init); $.support.cors = true; $.fn._on = $.fn.on; $.fn.on = function(eventName, handler){ if(event == "click"){ if(mobile_device){ event = "touchend"; }else{ event = "click"; } } this._on(eventName, handler); }; $.fn.reflow = function() { /* 컨텐츠가 변경되었는데 레이아웃이 새로 잡히지 않는 경우 이는 모바일뿐만 아니라 데스크톱에서도 종종 목격되는 현상이다. 좀 괴상한 방법이지만, 브라우저의 버그를 우회하기 위해 다음과 같은 무의미한 감추기/보이기 및, 강제 위치 재계산을 위한 쓸모 없는 참조가 필요하다. */ this.hide(); this.each(function() { this.offsetWidth; this.offsetHeight; }); this.show(); return this; }; $.fn.scrollBottom = function () { var last = $(this).attr('scrollHeight') - $(this).attr('clientHeight'); return $(this).scrollTop(last) }; APE.Config.scripts = [APE.Config.baseUrl + '/Build/uncompressed/apeCoreSession.js']; client = new APE.Client(); //단축 메뉴 실행되지 않도록 함 document.oncontextmenu = function () { return false; }; $(window).bind('resize', function () { //css_setting(); }); /* $(window).bind('load', function () { }, false); */ $(window).bind('load', function () { $("#go_interpret").live("click", function () { //location.href = "interpreter/index.html"; location.replace("interpreter/"); }); $.ajaxSetup({ complete: function (e) { //console.clear(); } }); $("#layout_content").show(); //주소표시줄을 위로 밀어버림 setTimeout(function () { window.scrollTo(0,$("#logo").height()); //$(window).scrollTop(); }, 1000); mobile_device = mobile_check(); browser_check(); get_language_code_from_browser(); get_country_code_from_ip(); setInnerTextProperty(); if("") { activateSending(); init_ape(); } tab_load(); lngcode_define(); init_setting_common(); main_ad_run();//메인광고 //pr_ad_run();//라인광고 $(".btn_pr_classify[classify=pr_1] img").trigger("click"); $(".btn_pr_classify[classify=pr_1] img").addClass('border_menu'); }) /*** 사용자 정의 함수 (모바일/PC 분리되었던 것 통합) 시작 ***/ function fm_optimizeInput() { $("input[placeholder],textarea[placeholder]").each(function () { var tmpText = $(this).attr("placeholder"); if (tmpText != "") { $(this).attr("placeholder", "").attr("placeholder", tmpText) } }) } function view_dictionary() { var url = ''; var message = ''; var language = ''; var device = ''; if(mobile_device) { device = 'm'; } else { device = 'p'; } if (flag_caret == "off") { message = $(selected_id).val(); } else { message = $(selected_id).caret().text; } message = trans_item_selection(); //language = selected_language(selected_id); language = selected_language("#editor_trans"); if(!dictionary[Real_language]) { $("#search_button_Wikipedia").trigger("click");return false; } if (message == '') { if(dictionary[Real_language][device]['home']) { url = dictionary[Real_language][device]['home']; window.open(url, "dic_win1"); } else { $("#search_button_Wikipedia").trigger("click");return false; } } else { if(dictionary[Real_language][device][language]) { url = dictionary[Real_language][device][language]+encodeURIComponent(message); window.open(url, "dic_win1"); } else { $("#search_button_Wikipedia").trigger("click");return false; } } } function google_translation() { var a = $(editor); if (flag_caret == "off") { var text = a.val() } else { var text = $(a).caret().text } if(mobile_device) { var url = protocol_ssl+"translate.google.com/m/translate?vi=m&hl=" + $("#input_code").val() + "&sl=" + $("#input_code").val() + "&tl=" + $("#src2").val() + "&q=" + encodeURIComponent(text); } else { var url = protocol_ssl+"translate.google.com/?hl=" + $("#input_code").val() + "&#" + $("#input_code").val() + "|" + $("#src2").val() + "|" + encodeURIComponent(text); } var google_translation = window.open(url, "google_translation"); google_translation.focus() } function google_translation_chat(object) { if(mobile_device) { var url = protocol_ssl+"translate.google.com/m/translate?vi=m&hl=" + Real_language + "&sl=" + object.attr('view_code') + "&tl=" + Real_language + "&q=" + encodeURIComponent(object.attr('message')); } else { var url = protocol_ssl+"translate.google.com/?hl=" + Real_language + "&#" + object.attr('view_code') + "|" + Real_language + "|" + encodeURIComponent(object.attr('message')); } var google_translation = window.open(url, "google_translation"); google_translation.focus(); } function tts_play(word, code) {//채팅창의 대화내용 클릭시 if(mobile_device) {//모바일일 경우 if (word) { var words = word.toLowerCase(); var url = protocol+"translate.google.com/translate_tts?ie=UTF-8&tl=" + code + "&q=" + words; tts_element.src = url; tts_element.play(); //var url = protocol+"translate.google.com/translate_tts?ie=UTF-8&tl=" + code + "&q=" + words; //$("#div_tts").load(url); } else { return false } } else {//모바일이 아닐 경우 if (word) { //var words = escape(encodeURIComponent(word.toLowerCase())); var words =word.toLowerCase(); var url = protocol+"translate.google.com/translate_tts?ie=UTF-8"; var url2 = "&tl=" + code + "&q=" + words; var urlt = url + url2; //top.tts_area.location.href = urlt; //top.tts_area.location.href = "common/tools/tts_play/mvk_tts_html5.html?tl=" +code+'&q='+words; if (Browser.isChrome) { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_chrome.html?url=" + urlt; } else if (Browser.isIE) { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_ie.html?url=" + urlt; } else { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_ff_safari_opera.html?url=" + urlt; } } else { return false } } } function tts_play_menu() {//툴바의 tts버튼 클릭시 if(mobile_device) {//모바일일 경우 if (flag_caret == "off") { var word = $(selected_id).val() } else { var word = $(selected_id).caret().text } if (word) { if (selected_id == editor || selected_id == trans_verify) { var code = $("#input_code").val() == 'auto' ? $("#input_code1").val() : $("#input_code").val() } else { var code = $("#src2").val() } //var words = escape(encodeURIComponent(word.toLowerCase())); var words = word.toLowerCase(); var url = protocol+"translate.google.com/translate_tts?ie=UTF-8&tl=" + code + "&q=" + words; tts_element.src = url; tts_element.play(); } else { alert($("#error_empty_tts").html()); } } else {//모바일이 아닐 경우 if (flag_caret == "off") { var word = $(selected_id).val() } else { var word = $(selected_id).caret().text } if (word) { if (selected_id == editor || selected_id == trans_verify) { var code = $("#input_code").val() == 'auto' ? $("#input_code1").val() : $("#input_code").val() } else { var code = $("#src2").val() } //var words = escape(encodeURIComponent(word.toLowerCase())); var words = word.toLowerCase(); var url = protocol+"translate.google.com/translate_tts?ie=UTF-8"; var url2 = "&tl=" + code + "&q=" + words; if (Browser.isChrome) { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_chrome.html?url=" + url + url2; } else if (Browser.isIE) { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_ie.html?url=" + url + url2; } else { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_ff_safari_opera.html?url=" + url + url2; } } else { alert($("#error_empty_tts").html()); } } } function pulsate(channel, sender, reciever, message_view) { var options = {}; var selectedEffect = 'highlight'; $("#dialog").text(message_view); $("#dialog").dialog({ width: 200, height: 150, title: sender, resizable: false, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }).parent().show(selectedEffect, options, 1000, callback); function callback() { setTimeout(function () { $("#dialog").parent().fadeOut() }, 5000) }; var notify_url = "common/sound/fox.mp3"; if(mobile_device) { tts_element.src = notify_url; tts_element.volume = 1; tts_element.play(); } else { var notify_url = "common/sound/fox.mp3"; if (Browser.isChrome) { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_chrome.html?url=" + notify_url; } else if (Browser.isIE) { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_ie.html?url=" + notify_url } else { top.tts_area.location.href = "common/tools/tts_play/mvk_tts_ff_safari_opera.html?url=" + notify_url } } var selectedEffect = 'pulsate'; if ($(".private_chat_list[for_channel_name=" + channel + "] [notify=check_notify]").text() == "") { setInterval_id.push(setInterval("notify()", 2000)) } var no = $('#private_chat_list_' + channel).attr('no'); var classify = 'update_notification_value'; var requester_str = "mode=private_chatting_list&classify=" + classify + "&no=" + no; chatting_list_process(classify,requester_str, channel) }; function view_check(current_area, checked) { if (checked == true) { $("#" + current_area + " div[name='message_original']").attr("class", 'original_display_on') } else { $("#" + current_area + " div[name='message_original']").attr("class", 'original_display_off') } if (!Browser.isIE) { if (current_area == 'chat_square_body') { myScroll.refresh() } else { myScroll_private.refresh() } } } function trans_toolbar_toggle() { $("input:radio[group='input_area'][for1='cmt']").trigger("click"); $("#trans_block").slideToggle("slow"); $("#trans_display").slideToggle("slow"); $("#trans_tools_bar").slideToggle("slow"); } function keyboard_setting() { virtualKeyboard = new Keyboard($(editor)); $("#check_vk").attr("checked","checked");; var a = $(".vk:checkbox[lang='en'][order='1']"); a.attr('checked', 'checked'); css_vk(); $("#maegu_vk").draggable({ opacity: 0.8, scroll: false, handle: '#drag_handle' }); $("#vk_size_minus").bind("click", function () { var left = $('#maegu_vk').css("left","90px"); var vk_size = $('#maegu_vk').css("font-size"); $('#maegu_vk').css("font-size",(parseInt(vk_size) - 5) + 'px'); $('#maegu_vk td').css("font-size",(parseInt(vk_size) - 5) + 'px'); css_vk(); }); $("#vk_size_plus").bind("click", function () { var left = $('#maegu_vk').css("left","90px"); var vk_size = $('#maegu_vk').css("font-size"); $('#maegu_vk').css("font-size",(parseInt(vk_size) + 5) + 'px'); $('#maegu_vk td').css("font-size",(parseInt(vk_size) + 5) + 'px'); css_vk(); }); $("#img_keyboard").bind("click", function () { $('#maegu_vk').toggle(); var a = $(".vk:checkbox[lang='" + $('select#input_code').val() + "'][order='1']"); maegu_vk(a); }); $("#select_vk").bind("click", function (c) { change_vk(); }); $("#check_vk").bind("click", function () { $("#input_code").trigger("change"); }); $("#input_code").bind("change", function () { if ($(this).val() == 'auto' || $(this).val() == 'none' || $(".vk:checkbox[lang='" + $(this).val() + "']").length == 0) { var a = $(".vk:checkbox[lang='en'][order='1']"); maegu_vk(a); } else { var a = $(".vk:checkbox[lang='" + $(this).val() + "'][order='1']"); maegu_vk(a); } }); $("#src2").bind("change", function () { if ($(editor).val()) { if('') { translation(Real_language) } } }); $("#close_keyboard").bind("click", function () { $("#img_keyboard").trigger("click"); }); $("#set,#ok_keyboard_list,#close_keyboard_list").bind("click", function () { preprocess(); }); function css_vk() { var top = $(window).height() - $("#maegu_vk").height() - $("#cmt_display").height() - $("#trans_display").height() - $("#trans_block").height() - $("#menu1").height() - $("#footer").height() - $("#main_ad").height() - $("#main_ad").height() - 10; var left = '90px'; $("#maegu_vk").css({'position':'absolute','top':top,'left':left}); } function maegu_vk(a) { if($('#maegu_vk').is(":visible")) { //var a = $(".vk:checkbox[lang='" + $('select#input_code').val() + "'][order='1']"); a.attr('checked', 'checked'); loadKeyboard(virtualKeyboard, a.val(), "0"); $("#display").html(a.attr('label')); virtualKeyboard.textbox = $(editor); //editor_current_layout = a.val(); } else { var a = $(".vk:checkbox[lang='en'][order='1']"); a.attr('checked', 'checked'); loadKeyboard(virtualKeyboard, a.val(), "0"); $("#display").html(a.attr('label')); virtualKeyboard.textbox = $(editor); //editor_current_layout = a.val(); } } } function virtualkeyboard_list() { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/virtualkeyboard.php?mode=display_list&num_temp='+num_temp, //data:{mode:'display_list',num_temp:num_temp}, type : 'post', contentType:"text/plain;charset=utf-8", crossDomain: true, dataType:'jsonp', json:"callback", jsonpCallback:"vk_callback", success: function (content1) { }, error: function (x, o, e) { alert(x.status + " : " + o + " : " + e) } }) } function vk_callback(content1) { content = eval("(" + content1 + ")"); var no = 0; var str = ''; var str_US = ''; var str_lang = ''; var num = content.contents.length; for (var i = 0; i < num; i++) { var label = content.contents[i].label; var value = content.contents[i].value; var lang = content.contents[i].lang; var t_support = content.contents[i].t_support; var order = content.contents[i].order; if (value == 'US') { str_US += ""; str_US += "
" } else if ('' && lang == '') { str_lang += ""; str_lang += "
" } else { no = no + 1; str += no + "."; str += "
" } } $("#Div2").html(str_US + str_lang + "--------------------------------
" + str); keyboard_setting(); } /*** 사용자 정의 함수 (모바일/PC 분리되었던 것 통합) 끝 ***/ /*** Common 사용자 정의함수 시작 ***/ function pc_mobile_view() { if (mobile_device) { $(".mobile").css("display", "inline"); $(".pc").css("display", "none"); tts_element = new Audio(); } else { $(".mobile").css("display", "none"); $(".pc").css("display", "inline") } $("#area_keyboard").hide(); if (!mobile_device && ('' || '')) { //$("#check_vk").show(); $("#area_keyboard").show(); } } function css_chatting() { if(mobile_device) { //if(apple) { css_setting(); setTimeout(function () { window.scrollTo(0,$("#logo").height() + $("#main_ad").height()); //$(window).scrollTop(); }, 1000); //} } } function css_normal() { if(mobile_device) { //if(apple) { css_setting(); setTimeout(function () { window.scrollTo(0,$("#logo").height()); //$(window).scrollTop(); }, 0); //} } } function css_setting() { var window_height = $(window).height();//윈도우창 var logo_height = $("#logo").height();//로고 라인 var main_ad_height = $("#main_ad").height();//메인 광고 라인 var main_menu_height = $("#main_menu").height();//메인메뉴바 var cmt_display_height = $("#cmt_display").height();//검색어 입력 라인 var trans_display_height = $("#trans_display").height();//번역된 검색어 출력 라인 var trans_block_height = $("#trans_block").height();//언어 선택 라인 var menu1_height = $("#menu1").height();//도구바 라인 var footer_height = $("#footer").height();//푸터바 //var footer_height = 0;//푸터바 var apple = MobileDevice.is_iphone || MobileDevice.is_ipod || MobileDevice.is_ipad; if(mobile_device) { var toolbar_height = cmt_display_height + menu1_height;//도구바 전체 $("#toolbar").css("height",toolbar_height); if(apple) { var apple_bar = 25; var remind_height = window_height - logo_height - main_ad_height - main_menu_height - toolbar_height + apple_bar; } else { var remind_height = window_height - logo_height - main_ad_height - main_menu_height - toolbar_height - 8; } } else { var toolbar_height = cmt_display_height + trans_display_height + trans_block_height + menu1_height;//도구바 전체 $("#toolbar").css("height",toolbar_height); var remind_height = window_height - logo_height - main_ad_height - main_menu_height - toolbar_height - 8; } $(".main_menu_body, #tabs .line_ad_area").css({'height':remind_height}); $("#ad_area .line_ad_area").css({'height':window_height}); if(mobile_device) { if(apple) { $("#chat_body").css({'height':$("#chat_body").height() + apple_bar}); } } var chat_menu_height = $(".ui-tabs-nav").height(); var chat_subtitle_height = $(".chat_subtitle").height(); var chat_division_height = $("#chat_body").height() - chat_menu_height + 2; var wrapper_height = chat_division_height - chat_subtitle_height; $(".chat_division").css({'height':chat_division_height}); $("#wrapper, #wrapper_private").css({'height':wrapper_height}); /* alert("window_height : "+window_height+"\n" +"logo_height : "+logo_height+"\n" +"main_ad_height : "+main_ad_height+"\n" +"main_menu_height : "+main_menu_height+"\n" +"cmt_display_height : "+cmt_display_height+"\n" +"trans_display_height : "+trans_display_height+"\n" +"trans_block_height : "+trans_block_height+"\n" +"menu1_height : "+menu1_height+"\n" +"toolbar_height : "+toolbar_height+"\n" +"footer_height : "+footer_height+"\n" +"remind_height : "+remind_height+"\n" ); */ } function pop_window_size() { window_new_width = $("#tabs").width() * 0.9;//창 가로크기 window_new_height = $(window).height() * 0.9; //창 세로크기/350 } function init_setting_common() { /* 출력창 변수 시작 */ title = '';//창 제목줄에 나타낼 광고 문구 /* if(!mobile_device) { window_new_width = '600';//창 가로크기 window_new_height = $(window).height() * 0.7; //창 세로크기/400 } else { window_new_width = '90%';//창 가로크기 window_new_height = $(window).height() * 0.9; //창 세로크기/350 } */ pop_window_size(); show_transition = 'fade';//창 나타날 때 효과 hide_transition = 'clip';//창 사라질 때 효과 /* 출력창 변수 끝 */ //pop_window_size(); css_setting(); pc_mobile_view(); var language = Real_language; var page_in_language = $("#page_in_language"); if (language == "ko") { //$("#ad_korean").show() page_in_language.append(""); page_in_language.append(""); } else { //$("#ad_english").show(); $("#local_search_body").parents("fieldset").hide() page_in_language.append(""); page_in_language.append(""); } trans_language(); if(mobile_device) { trans_toolbar_toggle(); } /* 도움주신 분들 링크 */ var str = ''; str += $("#ad_body .supporters").clone().wrapAll("
").parent().html(); str += "
"; str += $("#ad_body .duty_helpers").clone().wrapAll("
").parent().html(); $("#special_thanks").append(str); $("#special_thanks").css({'text-align':'center'}); $("#online_users .heading").html(set_users_routine); //home_ad_routine(); setTimeout(function() { $("#search_body").load("search.html"); },500); islowIE10_message(); //display_app();//앱 설치 안내창 /* $("#layout_content").draggable({ opacity: 0.8, scroll: false, handle: '#logo' }); */ $("#chatting_content").css({ 'display': 'none' }); $(".info_wiki").live("click", function () { if($(this).attr('classify')) { var query_url = "http://"+Real_language+".wikipedia.org/wiki/" + $(this).attr('query'); } else { var query_url = "http://"+Temp_language+".wikipedia.org/wiki/" + $(this).attr('query'); } if ($("#trans_check").is(":checked")) {//웹번역 옵션 체크되어 있으면 transweb(Real_language, query_url); } else {//웹번역 옵션이 체크되어 있지 않으면 window.open(query_url,"_blank"); } }) //광고의 링크 클릭시// $(".ad_url").live("click", function (c) { if ($("#trans_check").is(":checked")) {//웹번역 옵션 체크되어 있으면 transweb(Real_language, encodeURIComponent($(this).attr('url'))); } else {//웹번역 옵션이 체크되어 있지 않으면 window.open($(this).attr('url'),"_blank"); } }) $(".ad_local").live("mouseover", function() { if(!mobile_device) { window.clearInterval(main_ad_timeId); } }); $(".ad_local").live("mouseout", function() { if(!mobile_device) { main_ad_run(); } }); /* $(".ad_line").live("mouseover", function() { if(!mobile_device) { window.clearInterval(pr_ad_timeId); } }); $(".ad_line").live("mouseout", function() { if(!mobile_device) { pr_ad_run(); } }); */ $(".icon-set-del").bind("click",function() { var target_id = $(this).attr('for_id'); $("#"+target_id).val(""); }); $(".please_donate").live("click",function() { $("a[for1='donate_maegu']").trigger("click"); }); $("#please_invest").live("click",function() { //$("a[for1='invest_maegu']").trigger("click"); $(".maegu_internal[for1='invest_maegu']").trigger("click"); }); $(".please_invest").live("click",function() { //$("a[for1='invest_maegu']").trigger("click"); $(".maegu_internal[for1='invest_maegu']").trigger("click"); }); $("#btn_ad_inquiry").live("click",function() { $(".maegu_internal[for1='ad_maegu']").trigger("click"); }); $(".btn_pr_classify img").each(function(index, element) { $(this).bind("click",function() { $(".btn_pr_classify img.border_menu").removeClass('border_menu'); $(this).addClass('border_menu'); pr_classify = $(this).parent().attr('classify'); var title = $(this).parent().attr('title'); ad_read_routine(pr_classify,title); }); }) /* 통신판매사업자 상세조회창 띄움 */ $(".registration_number").live("click", function() { var url = "http://www.ftc.go.kr/info/bizinfo/communicationViewPopup.jsp?wrkr_no=6052604946"; if(Real_language == 'ko') { //win_comment(url, "communicationViewPopup", 750, 700, 'no'); window.open(url, "communicationViewPopup1"); } else { transweb_maegu(url); } }); /* 벤처기업 상세조회창 띄움 */ $(".venture_number").live("click", function() { var url = "https://www.venturein.or.kr/venturein/infor/C21210.do?venid=maegu2000&menu=2"; if(Real_language == 'ko') { //win_comment(url, "communicationViewPopup", 750, 700, 'no'); window.open(url, "communicationViewPopup2"); } else { transweb_maegu(url); } }); $("#maegu_address_window_naver").live("click", function() { var address = $("#maegu_address").text(); map_service_maegu("naver",address); }); $("#maegu_address_window_google").live("click", function() { var address = $("#maegu_address").text(); map_service_maegu("google",address); }); $(".maegu_internal").live("click", function() { var title_message = new Array(); var classify = $(this).attr("classify"); switch($(this).attr("classify")) { case 'ad_inquiry' ://광고문의 title_message = $("#"+ $(this).attr("for1") + " .title").html(); break; case 'invest' ://투자문의 title_message = $("#"+ $(this).attr("for1") + " .title").html(); break; case 'Cooperation' ://협업문의 title_message['en'] = "If you are interested in cooperation, mail, please."; title_message['ko'] = "협업에 관심있으시면 메일 주세요."; title_message = title_message[Temp_language]; break; case 'qna' ://Q&A title_message['en'] = "If you have any questions, email, please."; title_message['ko'] = "문의사항이 있으시면 메일 주세요."; title_message = title_message[Temp_language]; break; default : title_message['en'] = "The more MaeGu evolve, the more you will be comfortable."; title_message['ko'] = "매구가 진화할수록 여러분은 편해집니다."; title_message = title_message[Temp_language]; break; } var to = $(this).attr("to"); var content = $("#" + $("input:radio[name='input_area']:checked").attr('for1')).val(); var locks = new Array(); locks = $(this).attr("class"); locks = locks.split(" "); locks = "&"+locks.join("=readonly&")+"=readonly"; var mail_url = new Array(); mail_url = $(this).attr("hreff"); mail_url = mail_url.split(':'); var data = "role=maegu_internal"; data += "&classify="+classify; data += "&content="+content; data += "&from="+cs_email; if(cs_english_name) { data += "&from_name="+cs_english_name+"("+cs_name+")"; } else { data += "&from_name="; } data += "&to="+mail_url[1]; data += "&to_name="; data += "&title_message="+title_message; var url = protocol_ssl_maegu+"common/maegu_mail/index.html?" + data + locks;; win_comment(url, "maegu_mail", 400, 500, "no"); }); $(".current_position").bind("click", function () { my_current_position(); }); if(!mobile_device) { $(editor + "," + editor_trans + "," + trans_verify).bind("select", function () { flag_caret = "on"; selected_id = '#' + $(this).attr("id"); //selected_id = '#' + this.id }); $(editor + "," + editor_trans + "," + trans_verify).bind("mousedown change", function () { flag_caret = "off"; selected_id = '#' + $("input:radio[name='input_area']:checked").attr('for1'); //selected_id = '#' + this.id }); } $("#sign_up").bind("click", function () { var url = protocol_ssl_maegu+'common/sign_up_form.php?language_code='+Temp_language+'&country_code='+Real_country_code+'&browser_language='+Browser_language+'&tel_country_code='+Tel_country_code; var target = 'sign_up'; window.open(url, target) }); $("#webtrans_url").live("click", function () { transweb(Real_language, encodeURIComponent($(this).attr('url'))) }); $("#find_account").bind("click", function () { var url = protocol_ssl_maegu+'common/find_account/find_account.html?language='+Temp_language+"&Real_country_code="+Real_country_code; var target = 'find_password'; window.open(url, target) }); $("#btn_modify,#temp_profile").bind("click", function () { var url = protocol_ssl_maegu+'common/modify_form.php'; var target = 'modify_account'; window.open(url, target) }); $("#btn_logout").bind("click", function () { logout() }); $("#btn_kakao_link").live("click", function () { execute_maegu_link_kakaotalk() }); $("#btn_kakaostory_link").live("click", function () { execute_maegu_link_kakaostory() }); $("#btn_facebook_link").live("click", function () { shareToFacebook() }); /* $("#twitter_link").live("click", function () { shareToTwitter() }); */ $("[name=input_area]").bind("click", function () { selected_id = "#" + $(this).attr('for1') }); $(".map_service").bind("click", function () { switch ($(this).attr('id_map')) { case "search_place": search_place();//map_service_1 break; case "display_lat_lng": display_lat_lng();//map_service_7 break; case "directions_google": map_directions("google");//map_service_3 break; case "directions_naver": map_directions("naver");//map_service_3 break; case "directions1": directions1();//map_service_4 break; case "directions2": directions2();//map_service_5 break; case "search_twitters": search_twitters();//map_service_6 break; case "world_travel": world_travel();//map_service_2 break; default: break } }); /* $(".get_previous_data").live({ click: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); $(this).parents(".chat_division").find(".loading_data").html("loading"); var position = 'p'; var doing = 'get_previous_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:first").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'p'); } } }); $(".get_recent_data").live({ click: function () { $(this).parents(".chat_division").find(".loading_data").html("loading"); var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'n'; var doing = 'get_recent_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:last").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'n'); } } }); */ $(".move_to_up").bind({ click: function () { if ($(this).parents(".chat_division").attr('id') == 'chat_square_body') { myScroll.scrollToElement('.view_message:first-child', 100); } else if ($(this).parents(".chat_division").attr('id') == 'chat_chat_body') { myScroll_private.scrollToElement('.view_message:first-child', 100); } }, taphold: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'p'; var doing = 'get_previous_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:first").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'p'); } }, dblclick: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'p'; var doing = 'get_previous_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:first").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'p'); } } }); $(".move_to_down").bind({ click: function () { if ($(this).parents(".chat_division").attr('id') == 'chat_square_body') { myScroll.scrollToPage(1, 10000000000, 100); } else if ($(this).parents(".chat_division").attr('id') == 'chat_chat_body') { myScroll_private.scrollToPage(1, 10000000000, 100); } }, taphold: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'n'; var doing = 'get_recent_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:last").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'n'); } }, dblclick: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'n'; var doing = 'get_recent_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:last").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'n'); } } }); /* $("#chat_square_body .move_to_up").bind({ dblclick: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); $(this).parents(".chat_division").find(".loading_data").html("loading"); var position = 'p'; var doing = 'get_previous_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:first").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'p'); } }, taphold: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); $(this).parents(".chat_division").find(".loading_data").html("loading"); var position = 'p'; var doing = 'get_previous_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:first").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'p'); } } }) $("#chat_square_body .move_to_down").bind({ dblclick: function () { $(this).parents(".chat_division").find(".loading_data").html("loading"); var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'n'; var doing = 'get_recent_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:last").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'n'); } }, taphold: function () { $(this).parents(".chat_division").find(".loading_data").html("loading"); var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'n'; var doing = 'get_recent_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:last").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'n'); } } }) $(".move_to_up").bind({ click: function () { if (!Browser.isIE) { if ($(this).parents(".chat_division").attr('id') == 'chat_square_body') { myScroll.scrollToElement('.view_message:first-child', 100); } else if ($(this).parents(".chat_division").attr('id') == 'chat_chat_body') { myScroll_private.scrollToElement('.view_message:first-child', 100); } } else { if ($(this).parents(".chat_division").attr('id') == 'chat_square_body') { var aaa = document.getElementById('wrapper'); aaa.scrollTop = 0; } else if ($(this).parents(".chat_division").attr('id') == 'chat_chat_body') { var aaa = document.getElementById('wrapper_private'); aaa.scrollTop = 0; } } } }) $(".move_to_down").bind({ click: function () { if (!Browser.isIE) { if ($(this).parents(".chat_division").attr('id') == 'chat_square_body') { //myScroll.scrollToElement('이동할 개체', 시간); //myScroll.scrollToElement('.view_message:last-child', 100); myScroll.scrollToPage(1, 10000000000, 100); //myScroll.scrollTo(0,$("#chat_square_body .comment").height(),100,true); //$("'.view_message:last-child'").css("border","solid 1px red"); } else if ($(this).parents(".chat_division").attr('id') == 'chat_chat_body') { //myScroll_private.scrollToElement('.view_message:last-child', 100); myScroll_private.scrollToPage(1, 10000000000, 100); //myScroll.scrollTo(0,$("#chat_chat_body .comment").height(),100,true); } } else { if ($(this).parents(".chat_division").attr('id') == 'chat_square_body') { var aaa = document.getElementById('wrapper'); aaa.scrollTop = aaa.scrollHeight; } else if ($(this).parents(".chat_division").attr('id') == 'chat_chat_body') { var aaa = document.getElementById('wrapper_private'); aaa.scrollTop = aaa.scrollHeight; } } } }) $("#chat_chat_body .move_to_up").bind({ dblclick: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); $(this).parents(".chat_division").find(".loading_data").html("loading"); var position = 'p'; var doing = 'get_previous_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:first").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'p'); } }, taphold: function () { var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); $(this).parents(".chat_division").find(".loading_data").html("loading"); var position = 'p'; var doing = 'get_previous_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:first").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'p'); } } }); $("#chat_chat_body .move_to_down").bind({ dblclick: function () { $(this).parents(".chat_division").find(".loading_data").html("loading"); var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'n'; var doing = 'get_recent_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:last").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'n'); } }, taphold: function () { $(this).parents(".chat_division").find(".loading_data").html("loading"); var classify = $(this).parents(".chat_division").attr('classify'); var channel = $(this).parents(".chat_division").attr('channel'); var position = 'n'; var doing = 'get_recent_data'; var no = $(this).parents(".chat_division").find(".comment .view_message:last").attr('for_no'); if (no) { display_chat(classify, channel, position, doing, no); } else { display_chat(classify, channel, 'n'); } } }); */ $(".chat_message").live("click", function() { tts_play($(this).attr("word"),$(this).attr("lang")); }); $(".user_info, .user_info1").live("click", function () { var user_username = $(this).attr('for_to'); display_user_info(user_username) }); //개인 채팅 리스트에 추가된 각 목록의 삭제아이콘 클릭시 $(".private_chat_list_del").live("click", function () { var no = $(this).parents('.private_chat_list').attr('no'); var channel = $(this).parents('[no=' + no + ']').attr('for_channel_name'); if ($("#chatting_content").attr('kmj') == channel) { $("#chatting_content span[id=title]").text(''); $("#chatting_content span[id=bullet]").attr("login_status", '0').html(" ul > li > a').index($('[href="#chat_body"]')) ? true: false; var is_chat_square = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_square_body"]')) ? true: false; var is_chat_private = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')) ? true: false; var is_chat_content = ($("#chatting_list").attr('clientHeight') <= 1); if ($(selected_id).val() && is_chat && (is_chat_square || (is_chat_private && is_chat_content))) { if ($("#chat_chat_body #target_chat_user img").attr("login_status") == "0" && (is_chat_private && is_chat_content)) { var user_status = '0' } if (flag_caret == "off") { var message = $(selected_id).val(); } else { var message = $(selected_id).caret().text } var message = trans_item_selection(); var cmt = message; var input_language = $("#" + $(selected_id).attr('for1')).val(); _write(cmt, input_language, user_status, ""); } }); $("#btn_sms_ad").live("click", function () { if (!cs_username || cs_level != '1') { member_error_display() } else { send_sms(selected_id) } }); $("#btn_sms").click(function () { var content = $("#" + $("input:radio[name='input_area']:checked").attr('for1')).val(); $(this).parent('a').attr('href', "sms:" + content).trigger("click") }); $("#btn_tel").click(function () { var content = $("#" + $("input:radio[name='input_area']:checked").attr('for1')).val(); $(this).parent('a').attr('href', "tel:" + content).trigger("click") }); $("#btn_camera").click(function () { alert("Service...coming soon!"); return false }); $("#btn_mail").click(function () { var content = $("#" + $("input:radio[name='input_area']:checked").attr('for1')).val(); var to = ''; if(cs_username) { $(this).parent('a').attr('hreff', "mailto:" + to).attr("class","maegu_internal lock_from").attr('content',content); } else { if(mobile_device) { $(this).parent('a').attr('href', "mailto:" + to).attr('content',content).trigger("click"); } else { member_error_display(); } } }); $("#btn_zoom").toggle( function () { var size_original = parseInt($("body").css("font-size")); var size = size_original * 1.2; $('#body_area').css({ 'font-size': size }); var is_chat = $("#tabs").tabs("option", "selected") == $('#tabs > ul > li > a').index($('[href="#chat_body"]')) ? true: false; var is_chat_square = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_square_body"]')) ? true: false; var is_chat_private = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')) ? true: false; var is_chat_content = ($("#chatting_list").attr('clientHeight') <= 1); if (!Browser.isIE) { if (is_chat && is_chat_square) { myScroll.refresh(); myScroll.scrollToElement('.view_message:last-child', 100) } if (is_chat && is_chat_private && is_chat_content) { myScroll_private.refresh(); myScroll_private.scrollToElement('.view_message:last-child', 100) } } else { if (is_chat && is_chat_square) { var aaa = document.getElementById('wrapper'); aaa.scrollTop = aaa.scrollHeight } if (is_chat && is_chat_private && is_chat_content) { var aaa = document.getElementById('wrapper_private'); aaa.scrollTop = aaa.scrollHeight } } }, function () { $('#body_area').css({ 'font-size': '' }); var is_chat = $("#tabs").tabs("option", "selected") == $('#tabs > ul > li > a').index($('[href="#chat_body"]')) ? true: false; var is_chat_square = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_square_body"]')) ? true: false; var is_chat_private = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')) ? true: false; var is_chat_content = ($("#chatting_list").attr('clientHeight') <= 1); if (!Browser.isIE) { if (is_chat && is_chat_square) { myScroll.refresh(); myScroll.scrollToElement('.view_message:last-child', 100) } if (is_chat && is_chat_private && is_chat_content) { myScroll_private.refresh(); myScroll_private.scrollToElement('.view_message:last-child', 100) } } else { if (is_chat && is_chat_square) { var aaa = document.getElementById('wrapper'); aaa.scrollTop = aaa.scrollHeight } if (is_chat && is_chat_private && is_chat_content) { var aaa = document.getElementById('wrapper_private'); aaa.scrollTop = aaa.scrollHeight } } }); $("#btn_login").bind("click", function () { if (!$("#username").val() || !$("#passwd").val()) { alert("Enter Username or Password!") } else { login() } }); $("#check_chatting_list_heading").live("click", function () { if ($(this).is(":checked")) { $("#private_chatting_list_sub :checkbox").attr("checked", true) } else { $("#private_chatting_list_sub :checkbox").attr("checked", false) } }); $("#edit_chatting_list").live("click", function () { $(".td_private_chat_list_del").css({ 'display': '' }); $("#del_chatting_list").css({ 'display': '' }); $("#edit_chatting_list").css({ 'display': 'none' }) }); /* 선택된 채팅목록 한꺼번에 삭제 */ $("#del_chatting_list").live("click", function () { if ($("#private_chatting_list_sub :checkbox:checked").length) { var yes = confirm(m_confirm_delete); if (yes == true) { $("#private_chatting_list_sub :checkbox:checked").each(function (index, element) { var no = $(this).parents('.private_chat_list').attr('no'); var channel = $(this).parents('[no=' + no + ']').attr('for_channel_name'); if ($("#chatting_content").attr('kmj') == channel) { $("#chatting_content span[id=title]").text(''); $("#chatting_content span[id=bullet]").attr("login_status", '0').html("
"; str += ""; str += ""; //str += ""; str += "
"; str += "
"; str += $("#ad_body .supporters").clone().wrapAll("
").parent().html(); str += "
"; str += $("#ad_body .duty_helpers").clone().wrapAll("
").parent().html(); str += "
"; $("#info_maegu1").html(str); $("#info_maegu1").css({'text-align':'center'}); pop_window_size(); $("#info_maegu1").dialog({ title: str_donate_invest, resizable: true, modal: true, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#info_maegu1").dialog("open"); }) $("#maegu_info").bind("click", function () {//footer.php의 "maegu.com" 클릭시 회사 정보 띄움 /* 출력창 변수 시작 */ //var title = $("#"+ $(this).attr("for1") + " .title").html();//창 제목줄에 나타낼 광고 문구 var title = $("#info_menu2").siblings("legend").html();//창 제목줄에 나타낼 광고 문구 //$("#"+ $(this).attr("for1") + " .title").css("display","none"); /* 출력창 변수 끝 */ var str = $("#info_menu2").clone().wrapAll("
").parent().html(); $("#info_maegu").html(str); pop_window_size(); $("#info_maegu").dialog({ title: title, resizable: true, modal: true, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#info_maegu").dialog("open"); }) $(".info_menu_list").live("click", function () {//info_body.php안의 매구 관련 리스트 클릭시 창 띄움 /* 출력창 변수 시작 */ var title = $("#"+ $(this).attr("for1") + " .title").html();//창 제목줄에 나타낼 광고 문구 $("#"+ $(this).attr("for1") + " .title").css("display","none"); /* 출력창 변수 끝 */ var str1 = $("#" + $(this).attr("for1")).html(); var str = $(str1).clone().wrapAll("
").parent().html(); $("#info_maegu").html(str); pop_window_size(); $("#info_maegu").dialog({ title: title, resizable: true, modal: true, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); /* if(what == 'invest_maegu') { setTimeout(function() { $("#btn_invest").trigger("click"); }, 2000); } else if(what == 'donate_maegu') { setTimeout(function() { $("#form_donate").submit(); }, 2000); } */ }, position: ['center', 'middle'] }); $("#info_maegu").dialog("open"); }) $(".btn_share").live("click", function () {//info_body.php안의 매구 관련 리스트 클릭시 창 띄움 var title = $("#share_message").html();//창 제목줄에 나타낼 광고 문구 //var str = $("#share_body").clone().wrapAll("
").parent().html(); //$("#share").html(str); $("#share").load("common/module/share_body.html",function( response, status, xhr ) { if ( status == "complete" ) { if(!flag_third_party_api) { Third_party_API(); } pc_mobile_view(); } }); $("#share legend").css("display","none"); pop_window_size(); $("#share").dialog({ title: title, resizable: true, modal: true, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#share").dialog("open"); }) $("#transition_language").bind("click", function () { if ($("#input_code").val() == 'auto') { var src1 = $("#input_code1").val() } else if ($("#input_code").val() == 'none') { var src1 = 'en' } else { var src1 = $("#input_code").val() } var dest1 = $("#src2").val(); var src1_comment = $(editor).val(); var dest1_comment = $(editor_trans).val(); $(editor).val(src1_comment); $(editor_trans).val(dest1_comment); $("#input_code").val(dest1); $("#src2").val(src1); if(virtualKeyboard) { var a = $(".vk:checkbox[lang='" + $('select#input_code').val() + "'][order='1']"); loadKeyboard(virtualKeyboard, a.val(), "0"); $("#display").html(a.attr('label')); a.attr("checked","checked"); } }); }//init_setting_common() //현재 위치 전송 function my_current_position() { $("#chat_body").addClass("loading_bar"); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition, handleError); } else { //alert("브라우저가 GeoLoatrion을 지원하지 않습니다."); alert("Not support GeoLoatrion"); return false; } } /* function google_map_init() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(40.730885,-73.997383); var mapOptions = { zoom: 8, center: latlng, mapTypeId: 'roadmap' } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } */ /* function codeLatLng(a,no,lat_long) {//채팅의 위도,경도값으로 주소 찾아서 출력해주는 함수 geocoder = new google.maps.Geocoder(); var latlngStr = lat_long.split(',', 2); var lat = parseFloat(latlngStr[0]); var lng = parseFloat(latlngStr[1]); var latlng = new google.maps.LatLng(lat, lng); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { $(a).find(".chat_address").html(results[1].formatted_address); } else { alert('No results found'); } } else { alert('Geocoder failed due to: ' + status); } }); } */ function showPosition(position) { var lat_long = position.coords.latitude + "," + position.coords.longitude; var user_status = ''; var is_chat = $("#tabs").tabs("option", "selected") == $('#tabs > ul > li > a').index($('[href="#chat_body"]')) ? true: false; var is_chat_square = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_square_body"]')) ? true: false; var is_chat_private = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')) ? true: false; var is_chat_content = ($("#chatting_list").attr('clientHeight') <= 1); if (is_chat && (is_chat_square || (is_chat_private && is_chat_content))) { if ($("#chat_chat_body #target_chat_user img").attr("login_status") == "0" && (is_chat && $("#chatting_content").css("display") == 'block')) { //상대방이 오프라인이면 '0' var user_status = '0' } var cmt = lat_long; var input_language = $("#" + $(selected_id).attr('for1')).val(); _write(cmt, input_language, user_status, 'map_current'); } } function handleError(e) { alert(e.mesage) } function update_profile(role, user) { client.core.request.send("update_profile", { role: role, update_user: user }) } function update_login_status_off() { $(".bullet_login_status").attr("login_status", '0').attr("src", login_status_off_image_path) } function update_login_status(username, login_status) { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, data: 'mode=update_login_status&username=' + username + '&login_status=' + login_status, type: 'post', success: function (content1) { var content = eval("(" + content1 + ")"); if (content.ok == 'true') {} } }) } function update_display_search_user() { var trigger_object = $("#search_users_criteria [name=search_users_main][value=" + select_search_classify + "]").attr('id'); $("#" + trigger_object).trigger("click") } function update_chatting_list() { if (cs_username) { var trigger_object = $("#search_users_criteria [name=search_users_main][value=" + select_search_classify + "]").attr('id'); $("#" + trigger_object).trigger("click"); display_friends('list'); display_private_chatting_list() } } function private_chat(reciever) { var sender = client.core.user.properties.username; if (sender > reciever) { var channel_name = "private_" + reciever + "_" + sender; } else { var channel_name = "private_" + sender + "_" + reciever; } client.core.join(channel_name); client.channel_maegu.request.send("private_chat_open", { 'channel': channel_name, 'sender': sender, 'reciever': reciever }) } function display_user_info(user_username) { /* 회원정보 출력창 변수 시작 */ var title = 'Please promote yourself!';//회원 정보창 제목줄에 나타낼 광고 문구 /* 회원정보 출력창 변수 끝 */ var requester_str = "mode=user_info&username=" + user_username + "&calluser="+cs_username; var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, data: requester_str, type: 'post', success: function (content1) { content = eval("(" + content1 + ")"); if (content.ok == 'true') { var user_username = content.username; var user_name = content.name; var user_english_name = content.english_name; var user_nationality = content.nationality; var user_country = content.country; var user_location = content.location; var user_language_flag_image = country_flag_url + content.language_flag_image; var language_code = content.language_code; var user_language = $("#input_code option[value='"+language_code+"'].lng_list").attr("language_name"); var user_nationality_flag_image = country_flag_url + content.nationality_flag_image; var user_tel_country_code = content.tel_country_code; var user_mobile = content.mobile; var user_email = content.email; var user_url = content.url; var user_introduce = autolink(content.introduce); var friend = content.friend; var profile_image = content.profile_image; if (profile_image == null || profile_image == '') { var profile_image_img = "" } else { var profile_image_img = "" } profile_image_img = "
" + profile_image_img + "
"; var contact_string = ''; var str_line1 = ''; if(user_tel_country_code == "") { user_mobile_code = user_mobile; user_mobile_code_label = user_mobile; } else { user_mobile_code = user_tel_country_code + user_mobile; user_mobile_code_label = "+" + user_tel_country_code + " " + user_mobile; } if (user_email) { str_line1 += "" + user_email + "
"; contact_string += "" + "" + " " } if (user_mobile) { if(mobile_device) { str_line1 += "" + user_mobile_code_label + "
"; contact_string += "" + "" + " "; contact_string += "" + "" + " " } else { str_line1 += "" + user_mobile_code_label + "
"; //contact_string += "" + "" + " "; } } if (user_url) { str_line1 += "" + user_url + "" + "  " + "" + "" + ""; contact_string += "" + "" + "" } var str = ''; str += "

"; str += "
" + profile_image_img; //str += "
"; //str += contact_string + "
"; str += user_english_name + "
"; str += "("+user_name+")"; str += "
"; str += "

"; str += "
" + m_username + ": " + user_username + "
"; str += m_language + " : "; str += ""; str += user_language + "
"; str += m_nationality + " : "; str += ""; str += " | " + user_nationality + "
"; str += m_location + " : "; str += ""; str += user_country + "" + " | "; str += ""; str += user_location + ""; str += "

"; str += "
" + str_line1 + "
"; str += "
 
"; if(user_introduce) { //str += "
- " + m_introduce_myself + " -
"; str += "
" + user_introduce + "
" } pop_window_size(); if (user_username == cs_username) { $("#user_info_me").html(str); $("#user_info_me").dialog({ title: title, modal: true, resizable: false, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Edit Profile": function () { $(this).dialog("close"); $("#btn_modify").trigger('click') }, "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#user_info_me").dialog("open"); } else { if (friend == '1') { $("#user_info_friend_1").html(str); $("#user_info_friend_1").dialog({ title: title, modal: true, resizable: true, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Friend[-]": function () { $(this).dialog("close"); friends_process("delete_friend", user_username) }, "Chat": function () { $(this).dialog("close"); private_chat(user_username) }, "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#user_info_friend_1").dialog("open"); } else { $("#user_info_friend_0").html(str); $("#user_info_friend_0").dialog({ title: title, modal: true, resizable: true, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Friend[+]": function () { $(this).dialog("close"); friends_process("plus_friend", user_username) }, "Chat": function () { $(this).dialog("close"); private_chat(user_username) }, "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }) $("#user_info_friend_0").dialog("open"); } } } else { alert('error'); return false } }, error: function (x, o, e) { alert(x.status + " : " + o + " : " + e) } }); } function nationality_define() { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/account_process.php?role=get_nationality_list&language='+Real_language+'&num_temp='+num_temp, type : 'post', //data:{role:'get_nationality_list',language:Real_language,num_temp:num_temp}, contentType:"text/plain;charset=utf-8", crossDomain: true, dataType:'jsonp', jsonpCallback:"nationality_callback", success: function (content1) { } }) } //국적 목록 출력 function nationality_callback(content1) { var select_search_nationality = $('#select_search_nationality'); var num = 0; var content = eval("(" + content1 + ")"); if (content.success_flag == 'true') { for (l in content.nationality) { var no = content.nationality[l].no; var code = content.nationality[l].maegu_country_code; var nationality = content.nationality[l].country_name; if(code != 'xxx') { num++; select_search_nationality.append("") } } } } function country_define() { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/account_process.php?role=get_country_list&language='+Real_language+'&num_temp='+num_temp, type : 'post', contentType:"text/plain;charset=utf-8", crossDomain: true, dataType:'jsonp', jsonpCallback:"nationality_callback", success: function (content1) { } }) if("") { nationality_define(); } } //거주지 목록 출력 function country_callback(content1) { var select_search_country = $('#select_search_country'); var tel_country = $('#f_tel_country_code'); tel_country.html(''); //tel_country.append(""); var num = 0; var content = eval("(" + content1 + ")"); if (content.success_flag == 'true') { for (l in content.country) { var no = content.country[l].no; var code = content.country[l].maegu_country_code; var country = content.country[l].country_name; var tel_country_code = content.country[l].tel_country_code; if(code != 'xxx') { num++; select_search_country.append("") if(tel_country_code != '') { tel_country.append(""); } } } $("#f_tel_country_code option[country_code='"+Real_country_code+"']").attr("selected",'selected'); } } function location_define(code) { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url :'common/account_process.php?role=get_location_list&language=' + Real_language + "&code=" + code + "&num_temp=" + num_temp, type: 'post', contentType:"text/plain;charset=utf-8", crossDomain: true, dataType:'jsonp', jsonpCallback:"location_callback", success: function (content1) { } }) } //거주지 상세 목록 출력 function location_callback(content1) { var select_search_location = $('#select_search_location'); select_search_location.html(''); var num = 0; var content = eval("(" + content1 + ")"); if (content.success_flag == 'true') { //select_search_location.append(""); if(Real_language == 'ko') { var m_multi_select = "복수 선택 가능"; var m_select = "선택"; } else { var m_multi_select = "Multi Select"; var m_select = "Select"; } select_search_location.append(""); for (l in content.location) { var no = content.location[l].no; var code = content.location[l].maegu_location_code; var location = content.location[l].location_name; num++; select_search_location.append("") } } } function init_search_users() { //$("#search_users_criteria #search_criteria_area").hide(); select_search_classify = 'online'; //$("#select_search_location_area").hide(); $("#select_search_location_area").css({"visibility":"hidden"}); $("#select_search_country").bind("change",function() { var num = $('#' + $(this).attr('id') + ' option:selected').length; var code = $(this).attr('value'); if(num != 1) { $("#select_search_location").attr("disabled","disabled"); $("#select_search_location_area").css({"visibility":"hidden"}); //$("#select_search_location_area").hide(); } else { $("#select_search_location").attr("disabled",""); $("#select_search_location_area").css({"visibility":"visible"}); //$("#select_search_location_area").show(); $("#count_4").text(0); location_define(code); } }); $("#display_online_users").bind("click", function () { $("#division_criteria_search_users").hide(); display_user('online'); }); $("#display_all_users").bind("click", function () { $("#division_criteria_search_users").hide(); display_user('all'); }); $("#view_detail_users").bind("click", function () { $("#division_criteria_search_users").show(); if($('#chat_criteria_users').hasClass("criteria_result_empty")) { //$("#display_detail_users").trigger("click"); $("#display_users").html($('#chat_criteria_users').html()); } else { $("#display_users").html($('#chat_criteria_users').html()); } }); $("#display_detail_users").bind("click", function () { pop_window_size(); $("#search_criteria_area").show(); $("#search_users_criteria").dialog({ title: m_modify_criteria, modal: true, width: window_new_width, //height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Reset": function () { $("#reset_search_users_criteria").trigger("click"); $("#select_search_location_area").css({"visibility":"hidden"}); }, "Find": function () { $(this).dialog("close"); $("#excute_search_users_criteria").trigger("click"); }, "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#search_users_criteria").dialog("open"); }); $("#display_sort_users").bind("click", function () { pop_window_size(); $("#search_users_sort").dialog({ title: m_modify_sort, modal: true, width: window_new_width }); $("#search_users_sort").dialog("open"); }); $("#search_users_criteria [name=search_users_main]").bind("click", function () { select_search_classify = $(this).val(); $("#search_users_etc").val('');// (이메일, 아이디, 폰번호로) 회원 찾기 입력 상자에 빈 값 세팅 if (select_search_classify == 'total') { $("#search_criteria_area").hide(); $("#display_users").html(''); display_user(); $("#search_users_criteria").dialog("close") } else if (select_search_classify == 'online') { $("#search_criteria_area").hide(); $("#display_users").html(''); display_user('online'); $("#search_users_criteria").dialog("close") } else if (select_search_classify == 'criteria') { $("#search_criteria_area").show(); //display_user('criteria', $("#form_search_criteria_area").serialize()) } }); // 아이디, 메일, 폰번호로 특정 회원 찾기 // $("#btn_search_users").bind("click", function () { $("#display_users").html(''); if ($("#search_users_etc").val()) { display_user('etc', $("#search_users_etc").serialize()) } }); // 회원 찾기(상세) // $("#form_search_criteria_area select").each(function (index) { $('#' + $(this).attr('id')).find('option').live("click", function () { var num = $('#' + $(this).parent().attr('id') + ' option:selected').length; $("#count_" + (index + 1)).html(num) }); $('#' + $(this).attr('id')).live("change", function () { var num = $('#' + $(this).attr('id') + ' option:selected').length; $("#count_" + (index + 1)).html(num) }) }); $("#reset_search_users_criteria").bind("click", function () { $("#form_search_criteria_area").each(function () { this.reset(); $(".criteria_count").text('0'); //display_user('criteria', $("#form_search_criteria_area").serialize()) }) }); $("#excute_search_users_criteria").bind("click", function () { $("#search_users_etc").val(''); display_user('criteria', $("#form_search_criteria_area").serialize()); //$("#search_users_criteria").dialog("close") }); }//init_search_users() /* 회원 정보 출력 */ function display_user(classify, value) { if (classify == 'etc' || classify == 'criteria') { var value = decodeURIComponent(value); var requester_str = "mode=user_display&classify=" + classify + "&" + value; //alert(value); display_user_routine(requester_str, classify); } else if (classify == 'online') { //$("#display_users").html(''); $("#display_users").html($('#chat_logined_body #users').html()); } else if (classify == 'all') { var requester_str = "mode=user_display"; display_user_routine(requester_str, 'all'); } } function set_users_routine(division) { if(Real_language == 'ko') { var str_profile = '프로필'; } else { var str_profile = 'Profile'; } var str_heading = ''; str_heading += "" + " " + ""; str_heading += "" + str_profile + "";; str_heading += ""; str_heading += m_eng_name; str_heading += "
" + m_name; str_heading += ""; str_heading += ""; str_heading += m_nationality; str_heading += "
" + m_language; str_heading += ""; str_heading += ""; str_heading += m_location; //str_heading += "
" + m_location_detail; str_heading += ""; return str_heading; } function add_users_list(content,list_classify) { var ms = 60; var hs = ms * 60; var ds = hs * 24; var current_date = new Date().getTime()/1000; var regist_date = new Date(content.regist_date.replace(/-/g, '/')).getTime()/1000; var elapsed_day = Math.round((current_date - regist_date)/ds);//가입일로부터 경과 날짜 if(elapsed_day <= 1) { var new_user_image = 'new_user_image '; var new_user = 'new_user '; } else { var new_user_image = ''; var new_user = ''; } var line_comment = ''; var str = ''; var str_me = ''; var no = content.no; var notification_value = content.notification_value; if (notification_value == 0) { notification_value = ''; } var login_status = content.login_status; var profile_image = content.profile_image; var channel = content.channel; if(list_classify == 'chatting_list') { var opponent = content.opponent; } else { var opponent = content.username; } var name = content.name; var english_name = content.english_name; var language_code = content.language_code; var own_language = $("#input_code option[value='"+language_code+"'].lng_list").attr("language_name"); own_language = "" + own_language + ""; var country = content.country; country = "" + country + ""; var location = content.location; location = "" + location + ""; var nationality = content.nationality; nationality1 = "" + nationality + ""; var nationality_flag_image = "" +""; if (profile_image == null || profile_image == '') { var profile_image_img = "" } else { var profile_image_img = "" } if ($('#chat_logined_body #users #online_users' + ' [on_id="users-' + opponent+'"]').html()) { var login_status_img = "" } else { var login_status_img = "" } if(opponent == cs_username) { var user_me = 'user_me'; } else { var user_me = ''; } line_comment += ""; if(list_classify=='chatting_list') { line_comment += "" + "" + notification_value + "" + ""; } line_comment += "" + login_status_img + ""; line_comment += ""; line_comment += "
" + profile_image_img + "
"; line_comment += ""; line_comment += ""; line_comment += ""; line_comment += "
" + "" + english_name + "" + "
"; line_comment += "
" + "" + name + "" + "
"; line_comment += "
"; line_comment += ""; line_comment += ""; line_comment += "
" + nationality_flag_image + "
"; line_comment += "
" + "" + own_language + "" + "
"; line_comment += ""; line_comment += ""; line_comment += "
" + "" + country + "
" + location + "
" + "
"; line_comment += ""; if(list_classify == 'chatting_list') { line_comment += ""; line_comment += "" + "" + ""; line_comment += "  "; line_comment += "" + "" + ""; line_comment += ""; } line_comment += ""; return line_comment; } function chatting_list_process(classify,requester_str, channel) { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, type: 'post', data: requester_str, success: function (content1) { content = eval("(" + content1 + ")"); if (content.ok == 'true') { if (content.new_notification_value) { $(".private_chat_list[for_channel_name=" + channel + "] [notify=check_notify]").text(content.new_notification_value); return false } if(classify != 'update_notification_value') { display_private_chatting_list(); } } $("#del_chatting_list").css({ 'display': 'none' }); $("#edit_chatting_list").css({ 'display': '' }) } }) } // 채팅리스트 // function display_private_chatting_list() { $("#chat_body").addClass("loading"); var requester_str = "mode=private_chatting_list&classify=get_list&username=" + cs_username; var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, data: requester_str, type: 'post', success: function (content1) { content = eval("(" + content1 + ")"); if (content.ok == 'true') { var line_comment = ''; line_comment += ""; line_comment += ""; line_comment += ""; line_comment += set_users_routine(); line_comment += ""; line_comment += ""; var num = content.contents.length; for (var i = 0; i < num; i++) { line_comment += add_users_list(content.contents[i],'chatting_list'); } line_comment += "
 
"; $("#chatting_list_sub").html(line_comment); pc_mobile_view(); $("#chat_body").removeClass("loading"); } $("#private_chatting_list_sub .user_me").insertAfter("#private_chatting_list_sub .heading"); } }) } // 친구 목록 // function display_friends(classify) { var str = ''; $("#chat_body").addClass("loading"); if (classify == 'list') { var requester_str = "mode=friends&classify=" + classify + "&username="+cs_username; } var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, type: 'post', data: requester_str, success: function (content1) { content = eval("(" + content1 + ")"); var num = content.contents.length; var str_heading = ""; var str_total = ""; str_heading += ""; str_heading += ""; str_heading += ""; str_heading += set_users_routine(); str_heading += ""; for (var i = 0; i < num; i++) { str += add_users_list(content.contents[i],'friend_list'); } str_total = str_heading + str; str_total += "
" + m_friend_members + " : " + num + "
"; //$("#chat_friends_body").html(''); $("#chat_friends_body").html(str_total); pc_mobile_view(); $("#chat_body").removeClass("loading"); } }) } function friends_process(classify, username) { var requester_str = "mode=friends&classify=" + classify + "&username=" + username + "&calluser="+cs_username; var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, type: 'post', data: requester_str, success: function (content1) { content = eval("(" + content1 + ")"); if (content.ok == 'true') { display_friends('list'); return false; } } }) } //회원 찾기 출력// function display_user_routine(requester_str, classify) { $("#chat_body").addClass("loading"); if (classify == 'etc' || classify == 'criteria') { var prefix = m_result + " " } else if (classify == 'all') { var prefix = m_all + " " } var num_temp = Math.ceil(Math.random() * 10000); var str = ''; $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, type: 'post', data: requester_str, success: function (content1) { content = eval("(" + content1 + ")"); var num = content.contents.length; var str_heading = ""; var str_total = ""; str_heading += ""; if(classify == 'all' || classify == 'criteria') { if('') { str_heading += ""; } else { str_heading += ""; } } else { str_heading += ""; } str_heading += ""; str_heading += set_users_routine(); str_heading += ""; for (var i = 0; i < num; i++) { str += add_users_list(content.contents[i],'search_users'); } str_total = str_heading + str; str_total += "
" + prefix + m_members + " : " + num + "
" + prefix + m_members + "
" + prefix + m_members + " : " + num + "
"; if(classify=='etc' || classify=='criteria') { if(num <= 0) { $("#chat_criteria_users").hasClass('criteria_result_empty'); } else { $("#chat_criteria_users").removeClass('criteria_result_empty'); } $("#display_users").html(str_total); $("#chat_criteria_users").html(str_total); } else { $("#display_users").html(str_total); } pc_mobile_view(); $("#chat_body").removeClass("loading"); } }) } function display_chat(classify, channel, position, doing, no) { $("#chat_body").addClass("loading"); if (classify == 'whole') { var current_chat_area = "chat_square_body"; } else if (classify == 'private') { var current_chat_area = "chat_chat_body"; $("#chat_chat_body").css({ 'overflow': 'hidden' }) } if ($("#" + current_chat_area + " .check_original").is(":checked")) { var var_message_original = 'original_display_on' } else { var var_message_original = 'original_display_off' } var view_code = $("#view_code").val(); var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php', data: {'mode':'display_chat', 'chat_trans_flag':chat_trans_flag, 'num_temp':num_temp, 'calluser':cs_username, 'view_code':view_code, 'channel':channel, 'classify':classify, 'doing':doing, 'no':no }, type: 'post', success: function (content1) { var content = eval("(" + content1 + ")"); if (content.ok == 'true') { var return_value = ''; var line_comment = ''; if (position == 'p') { for (l = content.contents.length - 1; l >= 0; l--) { var return_value = display_chat_routine(var_message_original, content.contents[l], position); line_comment = $(return_value.str); var a = line_comment.prependTo('#' + current_chat_area + ' .comment'); /* if(content.contents[l].m_classify == 'map_current') { codeLatLng(a,content.contents[l].no,content.contents[l].message_original); } */ } } else if (position == 'n') { for (l = 0; l < content.contents.length; l++) { var return_value = display_chat_routine(var_message_original, content.contents[l], position); line_comment = $(return_value.str); var a = line_comment.appendTo('#' + current_chat_area + ' .comment'); /* if(content.contents[l].m_classify == 'map_current') { codeLatLng(a,content.contents[l].no,content.contents[l].message_original); } */ } } else if (position == '') { for (l = 0; l < content.contents.length; l++) { var return_value = display_chat_routine(var_message_original, content.contents[l], position); line_comment = $(return_value.str); var a = line_comment.appendTo('#' + current_chat_area + ' .comment'); /* if(content.contents[l].m_classify == 'map_current') { codeLatLng(a,content.contents[l].no,content.contents[l].message_original); } */ } } } }, complete: function (e) { if (classify == 'whole') { //$("#chat_square_body").find(".loading_data").empty(); if (!Browser.isIE) { myScroll.refresh(); if (position == 'p') { myScroll.scrollToElement('.view_message:first-child', 100); } else if (position == 'n' || position == '') { //myScroll.scrollToElement('.view_message:last-child', 100); myScroll.scrollToPage(1, 10000000000, 100); } } else {//IE var aaa = document.getElementById('wrapper'); if (position == 'p') { aaa.scrollTop = 0; } else if (position == 'n' || position == '') { aaa.scrollTop = aaa.scrollHeight; } } } else if (classify == 'private') { //$("#chat_chat_body").find(".loading_data").empty(); if (!Browser.isIE) { myScroll_private.refresh(); if (position == 'p') { myScroll_private.scrollToElement('.view_message:first-child', 100); } else if (position == 'n' || position == '') { //myScroll_private.scrollToElement('.view_message:last-child', 100); myScroll_private.scrollToPage(1, 10000000000, 100); } } else {//IE var aaa = document.getElementById('wrapper_private'); if (position == 'p') { aaa.scrollTop = 0; } else if (position == 'n' || position == '') { aaa.scrollTop = aaa.scrollHeight; } } } $("#chat_body").removeClass("loading"); }, error: function (x, o, e) { alert(x.status + " : " + o + " : " + e) } }) } function display_chat_routine(var_message_original, content, position) { var ms = 60; var hs = ms * 60; var ds = hs * 24; var current_date = new Date().getTime()/1000; var regist_date = new Date(content.regist_date.replace(/-/g, '/')).getTime()/1000; var elapsed_day = Math.round((current_date - regist_date)/ds);//가입일로부터 경과 날짜 if(elapsed_day <= 1) { var new_user_image = 'new_user_image '; var new_user = 'new_user '; } else { var new_user_image = ''; var new_user = ''; } var str = ''; var no = content.no; var login_status = content.login_status; var username = content.username; var name = content.name; var english_name = content.english_name; var m_classify = content.m_classify; var message_original = decodeURIComponent(content.message_original); var message_en = decodeURIComponent(content.message_en); var message_view = decodeURIComponent(content.message_view); var input_code = content.input_code; var input_language_flag_image = country_flag_url + content.input_language_flag_image; var input_language_name_en = content.input_language_name_en; //var input_language_name = content.input_language_name; var input_language_name = $("#input_code option[value='"+input_code+"'].lng_list").attr("language_name"); var en_code = content.en_code; var view_code = content.view_code; var user_language_code = content.language_code; //var user_language = content.language; //var user_language = $("#input_code option[value='"+user_language_code+"'].lng_list").attr("language_name"); var user_language = ""; var user_location = content.location; var user_nationality = content.nationality; var user_nationality_flag_image = country_flag_url + content.nationality_flag_image; var user_status = content.user_status; if (user_status == '0') { var user_status_image = "" } else { var user_status_image = "" } if ($('#online_users' + ' [on_id="users-' + username+'"]').html()) { var login_status_img = "" } else { var login_status_img = "" } var profile_image = content.profile_image; if (profile_image == null || profile_image == '') { var profile_image_img = "" } else { var profile_image_img = "" } var flag_str = ""; flag_str += " "; //flag_str += elapsed_day + " "; //flag_str += ""; //flag_str += "" + user_language + ""; var writtentime = new Date(content.writtentime.replace(/-/g, '/')); var year = writtentime.getFullYear(); var month = writtentime.getMonth() + 1; var date = writtentime.getDate(); var hours = (writtentime.getHours() < 12) ? writtentime.getHours() : writtentime.getHours() - 12; if (hours == 0) { hours = 12 } var ampm = (writtentime.getHours() < 12) ? "am": "pm"; if(Real_language == 'ko') { ampm = (ampm == 'am') ? '오전' : '오후'; //var display_date = year + "/" + month + "/" + date + "  [" + hours + ":" + writtentime.getMinutes() + ":" + writtentime.getSeconds() + " " + ampm + "]"; var display_date = year + "/" + month + "/" + date + "  " + ampm + " " + hours + ":" + fillzero(writtentime.getMinutes(),2); } else { //var display_date = year + "/" + month + "/" + date + "  [" + hours + ":" + writtentime.getMinutes() + ":" + writtentime.getSeconds() + " " + ampm + "]"; var display_date = year + "/" + month + "/" + date + "  " + hours + ":" + fillzero(writtentime.getMinutes(),2) + " " + ampm; } if (username == cs_username) { str += "
"; str += "
"; str += "
"; str += user_status_image + " " + "" + display_date + "
"; switch (m_classify) { case null: case "": str += "" + "" + "" + "  " + autolink(message_original); str += "
 (" + input_language_name + ")"; str += "
"; break; case "map_current": var array_lat_long = message_original.split(","); var latitude = Math.floor(array_lat_long[0] * 10000) / 10000; var longitude = Math.floor(array_lat_long[1] * 10000) / 10000; str += ""; str += "" + " " + m_current_location + "
"; str += m_current_latlng + " : (" + latitude + "/" + longitude + ")"+"
"; str += ""; str += "
"; str += "
"; $("#chat_body").removeClass("loading_bar"); break } } else { str += "
"; str += profile_image_img; str += "
"; str += login_status_img; str += " " + flag_str + " " + "" + english_name + " (" + name + ")" + " "; str += "
"; str += "" + display_date + " " + user_status_image + "
"; switch (m_classify) { case null: case "": if(chat_trans_flag != 'true') { str += "" + "  " } str += "" + "" + "" + "  " + autolink(message_view); if(chat_trans_flag != 'true') { str += " (" + input_language_name + ")"; } if(chat_trans_flag == 'true') { str += "
"; str += "" + "" + "" + "  " + autolink(message_original) + " (" + input_language_name + ")
"; } str += "
"; break; case "map_current": var array_lat_long = message_original.split(","); var latitude = Math.floor(array_lat_long[0] * 10000) / 10000; var longitude = Math.floor(array_lat_long[1] * 10000) / 10000; str += ""; str += "" + " " + m_current_location + "
"; str += m_current_latlng + " : (" + latitude + "/" + longitude + ")"+"
"; str += ""; str += "
"; str += "
"; break } } var return_value = { no: no, m_classify: m_classify, username: username, view_code: view_code, message_original: message_original, message_view: message_view, str: str }; var return_value = eval("(return_value)"); return return_value; } function get_address(latlng, no, classify, position) { $.ajax({ url: "http://maps.googleapis.com/maps/api/geocode/json?latlng=" + latlng + "&sensor=true&language=" + Real_language, type: 'post', success: function (content) { if (content.status == 'OK') { $("#address_" + no).text(content.results[0].formatted_address); if (classify == 'whole') { if (!Browser.isIE) { myScroll.refresh(); if (position == 'p') { myScroll.scrollToElement('.view_message:first-child', 100) } else if (position == 'n' || position == '') { myScroll.scrollToElement('.view_message:last-child', 100) } } else { var aaa = document.getElementById('wrapper'); if (position == 'p') { aaa.scrollTop = 0 } else if (position == 'n' || position == '') { aaa.scrollTop = aaa.scrollHeight } } } else if (classify == 'private') { if (!Browser.isIE) { myScroll_private.refresh(); if (position == 'p') { myScroll_private.scrollToElement('.view_message:first-child', 100) } else if (position == 'n' || position == '') { myScroll_private.scrollToElement('.view_message:last-child', 100) } } else { var aaa = document.getElementById('wrapper_private'); if (position == 'p') { aaa.scrollTop = 0 } else if (position == 'n' || position == '') { aaa.scrollTop = aaa.scrollHeight } } } } } }) } function trans_language() { m_member_error_display = $("#m_member_error_display").html(); m_current_location = $("#m_current_location").html(); m_current_latlng = $("#m_current_latlng").html(); m_modify_sort = $("#m_modify_sort").html(); m_modify_criteria = $("#m_modify_criteria").html(); m_friend_members = $("#m_friend_members").html(); m_result = $("#m_result").html(); m_all = $("#m_all").html(); m_members = $("#m_members").html(); m_username = $("#m_username").html(); m_eng_name = $("#m_eng_name").html(); m_name = $("#m_name").html(); m_nation = $("#m_nation").html(); m_nationality = $("#m_nationality").html(); m_language = $("#m_language").html(); m_location = $("#m_location").html(); m_location_detail = $("#m_location_detail").html(); m_mobile = $("#m_mobile").html(); m_email = $("#m_email").html(); m_confirm_delete = $("#m_confirm_delete").html(); m_dont_send_message = $("#m_dont_send_message").html(); //m_introduce_myself = $("#m_introduce_myself").html(); } function tab_load() { obj_tabs = $("#tabs").tabs({ spinner: 'Retrieving...', event: "click", ajaxOptions: { error: function (xhr, status, index, anchor) { $(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible.").css({ 'color': 'red', 'text-align': 'center', 'vertical-align': 'middle' }) } } }, { selected: $('#tabs > ul > li > a').index($('[href="#search_body"]')) }); selected = $("#tabs").tabs("option", "selected"); $($('#tabs ul li:eq(' + selected + ') a').attr('href')).show(); obj_tabs_chat = $("#chat_body").tabs({ spinner: 'Retrieving...', event: "click", ajaxOptions: { error: function (xhr, status, index, anchor) { $(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible.").css({ 'color': 'red', 'text-align': 'center', 'vertical-align': 'middle' }) } } }, { selected: $('#chat_body > ul > li > a').index($('[href="#chat_square_body"]')) }); $('#chat_body,#search_tabs.#display_all_users,#display_online_users').bind('tabsselect', function (event, ui) { $(".icon-set").css('width',''); $(".icon-sub_menu").css('width',''); }) $('#tabs').bind('tabsselect', function (event, ui) { ui.tab.style.backgroundColor = '';//선택된 텝의 배경색 ui.panel.style.backgroundColor = 'white';//선택된 텝에 종속된 영역의 배경색 ui.panel.style.display = 'block'; //selected = $("#tabs").tabs("option", "selected"); //$('#line_ad_area').hide(); //clearTimeout(timer_ad); //clearTimeout(timer_search); $('#input_code option[value="auto"]').attr("disabled", ui.panel.id == 'chat_body'); if (ui.panel.id == 'chat_body') { css_chatting(); if (!cs_username || cs_level != '1') { member_error_display(); return false } if ($("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_square_body"]'))) { count_chat_square_display = count_chat_square_display + 1; if (count_chat_square_display <= 1) { //$("#chat_square_body").find(".loading_data").html("loading"); display_chat('whole', 'maegu_chat', '', '', '') } } } else if (ui.panel.id == 'info_body' || ui.panel.id == 'loginoff_body' || ui.panel.id == 'sns_body' || ui.panel.id == 'ad_body' || ui.panel.id == 'map_body' || ui.panel.id == 'search_body') { css_normal(); if ($('#input_code').val() == 'auto') { $('#input_code').val(Real_language); } } if (ui.panel.id == 'sns_body') { if(first_app_flag == 0) { first_app_flag = 1; $("#sns_body").load("app_load.html"); } } if (ui.panel.id == 'search_body') { } /* if (ui.panel.id == 'loginoff_body') { modify_profile_js_flag++; if(modify_profile_js_flag <= 1) { $.getScript("common/modify_profile.js", function () { profile_image_load_setting(); },true); } } */ if (ui.panel.id == 'ad_body') { $('.line_ad_area').show(); //ad_read_routine(pr_classify); //timer_ad = setInterval("ad_read_routine("+pr_classify+")", 2000) } if (ui.panel.id == 'info_body') { if(!flag_third_party_api) { Third_party_API(); } } }); $('#chat_body').bind('tabsselect', function (event, ui) { if (ui.panel.id == 'chat_square_body') { $(".get_recent_data").trigger("click"); count_chat_square_display = count_chat_square_display + 1; if (count_chat_square_display <= 1) { //$("#chat_square_body").find(".loading_data").html("loading"); display_chat('whole', 'maegu_chat', '', '', '') } } if (ui.panel.id == 'chat_chat_body') {//alert($('#chatting_list').is(":visible")); $(".get_recent_data").trigger("click"); //$("#chat_chat").html("▼"); $("#chat_chat").bind("click", function () { if($("#target_chat_user").html()) {//개인채팅창 하나라도 접그된 것이 있으면... $("div.sub_chat").toggle("slow"); } if ($("#chatting_list").attr('clientHeight') <= 1) { $("#chat_chat_body").css({ 'overflow-x': 'hidden', 'overflow-y': 'auto' }) } else { $("#chat_chat_body").css({ 'overflow': 'hidden' }) } }) } else { //$("#chat_chat").html("▼"); $("#chat_chat").unbind("click") } }) } function activateSending() { $(editor + "," + editor_trans + "," + trans_verify).bind("keypress", function (event) { var user_status = ''; var id = $(this).attr('id'); input_language = $("#" + $("#" + id).attr("for1")).val(); var is_chat = $("#tabs").tabs("option", "selected") == $('#tabs > ul > li > a').index($('[href="#chat_body"]')) ? true: false; var is_chat_square = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_square_body"]')) ? true: false; var is_chat_private = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')) ? true: false; var is_chat_content = ($("#chatting_list").attr('clientHeight') <= 1); if (event.keyCode == 13 && is_chat && (is_chat_square || (is_chat_private && $("#chatting_content").css("display") == 'block'))) { if ($("#chat_chat_body #target_chat_user img").attr("login_status") == "0" && (is_chat_content)) { var user_status = '0' } _write($(this).val(), input_language, user_status, ""); } }) } function login() { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: protocol_ssl_maegu+"common/login/login_ajax.php?num_temp=" + num_temp, type: 'post', data: $("#notlogin1").serialize(), success: function (content) { if (content == 'false') { alert("Error Username or Password!") } else { //return false; location.reload(); } } }) } function logout() { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: "common/login/logout_ajax.php?num_temp=" + num_temp, type: 'post', //data: $("#login1").serialize(), //data: {sess_key:''}, success: function (content) { if (content == 'true') { client.core.request.send("LOGOUT", { type: 'name', value: cs_ape_username }) } } }) } /* function login() { var num_temp = Math.ceil(Math.random() * 10000); var url = protocol_ssl_maegu+"common/login/login_ajax.php?num_temp=" + num_temp + $("#notlogin1").serialize(); $.getJSON(url+"&callback=?",function(content) { if (content.ok == 'false') { alert("Error Username or Password!") } else if(content.ok == 'true'){ location.reload(); } }); } function logout() { var num_temp = Math.ceil(Math.random() * 10000); var url = protocol_ssl_maegu+"common/login/logout_ajax.php?num_temp="+num_temp; $.getJSON(url+"&callback=?",function(content) { if (content.ok == 'true') { client.core.request.send("LOGOUT", { type: 'name', value: cs_ape_username }) } else { return false; } }) } */ function ChkLen(a) { msg = a; var pos; var msglen = 0; var len = msg.length; for (i = 0; i < len; i++) { pos = msg.charAt(i); if (escape(pos).length > 4) msglen += 2; else msglen++ } return msglen } function signup() { signup_window = $.window({ showModal: true, modalOpacity: 0.1, minimizable: false, maximizable: false, bookmarkable: false, scrollable: false, resizable: false, icon: "auto", title: "Sign Up", url: "sign_up_form.html", x: 0, y: 0, width: 250, height: 400 }) } //위치검색// function search_place() { var language = Real_language; var word = trans_item_selection(); var word1 = escape(encodeURIComponent(word)); $("#aaa").attr("name", "language").attr("value", language); $("#bbb").attr("name", "keyword").attr("value", word); var a = $("#searchmap"); var ccc = "language=" + language + "&keyword=" + word; var url = "common/map/map/index.html?" + ccc; a.attr("target", '_blank').attr("action", url).submit() } function world_travel() { var language = Real_language; var ccc = "language=" + language + "&latitude=" + 37.5652 + "&longitude=" + 126.9896; var url = "common/map/country_flag.html?" + ccc; window.open(url,"_blank"); //var a = $("#searchmap"); //a.attr("target", '_blank').attr("action", url).submit() } function map_directions(classify) { var language = Real_language; var word = trans_item_selection(); var word1 = escape(encodeURIComponent(word)); if (classify == 'naver') { if (word == "") { var url = "http://map.naver.com" } else { var ccc = "query=" + word; var url = "http://map.naver.com?" + ccc } var a = $("#searchmap"); a.attr("target", '_blank').attr("action", url).submit() } else if (classify == 'google') { if (word == "") { ccc = "hl=" + language + "®ion=KR"; } else { var ccc = "hl=" + language + "&q=" + word + "®ion=KR"; } var url = "https://maps.google.co.kr/maps?" + ccc; window.open(url,"_blank"); } } function map_service_maegu(classify,address) {//매구 주소 화면창 띄우기 var language = Real_language; var word = address; //var word1 = escape(encodeURIComponent(word)); if (classify == 'naver') { var ccc = "query=" + word; var url = "http://map.naver.com?" + ccc } else if (classify == 'google') { var ccc = "hl=" + language + "&q=" + word + "®ion=KR"; var url = "https://maps.google.co.kr/maps?" + ccc } window.open(url,"_blank"); //var a = $("#searchmap"); //a.attr("target", '_blank').attr("action", url).submit(); } function directions1() { var language = Real_language; var word = trans_item_selection(); var word1 = escape(encodeURIComponent(word)); $("#aaa").attr("name", "language").attr("value", language); $("#bbb").attr("name", "q").attr("value", word); var a = $("#searchmap"); var ccc = "&language=" + language + "&q=" + word; var url = "common/map/directions-optimized.html?" + ccc; a.attr("target", '_blank').attr("action", url).submit() } function directions2() { var language = Real_language; var word = trans_item_selection(); var word1 = escape(encodeURIComponent(word)); $("#aaa").attr("name", "language").attr("value", language); $("#bbb").attr("name", "q").attr("value", word); var a = $("#searchmap"); var ccc = a.serialize(); var url = "common/map/directions-demo.html?" + ccc; var ccc = "&language=" + language + "&q=" + word; var url = "common/map/directions-demo.html?" + ccc; a.attr("target", '_blank').attr("action", url).submit() } function search_twitters() { var language = Real_language; var word = trans_item_selection(); var word1 = escape(encodeURIComponent(word)); //var word1 = word; var ccc = "language=" + language + "&keyword=" + word; var url = "common/map/twitter_search.html?" + ccc; window.open(url, "wtitter_search"); } function map_service_6_1() { var language = Real_language; var word = trans_item_selection(); var word1 = escape(encodeURIComponent(word)); $("#aaa").attr("name", "language").attr("value", language); $("#bbb").attr("name", "keyword").attr("value", word); var keyword_1 = ""; var a = $("#searchmap"); var ccc = a.serialize() + "&keyword_1=" + keyword_1; var url = "common/map/twitter_search.html?" + ccc; map_window1 = $.window({ showModal: true, modalOpacity: 0.1, minimizable: false, maximizable: false, bookmarkable: false, scrollable: false, resizable: false, icon: "auto", title: "MaeGu Search Twitter", url: url, x: 0, y: 0, width: 800, height: 650 }) } function display_lat_lng() { var language = Real_language; var word = trans_item_selection(); var word1 = escape(encodeURIComponent(word)); $("#aaa").attr("name", "language").attr("value", language); $("#bbb").attr("name", "keyword").attr("value", word); var keyword_1 = ""; var a = $("#searchmap"); var ccc = "&language=" + language + "&keyword=" + word + "&keyword_1=" + keyword_1; var url = "common/map/map1/Lat_Lng.html?" + ccc; a.attr("target", '_blank').attr("action", url).submit() } function send_sms(selected_id) { var content = $(selected_id).val(); var a = ChkLen($(selected_id).val()); if (a > 80) { alert("보낼 내용이" + a + "자로,\n80자를 넘었습니다.\n수정해주세요!"); return false } document.forms.MsgForm.strData.value = content; $("#send_sms_ad").dialog({ 'title': 'MaeGu LBS ad beta' }) } function doSubmit(a, url) { if (/MSIE/.test(navigator.userAgent)) { document.charset = 'euc-kr' } a.attr("accept-charset", "euc-kr"); a.attr("action", url).submit() } function convert_charset(source,target,text,url_q) { $.ajax({ url: 'common/search.php', data: 'mode=convert_charset&source='+source+'&target=' + target + "&text="+text, type: 'post', success: function (contents) { var content = eval("(" + contents + ")"); if (content.ok) {//alert(content); //return content; window.open(url_q+content.text, "_blank"); } } }) } function doSubmit_charset(a, charset, url,win_id) { if (/MSIE/.test(navigator.userAgent)) { document.charset = charset } _open_popup = window.open('', win_id); a.attr("accept-charset", charset); a.attr("action", decodeURI(url)); a.attr("target",win_id); a.submit(); _open_popup.focus(); } function transweb(language_code, url, w, h, scroll) { var win = "transweb"; var language_code = Real_language; var u = url; if(!sl) { var sl = "auto"; } var tl = language_code; var hl = language_code; var url = protocol+"translate.google.co.kr/translate?js=n&prev=_t&hl=" + hl + "&ie=UTF-8&layout=2&eotf=1&sl=" + sl + "&tl=" + hl + "&u=" + u + "&act=url"; if(w == '' && h == '') { window.open(url, "_blank"); } else { win_comment(url,"_blank",w,h,scroll); } } function transweb2(a,charset,url,sl,win_id) { var language_code = Real_language; if(!sl) { var sl = "auto"; } var tl = language_code; var hl = language_code; /* var action = protocol+"translate.googleusercontent.com/translate_c?depth=1&hl="+hl+"&rurl=translate.google.co.kr&sl="+sl+"&tl="+tl; $("#q1").attr("name", "u"); $("#q1").attr("value", decodeURI(url)); doSubmit_charset(a,charset,action,win_id); */ if (/MSIE/.test(navigator.userAgent)) { document.charset = charset } $("#q1").attr("name", "hl"); $("#q1").attr("value",hl); $("#q2").attr("name", "sl"); $("#q2").attr("value",sl); $("#q3").attr("name", "tl"); $("#q3").attr("value",tl); $("#q4").attr("name", "u"); $("#q4").attr("value",decodeURI(url)); $("#q5").attr("name", "rurl"); $("#q5").attr("value","translate.google.com"); $("#q6").attr("name", "depth"); $("#q6").attr("value","1"); //var action = protocol+"translate.googleusercontent.com/translate_c?depth=1&hl="+hl+"&rurl=translate.google.co.kr&sl="+sl+"&tl="+tl+"&u="+url; var action = protocol+"translate.googleusercontent.com/translate_c"; a.attr("action", action); a.attr("target",win_id); a.submit(); _open_popup = window.open('', win_id); _open_popup.focus(); } function transweb_specify(sl, url, w, h, scroll) { var language_code = Real_language; var u = url; if(!sl) { var sl = "auto"; } var tl = language_code; var hl = language_code; var url = protocol+"translate.google.co.kr/translate?js=n&prev=_t&hl=" + hl + "&ie=UTF-8&layout=2&eotf=1&sl=" + sl + "&tl=" + tl + "&u=" + u + "&act=url"; if(w == '' && h == '') { window.open(url, "_blank"); } else { win_comment(url,"_blank",w,h,scroll); } } /* 매구 관련 사이트 번역 */ function transweb_maegu(url, w, h, scroll) { var language_code = Real_language; var u = url; var sl = 'ko'; var tl = language_code; var hl = language_code; var url = protocol+"translate.google.co.kr/translate?js=n&prev=_t&hl=" + hl + "&ie=UTF-8&layout=2&eotf=1&sl=" + sl + "&tl=" + hl + "&u=" + u + "&act=url"; if(w == '' && h == '') { window.open(url, "transweb"); } else { win_comment(url,"transweb",w,h,scroll); } } function extract_url(strContent) { if (strContent == '') { return '' } var protocol = strContent.match(/^((http|ftp|https):\/\/)/g); if (protocol) { return strContent } else { return 'http://' + strContent } } function open_url(classify, language_code) { if (classify == "url") { var value = $('#url').val() } else { var value = trans_item_selection() } var url = extract_url(value); if ($("#trans_check").is(":checked") && value) { //var language_code = $("#input_code").val(); var language_code = Real_language; transweb(language_code, encodeURIComponent(url)) } else { if (url == null || url == "http://") { window.open('', 'url') } else { window.open(url, 'url') } } } function selected_language(selected_id) { if (selected_id == editor || selected_id == trans_verify) { if ($("#input_code").val() == 'auto') { return $("#input_code1").val() } else { return $("#input_code").val() } } else if (selected_id == editor_trans) { return $("#src2").val() } } function del() { $(editor + "," + editor_trans + "," + trans_verify).val(""); button_change_class(); } function translateText_verify(response) { if (response.data.translations[0].translatedText) { $("#result_area").html(response.data.translations[0].translatedText); $(trans_verify).val($("#result_area").text()) } else { return false } } function trans_verify_ajax(text2) { var source_code = $("#src2").val(); if ($('#input_code').val() != 'auto') { var target_code = $('#input_code').val() } else { var target_code = $('#input_code1').val() } var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ async: false, type: "get", url: protocol+'www.googleapis.com/language/translate/v2?key=AIzaSyAFV-IkO8gMPXjpSNFpyREQ3p9ugQIqb7E&callback=translateText_verify&source=' + source_code + '&target=' + target_code + '&q=' + encodeURIComponent(text2) + "&num_temp=" + num_temp, dataType: 'script' }) } function auto_translation_verify(language_code) { if ($("#check_verify").is(":not(:checked)")) { $('#check_verify').attr('checked', 'checked'); $('#trans_verify').show() } var text2 = $(editor_trans).val(); if ($("#src2").val() != $("#input_code").val()) { trans_verify_ajax(text2) } else { $(trans_verify).val($(editor_trans).val()) } } function translateText(response) { if (response.data.translations[0].detectedSourceLanguage) { $("#input_code1").val(response.data.translations[0].detectedSourceLanguage) } else { $("#input_code1").val('') } if (response.data.translations[0].translatedText) { $("#result_area").html(response.data.translations[0].translatedText); $(editor_trans).val($("#result_area").text()); if ($("#check_verify").is(":checked")) { auto_translation_verify() } } else { $(editor_trans).val('No Translated...'); return false } } function trans_ajax(text2) { if ($('#input_code').val() != 'auto') { var source_code = $('#input_code').val(); var source_display = '&source=' + source_code } else { var source_code = ''; var source_display = '' } var target_code = $("#src2").val(); if('' || general_trans_flag == 'true') { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ async: false, type: "get", url: 'https://www.googleapis.com/language/translate/v2?key=AIzaSyAFV-IkO8gMPXjpSNFpyREQ3p9ugQIqb7E&callback=translateText' + source_display + '&target=' + target_code + '&q=' + encodeURIComponent(text2) + "&num_temp=" + num_temp, dataType: 'script' }) } else { $("#check_cmt").attr("checked","checked"); $("#btn_trans_google").trigger("click"); } } function translation(language_code) { if ($(editor).val() == "") { return false } else { var a = $(editor); if (flag_caret == "off") { var text = a.val(); $("input:radio[group='input_area'][for1='editor_trans']").trigger("click"); } else { //var text = $(a).caret().text; var text = a.val() } if ($("#src2").val() != $("#input_code").val()) { trans_ajax(text) } else { $(editor_trans).val($(editor).val()) } } } function auto_translation(language_code) { if ($(editor).val() == "") { $(editor + "," + editor_trans + "," + trans_verify).val("") } else { if ($("#src2").val() != $("#input_code").val()) { if ($("#check_realtime").is(":checked")) { var text2 = $(editor).val(); trans_ajax(text2) } else { return false } } else { if ($("#check_realtime").is(":checked")) { $(editor_trans).val($(editor).val()) } else { return false } } } } function detectText(response) { if (response.data.detections[0].language) { $("#input_code1").val(response.data.detections[0].language) } else { $("#input_code1").val('') } } function detect(text2) { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ async: false, type: "get", url: 'https://www.googleapis.com/language/translate/v2/detect?key=AIzaSyAFV-IkO8gMPXjpSNFpyREQ3p9ugQIqb7E&callback=detectText&q=' + encodeURIComponent(text2) + "&num_temp=" + num_temp, dataType: 'script' }) } function lngcode_define() { var num_temp = Math.ceil(Math.random() * 10000); var url = 'https://www.googleapis.com/language/translate/v2/languages?key=AIzaSyAFV-IkO8gMPXjpSNFpyREQ3p9ugQIqb7E&callback=language_list&target=' + Real_language + "&num_temp=" + num_temp; $.ajax({ asyn: false, type: 'get', url: url, dataType: "script", error: function (x, o, e) { alert(x.status + " : " + o + " : " + e) }, success: function() { //$(".comment,.user_introduce").live('touchmove', function (e) { e.preventDefault(); }, false); if("") { loaded();//iscroll 세팅 } var share_language_name_ko = $("#input_code option[value='ko'].lng_list").attr("language_name"); var share_language_name_en = $("#input_code option[value='en'].lng_list").attr("language_name"); $("label[for='share_select_ko']").html(share_language_name_ko); $("label[for='share_select_en']").html(share_language_name_en); $(".share_select_"+Temp_language).attr("checked","checked"); country_define(); } }); } function language_list(response) { var input_code = $('#input_code'); var trans_code = $('#src2'); var select_search_language = $("#select_search_language"); if (Real_language == 'ko') { input_code.append("") } else { input_code.append("") } /* for (l in response.data.languages) { var lngCode = response.data.languages[l].language.toLowerCase(); var lng = response.data.languages[l].name; lngName[response.data.languages[l].language] = lng; if (lngCode == Real_language || lngCode == "en") { input_code.append(""); trans_code.append("") } } */ for (l in response.data.languages) { //var lngCode = response.data.languages[l].language.toLowerCase(); var lngCode = response.data.languages[l].language; var lng = response.data.languages[l].name; kmj++; if('') { var title = lngCode; } else { var title = ''; } input_code.append(""); trans_code.append(""); select_search_language.append("") } $("#input_code").val(Real_language); if(Real_language != 'en') { $("#src2").val('en'); } else if(Real_language == 'en') { $("#src2").val('ko'); } $("#view_code").val(Real_language) if(mobile_device) { // 아이폰에서 가로로 전환했다 세로로 돌아올때 비정상적으로 화면 나오는 버그 해결 $(window).bind("orientationchange.fm_optimizeInput", fm_optimizeInput); } else { if('' || '') { virtualkeyboard_list(); } } if("") { init_search_users(); update_chatting_list(); } } function url_check(url, target) { requester.onreadystatechange = function () { response(url, target) } requester.open("get", url, true); requester.send(null) } function response(url, target) { if (requester.readyState == 4) { $("#" + target).html((requester.status == 200) ? url_embed(url) : "\ub9c1\ud06c\uac00 \uc815\ud655\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \uc5d0\ub7ec\ucf54\ub4dc: " + requester.status) } } function url_embed(url) { return "" } function update_profile_process(update_user) { var requester_str = "mode=user_info&username=" + update_user + "&calluser="+cs_username; var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, data: requester_str, type: 'post', success: function (content1) { content = eval("(" + content1 + ")"); if (content.ok == 'true') { var user_username = content.username; var user_name = content.name; var user_english_name = content.english_name; var user_language = content.language; var user_nationality = content.nationality; var user_location = content.location; var user_language_flag_image = country_flag_url + content.language_flag_image + "?date=" + new Date().getTime(); var language_code = content.language_code; var user_nationality_flag_image = country_flag_url + content.nationality_flag_image; var user_mobile = content.mobile; var user_email = content.email; var user_url = content.url; var friend = content.friend; $("img[for_to='" + update_user + "']").attr("src", user_nationality_flag_image); $("[for_to='" + update_user + "'].label_location").text(user_location); $("[for_to='" + update_user + "'].label_own_language").text(user_language); $("[for_to='" + update_user + "'].label_name").text(user_name); $("[for_to='" + update_user + "'].label_english_name").text(user_english_name) } else { alert('error'); return false } }, error: function (x, o, e) { alert(x.status + " : " + o + " : " + e) } }) } function notify() { var options = {}; var selectedEffect = 'highlight'; var main_index = $('#tabs > ul > li > a').index($('[href="#chat_body"]')); var chat_index = $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')); $("#tabs > ul > li").eq(main_index).effect(selectedEffect, options, 500).show(); $("#chat_body > ul > li").eq(chat_index).effect(selectedEffect, options, 500).show(); } function get_channel_name() { var selected = $("#chat_body").tabs("option", "selected"); var a = $('#chat_body ul li:eq(' + selected + ') a').attr('href'); if (a == '#chat_square_body') { var classify = 'whole'; var channel_name = CHANNEL_CHAT; var username1 = client.core.user.properties.name; var username2 = '' } else { var classify = 'private'; var username1 = client.core.user.properties.username; var username2 = $('#target_chat_user img').attr('for_to'); if (username1 > username2) { var channel_name = "private_" + username2 + "_" + username1; } else { var channel_name = "private_" + username1 + "_" + username2; } } var return_value = { classify: classify, channel: channel_name, sender: username1, reciever: username2 }; var return_value = eval("(return_value)"); return return_value } function display_screen(requester_str, view_code, original_flag, return_value) { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, data: requester_str, type: 'post', success: function (content1) { content = eval("(" + content1 + ")"); if (content.ok == 'true') { client.channel_maegu.request.send("message_send", { 'classify': content.classify, 'channel': content.channel, 'no': content.no, 'sender': return_value.sender, 'reciever': return_value.reciever }) } else { alert('error'); return false } }, error: function (x, o, e) { alert(x.status + " : " + o + " : " + e) } }) } function _write(cmt, input_language, user_status, m_classify) { if (cmt == "") { return false } var input_code = input_language; $("#display_error").html(""); var return_value = get_channel_name(); db_write(return_value, input_code, cmt, user_status, m_classify) } function db_write(return_value, input_code, cmt, user_status, m_classify) { /* if(user_status == '0') { alert(m_dont_send_message);return false; } */ var original_flag = 0; var view_code = $("#view_code").val(); var original_cmt = original_cmt = encodeURIComponent(cmt); var requester_str = "chat_trans_flag="+chat_trans_flag+"&mode=write&username="+cs_username+"&nickname="+cs_username+"&original_cmt=" + original_cmt + "&input_code=" + input_code + "&view_code=" + view_code + "&original_flag=" + original_flag + "&channel_name=" + return_value.channel + "&classify=" + return_value.classify + "&user_status=" + user_status + "&m_classify=" + m_classify; display_screen(requester_str, view_code, original_flag, return_value); $(editor).val(""); $(editor_trans).val(""); $(trans_verify).val("") } function trans_item_selection(id) { if (flag_caret == "off") { selected_id = "#" + $("input:radio[name='input_area']:checked").attr('for1');//alert(selected_id); return trim($(selected_id).val()); } else { return trim($(selected_id).caret().text); } } function member_error_display() { var flag = confirm(m_member_error_display); if(flag == true) { goto_sign_up(); } else { goto_sign_up(); } } $(".goto_sign_up").bind("click", function() { goto_sign_up(); }) function goto_sign_up() { $("#tabs").tabs({ selected: $('#tabs > ul > li > a').index($('[href="#loginoff_body"]')) }); } function delete_setInterval_id() { if (($(".private_chat_list [notify=check_notify]").text()).length == 0) { $.each(setInterval_id, function () { clearTimeout(setInterval_id.pop()) }) } } function init_ape() { //client.core.clearSession(); client.channel = false; client.channel_maegu = false; //update_login_status_off(); if (cs_ape_username) { client.load({ 'identifier': 'maegu' }) } client.onError('004', function () { init_ape(); }); client.onError('007', function () { var duplicate_user_error = new Array(); duplicate_user_error['ko'] = '중복된 사용자 에러!\n기존 연결을 끊고 다시 로그인을 시도하세요.'; duplicate_user_error['en'] = 'Duplicated user error!\nDisconnect the existing connection and try to login again.'; var yes = confirm(duplicate_user_error[Temp_language]); if (yes == true) { location.reload(); } else { } }); client.addEvent('load', function () { //client.core.clearSession(); if (client.core.options.restore) { client.core.start(); } else { if (cs_ape_username) { //client.core.clearSession(); client.core.start({ 'name': cs_ape_username, 'username': cs_username }) } else { return false } } }); client.addEvent('ready', function () { if (cs_ape_username) { /* client.core.request.send("setProperty", { type: 'username', value: cs_username }); */ client.core.join(CHANNEL_CHAT) } else {} }); client.addEvent('multiPipeCreate', function (pipe, options) { if (pipe.name == CHANNEL_CHAT) { current_chat_area = "chat_logined_body"; client.channel_maegu = pipe } else { current_chat_area = pipe.name; client.channel = pipe; } }); client.addEvent('userJoin', function (user, pipe) { var line_user = ''; if (pipe.name == CHANNEL_CHAT) { var requester_str = "mode=user_display&classify=userjoin&ape_username="+user.properties.name+"&username=" + user.properties.username; var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/chat_process.php' + "?num_temp=" + num_temp, type: 'post', data: requester_str, success: function (content1) { content = eval("(" + content1 + ")"); line_user = add_users_list(content,'online_users'); if (!$('#online_users [on_id^="users-' + content.username+'"]').html()) { if (content.username == cs_username) { $('#online_users .user_me').replaceWith(line_user); } else { $('#online_users .user_me').after(line_user); } $('#chat_logined_body' + ' #users').scrollTop($('#chat_logined_body' + ' #users').outerHeight()) $(".bullet_login_status[for_to='" + user.properties.username + "']").attr("login_status", "1").attr("src", login_status_on_image_path); pc_mobile_view(); var number = $('#chat_logined_body #users #online_users' + " [login_status='1']").length; $('#online_users_count').text(String(number)); var trigger_object = $("#search_users_criteria [name=search_users_main][value=" + select_search_classify + "]").attr('id'); if (trigger_object == "search_users_main_online") { //$("#" + trigger_object).trigger("click") } } } }) } }); client.addEvent('userLeft', function (user, pipe) { if (pipe.name == CHANNEL_CHAT) { client.channel_maegu.request.send("count_username",{ 'channel_name':pipe.name, 'username':user.properties.username }); } }); client.onRaw('count_username', function(raw,pipe) { if(raw.data.count_username == 0) {//같은 아이디로 로그인된 사용자가 하나도 없으면 $('#online_users [on_id="users-' + raw.data.username+'"]').remove(); $('#chat_logined_body' + ' #users').scrollTop($('#' + 'chat_logined_body' + ' #users').outerHeight()); $(".bullet_login_status[for_to='" + raw.data.username + "']").attr("login_status", "0").attr("src", login_status_off_image_path); var number = $('#chat_logined_body #users #online_users' + " [login_status='1']").length; $('#online_users_count').text(String(number)); var trigger_object = $("#search_users_criteria [name=search_users_main][value=" + select_search_classify + "]").attr('id'); if (trigger_object == "search_users_main_online") { //$("#" + trigger_object).trigger("click") } } }) client.onRaw('mysql_message', function (raw, pipe) { alert('mysql_message') }); client.onRaw('update_profile_raw', function (raw, pipe) { var role = raw.data.role; var update_user = raw.data.update_user; setTimeout(function () { if (role == 'modify_image') { var image_path = profile_image_thumb_url + update_user + ".png" + "?date=" + new Date().getTime(); $("img[for_to='" + update_user + "'].profile_image").attr("src", image_path) } else if (role == 'delete_image') { $("img[for_to='" + update_user + "'].profile_image").attr("src", noimage_url) } else if (role == 'update_profile') { update_profile_process(update_user) } }, 1000, false) }); client.onRaw('Logout_Complete', function (raw, pipe) { client.core.clearSession(); client.core.quit(); location.reload(); }); client.onCmd('message_send', function (data, pipe) {}); client.onCmd('private_chat_open', function (data, pipe) {}); client.onRaw('refresh_ad', function (raw, pipe) { ad_read_routine('pr_1'); $(".btn_pr_classify[classify=pr_1] img").trigger("click"); $(".btn_pr_classify[classify=pr_1] img").addClass('border_menu'); }); client.onRaw('private_chat_start_sender', function (raw, pipe) { var current_chat_area = 'chat_chat_body'; var channel = raw.data.channel; var chat_user = raw.data.with_friend; if ($('#online_users' + ' [on_id="users-' + chat_user+'"]').html()) { var login_status_img = "" } else { var login_status_img = "" } var string = login_status_img + "" + chat_user + ""; $("#target_chat_user").html(string); $("#chatting_content").attr('kmj', channel); $("#chat_chat_body").attr('channel', channel); $("#chat_chat_body .comment").html(''); //$("#chat_chat_body").find(".loading_data").html("loading"); setTimeout(function () { display_chat('private', channel, '') }, 500); if ($('*').is('#private_chat_list_' + channel)) { var no = $('#private_chat_list_' + channel).attr('no'); var classify = 'update_create_time'; //var etc = 'notification_value_zero'; var etc = 'notification_value_zero'; var requester_str = "mode=private_chatting_list&classify=" + classify + "&no=" + no + "&etc=" + etc; chatting_list_process(classify,requester_str); } else { var classify = 'plus'; var requester_str = "mode=private_chatting_list&classify=" + classify + "&channel=" + channel + "&opponent=" + chat_user + "&calluser="+cs_username; chatting_list_process(classify,requester_str) } $(".private_chat_list[for_channel_name=" + channel + "] [notify=check_notify]").text(''); delete_setInterval_id(); $("#tabs").tabs({ selected: $('#tabs > ul > li > a').index($('[href="#chat_body"]')) }); $("#chat_body").tabs({ selected: $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')) }); $("#chatting_list").hide(); $("#chatting_content").hide().toggle(500) }); client.onRaw('private_chat_reciever', function (raw, pipe) { var channel = raw.data.channel; var current_chat_area = 'chat_chat_body'; var chat_user = raw.data.with_friend; if ($('*').is('#private_chat_list_' + channel)) { var no = $('#private_chat_list_' + channel).attr('no'); var classify = 'update_create_time'; var etc = 'notification_value_zero'; var etc = ''; var requester_str = "mode=private_chatting_list&classify=" + classify + "&no=" + no + "&etc=" + etc; chatting_list_process(classify,requester_str) } else { var classify = 'plus'; var etc = 'recieve_message'; var requester_str = "mode=private_chatting_list&classify=" + classify + "&channel=" + channel + "&etc=" + etc + "&opponent=" + chat_user + "&calluser="+cs_username; chatting_list_process(classify,requester_str) } }); client.onRaw('private_message_raw', function (raw, pipe) { var channel = raw.data.channel; var sender = raw.data.sender; var reciever = raw.data.reciever;//alert(channel+"\n"+sender+"\n"+reciever); if (cs_username == reciever) { client.channel_maegu.request.send("display_chat_reciever", { 'channel': channel, 'sender': sender, 'reciever': reciever }) } var current_chat_area = "chat_chat_body"; var view_code = $("#view_code").val(); if ($("#" + current_chat_area + " .check_original").is(":checked")) { var var_message_original = 'original_display_on' } else { var var_message_original = 'original_display_off' } var num_temp = Math.ceil(Math.random() * 10000); var requester_str = "num_temp="+num_temp+"&chat_trans_flag="+chat_trans_flag+"&mode=read&username="+cs_username+"&nickname="+cs_nickname+"&view_code=" + view_code + "&no=" + raw.data.no + '&classify=private' + '&channel=' + channel; $.ajax({ url: 'common/chat_process.php', data: requester_str, type: 'post', success: function (content1) { var content = eval("(" + content1 + ")"); if (content.ok == 'true') { var is_chat_body = $("#tabs").tabs("option", "selected") == $('#tabs > ul > li > a').index($('[href="#chat_body"]')) ? true: false; var is_chat_chat_body = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')) ? true: false; var is_chatting_content = ($("#chatting_list").attr('clientHeight') <= 1); var return_value = display_chat_routine(var_message_original, content); if (is_chat_body && is_chat_chat_body && is_chatting_content && $("#chatting_content").attr('kmj') == channel) { var line_comment = $(return_value.str); var a = line_comment.appendTo('#' + current_chat_area + ' .comment'); /* if(content.m_classify == 'map_current') { codeLatLng(a,content.no,content.message_original); } */ if (!Browser.isIE) { myScroll_private.refresh(); //myScroll_private.scrollToElement('.view_message:last-child', 100) myScroll_private.scrollToPage(1, 10000000000, 100); } else { var aaa = document.getElementById('wrapper_private'); aaa.scrollTop = aaa.scrollHeight } if ($("#check_tts").is(":checked") && return_value.username != cs_username) { tts_play(return_value.message_view, return_value.view_code) } } else { if(sender != cs_username) { pulsate(channel, sender, reciever, return_value.message_view) } } } else { alert('no translation'); return false } }, error: function (x, o, e) { alert(x.status + " : " + o + " : " + e) } }) }); client.onRaw('message_raw', function (raw, pipe) { var channel = raw.data.channel; var current_chat_area = "chat_square_body"; var view_code = $("#view_code").val(); if ($("#" + current_chat_area + " #check_original").is(":checked")) { var var_message_original = 'original_display_on' } else { var var_message_original = 'original_display_off' } var num_temp = Math.ceil(Math.random() * 10000); var requester_str = "num_temp="+num_temp+"&chat_trans_flag="+chat_trans_flag+"&mode=read&username="+cs_username+"&nickname="+cs_nickname+"&view_code=" + view_code + "&no=" + raw.data.no + '&classify=whole' + '&channel=' + channel; $.ajax({ url: 'common/chat_process.php', data: requester_str, type: 'post', success: function (content1) { var content = eval("(" + content1 + ")"); if (content.ok == 'true') { var is_chat = $("#tabs").tabs("option", "selected") == $('#tabs > ul > li > a').index($('[href="#chat_body"]')) ? true: false; var is_chat_private = $("#chat_body").tabs("option", "selected") == $('#chat_body > ul > li > a').index($('[href="#chat_chat_body"]')) ? true: false; if (!is_chat || (is_chat && !is_chat_private)) { var return_value = display_chat_routine(var_message_original, content); var line_comment = $(return_value.str); var a = line_comment.appendTo('#' + current_chat_area + ' .comment'); /* if(content.m_classify == 'map_current') { codeLatLng(a,content.no,content.message_original); } */ if (!Browser.isIE) { myScroll.refresh(); //myScroll.scrollToElement('.view_message:last-child', 100) myScroll.scrollToPage(1, 10000000000, 100); } else { var aaa = document.getElementById('wrapper'); aaa.scrollTop = aaa.scrollHeight } if ($("#check_tts").is(":checked") && return_value.username != cs_username) { tts_play(return_value.message_view, return_value.view_code) } } } else { alert('no translation'); return false } }, error: function (x, o, e) { alert(x.status + " : " + o + " : " + e) } }) }) } function loaded() { var isLoadMore_p = false; var isLoadMore_n = false; if (!Browser.isIE) { myScroll = new iScroll('wrapper', { snap:false, hScroll: false, vScroll: true, hScrollbar: false, vScrollbar: true, fadeScrollbar: true, hideScrollbar: false, bounce: true, momentum: true, lockDirection: true, /* 인풋 컨트롤 들이 선택되지 않는 문제 방지 */ onBeforeScrollStart: function(e){ var target = e.target; while (target.nodeType != 1) target = target.parentNode; // 타겟 엘리먼트에 따라 차단 여부를 결정. if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA'){ e.preventDefault(); } }, onScrollMove: function () { if(this.y < (this.maxScrollY - 10)){ isLoadMore_n = true; } else if(this.y > (this.minScrollY + 10)){ isLoadMore_p = true; } }, onScrollEnd: function () { if(isLoadMore_n){ $("#chat_square_body .move_to_down").trigger("taphold"); isLoadMore_n = false; } else if(isLoadMore_p){ $("#chat_square_body .move_to_up").trigger("taphold"); isLoadMore_p = false; } } }); myScroll_private = new iScroll('wrapper_private', { snap:false, hScroll: false, vScroll: true, hScrollbar: false, vScrollbar: true, fadeScrollbar: true, hideScrollbar: false, bounce: true, momentum: true, lockDirection: true, /* 인풋 컨트롤 들이 선택되지 않는 문제 방지 */ onBeforeScrollStart: function(e){ var target = e.target; while (target.nodeType != 1) target = target.parentNode; // 타겟 엘리먼트에 따라 차단 여부를 결정. if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA'){ e.preventDefault(); } }, /* onRefresh: function () { }, */ onScrollMove: function () { if(this.y < (this.maxScrollY - 10)){ isLoadMore_n = true; } else if(this.y > (this.minScrollY + 10)){ isLoadMore_p = true; } }, onScrollEnd: function () { if(isLoadMore_n){ $("#chat_chat_body .move_to_down").trigger("taphold"); isLoadMore_n = false; } else if(isLoadMore_p){ $("#chat_chat_body .move_to_up").trigger("taphold"); isLoadMore_p = false; } } }) } } /* 카카오톡 공유 API */ function execute_maegu_link_kakaotalk() { var language = $("input:radio[name='share_select']:checked").val(); Kakao.Link.sendTalkLink({ label: api_msg[language], image: { src: share_image[language], width: '300', height: '400' }/*, webLink: { text: 'www.maegu.com', url: maegu_share_url // 앱 설정의 웹 플랫폼에 등록한 도메인의 URL이어야 합니다. }*/ }); } /* 카카오스토리 공유 API */ function execute_maegu_link_kakaostory() { var language = $("input:radio[name='share_select']:checked").val(); if (language == 'ko') { kakao.link("story").send({ appname : "[MaeGu] MaeGu.com", post : maegu_share_url+"\n"+api_msg['ko'], appid : maegu_share_url, appver : "1.0", urlinfo : JSON.stringify({ title:"매구 다국어 통역채팅", desc:"전 세계 친구들과 언어 장벽 없이 채팅할 수 있습니다.", imageurl:[share_image['ko']], type:"article" }) }); } else { kakao.link("story").send({ appname: "[MaeGu] MaeGu.com", post: maegu_share_url+"\n"+api_msg['en'], appid: maegu_share_url, appver: "1.0", urlinfo: JSON.stringify({ title: "MaeGu Multilingual Translation Chatting", desc: "Let's chat freely with friends all around the world without language barriers", imageurl: [share_image['en']], type: "article" }) }); } } /* 트위터 공유 API */ function shareToTwitter() { var language = $("input:radio[name='share_select']:checked").val(); if (language == 'ko') { var twitter_link_text = api_msg['ko']; var twitter_data_lang = "ko"; } else { var twitter_link_text = api_msg['en']; var twitter_data_lang = "en"; } $("#twitter_link") .attr("data-text", twitter_link_text) .attr("data-lang", twitter_data_lang) .attr("data-url",maegu_share_url) .attr("data-dnt","true") .attr("data-size","small"); } /* 페이스북 공유 API */ function shareToFacebook() { var language = $("input:radio[name='share_select']:checked").val(); if (language == 'ko') { var obj = { method: 'feed', name: "[매구]", caption: '매구 다국어 통역채팅', description: api_msg['ko'], link: maegu_share_url, picture: share_image['ko'], actions: [{ name: "렛츠 고!", link: maegu_share_url }] } } else { var obj = { method: 'feed', name: "[MaeGu]", caption: 'MaeGu Multilingual translate chatting', description: api_msg['en'], link: maegu_share_url, picture: share_image['en'], actions: [{ name: "Let's Go!", link: maegu_share_url }] } } function callback(response) {} FB.ui(obj, callback) } function Third_party_API() { $(".share_select_"+Temp_language).attr("checked","checked"); flag_third_party_api = true; //$(".share_select_"+Temp_language).attr("checked","checked"); var language = $("input:radio[name='share_select']:checked").val(); if(!script1) { script1 = true; // KaKao $.getScript("common/kakaolink/kakao.link.js", function () { $.getScript("https://developers.kakao.com/sdk/js/kakao.min.js", function () { Kakao.init('2df037654b0bdade422f8ae3ad881cbc'); }); }); // Google+1 $.getScript("https://apis.google.com/js/plusone.js", function () { window.___gcfg = { lang: language }; }); } // Twitter !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); //shareToTwitter(); } } (document, "script", "twitter-wjs") // Facebook window.fbAsyncInit = function () { FB.init({ appId: '310767202368875', channelUrl: '//www.maegu.com/channel.html', status: true, cookie: true, xfbml: true }) }; (function (d, debug) { var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) { return } js = d.createElement('script'); js.id = id; js.async = true; if (language == 'ko') { js.src = "//connect.facebook.net/ko_KR/all" + (debug ? "/debug" : "") + ".js" } else { js.src = "//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js" } ref.parentNode.insertBefore(js, ref) } (document, false)); }//Third_party_API() function autolink(content) { //return content; /* var expUrl =  /(((http(s)?:\/\/)\S+(\.[^(\n|\t|\s,)]+)+)|((http(s)?:\/\/)?(([a-zA-z\-_]+[0-9]*)|([0-9]*[a-zA-z\-_]+)){2,}(\.[^(\n|\t|\s,)]+)+))+/gi; var changedData =  str.replace(expUrl, '$&'); return changedData; */ var regURL = new RegExp('(^|[^"])(http|https|ftp|telnet|news|irc)://([-/.a-zA-Z0-9_~#%$?&=:200-377()]+)', 'gi'); var regURL2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim; //var regEmail = new RegExp('([^:])([xA1-xFEa-z0-9_-]+@[xA1-xFEa-z0-9-]+\.[a-z0-9-]+\.[a-z0-9-]+)', 'gi'); return content.replace(regURL, '$1$2://$3') .replace(regURL2, '$1$2'); /* var regURL = new RegExp("(^(http|https|ftp|telnet|news|irc)://)?([-/.a-zA-Z0-9_~#%$?&=:200-377()]+)","gi"); var no_url_regURL = new RegExp("([-/.a-zA-Z0-9_~#%$?&=:200-377()]+)","gi"); var regEmail = new RegExp("([xA1-xFEa-z0-9_-]+@[xA1-xFEa-z0-9-]+\\.[a-z0-9-]+)","gi"); var regTel = new RegExp("(^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$)","gi"); if(regEmail.test(str)) { str = str.replace(regEmail,'$1'); } if(regTel.test(str)) { str = str.replace(regTel,'$1'); } if(regURL.test(str)){ var result = regURL.exec(str);//정규식을 그룹화하여 배열 객체로 리턴한다. if(result) { if(result[1]) {//첫번째 그룹 결과를 가져온다. 즉, $1에 해당하는 값을 가져온다. str = str.replace(regURL,'$1'); } else { str = str.replace(regURL,'$3');//프로토콜이 없으면 http://를 붙여준다. } } } return str; */ } function main_ad_run() { main_ad_timeId = window.setInterval("main_ad_show()",5000); } function main_ad_show(pushing_flag) { // 광고 가져오기 var selectedEffect = "bounce"; // most effect types need no options passed by default var options = {}; // some effects have required parameters if ( selectedEffect === "scale" ) { options = { percent: 100 }; } else if ( selectedEffect === "size" ) { options = { to: { width: 280, height: 185 } }; } var num_temp = Math.ceil(Math.random() * 10000); if(pushing_flag) { var requester_str = "num_temp=" + num_temp + "&pr_group=pr_1" + "&mode=single_get" + "&area_classify=1" + "&language="+Temp_language + "&no=" + main_ad_no + "&pushing_flag=yes";//pushing_flag=yes : line-ad 광고시 플래그값을 줘서 별도로 처리하기위함 } else { var requester_str = "num_temp=" + num_temp + "&pr_group=pr_1" + "&mode=single_get" + "&area_classify=1" + "&language="+Temp_language + "&no=" + main_ad_no; } $.ajax({ url: 'common/line_ad.php', type: 'post', data: requester_str, success: function (content) { contents = eval("(" + content + ")"); var number = contents.length; var str = ""; for (var i = 0; i < number; i++) { var no = contents[i].num; var language_code = contents[i].language_code; var tel_country_code = contents[i].tel_country_code; var url = contents[i].p_url; var country_image = contents[i].flag_image_country; var m_url = contents[i].m_url; if(m_url && mobile_device) { url = m_url; } var tel_country_code = contents[i].tel_country_code; var tel_mobile = contents[i].mobile; var tel_office = contents[i].office; var email = contents[i].email; var regtime = contents[i].regtime; if(Real_language == 'ko') { var site_name = contents[i].title_ko; var country_name = contents[i].country_name_ko; } else { var site_name = contents[i].title_en; var country_name = contents[i].country_name_en; } str = "
"; if (url) { str += "" + site_name + ""; } else { str += "" + site_name + ""; } var connect_tel = ''; var connect_tel_label = ''; if(tel_office) { connect_tel = tel_office; connect_tel_label = tel_office; } if(tel_mobile) { connect_tel = tel_mobile; connect_tel_label = tel_mobile; } if(country_name) { str += " | "; str += ""; str += ""; } if(connect_tel) { str += " | "; if(Real_language != 'ko') { connect_tel = tel_country_code + connect_tel; connect_tel_label = tel_country_code + " " + connect_tel; } if(mobile_device) { str += "" + "☎" + ""; } else { str += "" + "☎" + ""; } } str += "
"; $("#main_ad_area").html(str); if(pushing_flag) { //$("#main_ad_area").effect(selectedEffect, options, 100); //$("#main_ad_area").html(str).effect(selectedEffect, options, 100); $("#main_ad_area").css({"background-color":"gray","color":"red"}); main_ad_run(); } else { //$("#main_ad_area").effect(''); //$("#main_ad_area").html(str).effect(''); $("#main_ad_area").css({"background-color":"","color":""}); } main_ad_no = no; } } }) } /* function executeKakaoStoryLink() { kakao.link("story").send({ post: "[매구] 다국어 통역채팅 사이트\nwww.MaeGu.com", appid: maegu_share_url, appver: "1.0", appname: "[매구] MaeGu.com", urlinfo: JSON.stringify({ title: "[매구] 다국어 통역채팅 사이트", desc: "전 세계 친구들과 언어 장벽 없이 채팅할 수 있습니다.", imageurl: ["http://www.maegu.com/common/image/screenshot_maegu.jpg"], type: "article" }) }) } function publishStory() { FB.ui({ method: 'feed', name: 'I\'m using the Hackbook web app', caption: 'Hackbook for Mobile Web.', description: 'Check out Hackbook for Mobile Web to learn how you can make your web apps social using Facebook Platform.', link: 'http://apps.facebook.com/mobile-start/', picture: 'http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png', actions: [{ name: 'Get Started', link: 'http://apps.facebook.com/mobile-start/' }] }, function (response) {}) } */ /* function country_define(language) { var no = 0; var tel_country = $('#f_tel_country_code'); tel_country.html(''); tel_country.append(""); $.ajax({ url :'common/account_process.php?role=get_country_list&language='+language, type : 'post', success : function(content1){ var content = eval("(" + content1 + ")"); if(content.success_flag == 'true'){ for (l in content.country) { var code = content.country[l].maegu_country_code; var country = content.country[l].country_name; var tel_country_code = content.country[l].tel_country_code; var no = content.country[l].no; if(tel_country_code != '') { tel_country.append(""); } } } } }); if(Temp_language == 'ko') { $("#f_tel_country_code").val('82'); } //tel_country.val('82'); } */ /* function home_ad_routine() { var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/ad/mvk_ad.php?role=main_ad&mode=all&language=' + Real_language, type: 'post', success: function (content) { contents = eval("(" + content + ")"); number = contents.length; for (var i = 0; i < number; i++) { var now = fetch_unix_timestamp(); var no = contents[i].no; var duration_start = toTimestamp(contents[i].duration_start); var duration_end = toTimestamp(contents[i].duration_end); alert(duration_start + " " + now + " " + duration_end); var language_code = contents[i].language_code; var interval = contents[i].interval; var title_own = contents[i].title_own; var title_en = contents[i].title_en; if(Real_language == language_code) { var title = title_own; } else { var title = title_en; } var location = contents[i].location; var area = contents[i].area; var tel_country_code = contents[i].tel_country_code; var tel_office = contents[i].office; var tel_mobile = contents[i].mobile; var email = contents[i].email; var m_url = contents[i].m_url; var p_url = contents[i].p_url; var url = p_url; if(m_url && mobile_device) { url = m_url; } if(!title_en && Real_language != language_code) { continue; } if(duration_start <= now && now <= duration_end) {alert(i); $("#home_ad_url").attr("href") = url; $("#home_ad_url span").html(title); $("#home_ad_email").attr("href") = "mailto:"+email; if (tel_mobile || tel_office) { if(tel_office) { if(Real_language == language_code || cs_tel_country_code == tel_country_code) { var connect_tel = tel_office; var connect_tel_label = tel_office; } else { var connect_tel = tel_country_code + tel_office; var connect_tel_label = tel_country_code + " " + tel_office; } } if(tel_mobile) { if(Real_language == language_code || cs_tel_country_code == tel_country_code) { var connect_tel = tel_mobile; var connect_tel_label = tel_mobile; } else { var connect_tel = tel_country_code + tel_mobile; var connect_tel_label = tel_country_code + " " + tel_mobile; } } if(mobile_device) { $("#home_ad_tel").attr("href") = "tel:"+connect_tel; } else { $("#home_ad_tel").attr("href") = "javascript:void(0)"; $("#home_ad_tel").attr("title") = connect_tel_label; } } } else { continue; } }//for() } }) } */ /*** Common 사용자 정의함수 끝 ***/ /*** 라인광고 관련 스크립트 시작 ***/ function pr_ad_run() { pr_ad_timeId = window.setInterval("pr_ad_show()",5000); } function pr_ad_show(pushing_flag) { // 광고 가져오기 var selectedEffect = "highlight"; // most effect types need no options passed by default var options = {}; // some effects have required parameters if ( selectedEffect === "scale" ) { options = { percent: 100 }; } else if ( selectedEffect === "size" ) { options = { to: { width: 280, height: 185 } }; } $(".ad_title:visible").after($(".ad_line:visible:last").effect(selectedEffect, options, 5000)); if($(".ad_line:visible:last").attr("num") == $('.ad_line:visible').length) { setTimeout(function () { window.clearInterval(pr_ad_timeId); var next_url = $(".ad_line:visible").parents("table").attr("next"); //ad_read_routine(next_url); //pr_ad_run(); $("a[classify='"+next_url+"'] img").trigger("click"); }, 2000); //alert($(".ad_line:visible:last").attr("num")); } } function ad_read_routine(classify,title) { $("#ad_body").addClass("loading"); //$("#ad_body").find(".loading_data").html("loading"); //$('.pr_list').css('visibility','hidden'); switch (classify) { case 'pr_1' : var next = 'pr_2'; var rotation = 'run';break; case 'pr_2' : var next = 'pr_3'; var rotation = 'run';break; case 'pr_3' : var next = 'pr_1'; var rotation = 'run';break; default : var rotation = '';break; } var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url: 'common/line_ad.php?num_temp='+num_temp+"&classify="+classify+"&language="+Temp_language, data: 'mode=read', type: 'post', success: function (servertext) { var contents = eval("(" + servertext + ")"); var num = contents.length; var str = ""; var m_ad_inquiry = new Array(); m_ad_inquiry['ko'] = "광고문의"; m_ad_inquiry['en'] = "Ad Inquiry"; m_ad_inquiry_v = m_ad_inquiry[Temp_language]; str += ""; str += ""; if('') { str += ""; } else { str += ""; } str += ""; for (var i = 0; i < num; i++) { var num1 = i + 1; var no = contents[i].no1; var username = contents[i].username; var language_code = contents[i].language_code; var country_image = contents[i].flag_image_country; var m_url = contents[i].m_url; var url = contents[i].p_url; if(m_url && mobile_device) { url = m_url; } var tel_country_code = contents[i].tel_country_code; var tel_office = contents[i].office; var tel_mobile = contents[i].mobile; var email = contents[i].email; var regtime = contents[i].regtime; var id = "localAD_" + i; /* if(!contents[i].title_en && Real_language != language_code) { continue; } */ if(Real_language == 'ko') { var site_name = contents[i].title_ko; var country_name = contents[i].country_name_ko; } else { var site_name = contents[i].title_en; var country_name = contents[i].country_name_en; } str += ""; str += ""; str += ""; str += ""; } else { str += "" + site_name + ""; } str += ""; } str += "
 "+title+"   "+title+"  
"; //str += "" + num1 + "" + ""; if('' && classify == 'pr_1') { str += ""+no+"  "; } if (url) { str += "" + site_name + ""; var connect_tel = ''; var connect_tel_label = ''; if(tel_office) { connect_tel = tel_office; connect_tel_label = tel_office; } if(tel_mobile) { connect_tel = tel_mobile; connect_tel_label = tel_mobile; } if(connect_tel) { if(Real_language != 'ko') { connect_tel = tel_country_code + connect_tel; connect_tel_label = tel_country_code + " " + connect_tel; } if(mobile_device) { str += "" + "☎"+""; } else { str += "" + "☎" + ""; } } else { str += " "; } str += "
"; $('.pr_list').html(str); //$('.pr_list').css('visibility','visible'); //$("#ad_body").find(".loading_data").empty(); $("#ad_body").removeClass("loading"); /* $('#ad_area .pr_list').html(''); $('#ad_area .pr_list').html(str); */ if(rotation == 'run') { window.clearInterval(pr_ad_timeId); pr_ad_run(); } else { window.clearInterval(pr_ad_timeId); } }, error: function () { alert("error"); } }); } function delete_process(no){ var num_temp = Math.ceil(Math.random() * 10000); $.ajax({ url : 'common/line_ad.php?num_temp='+num_temp, data : 'mode=delete&no='+no, type : 'post', success : function(result){ if(result==true){ client.core.request.send("refresh_ad",{channel:'maegu_chat'}); } else{ alert('error'); return false; } }, error : function(x, o, e){ alert(x.status + " : "+ o +" : "+e); } }) } $(".process_no").live('click',function(){ if(''){ var a = confirm("delete this?"); if(a == true) {//alert($(this).attr('no')); delete_process($(this).attr('no')); } } }); $(".view_helpers").live("click",function(){ pop_window_size(); /* 출력창 변수 시작 */ var popupID = Temp_language + "_" + $(this).attr("for1"); var title = $("." + popupID).find("table tr").eq(0).text();//창 제목줄에 나타낼 광고 문구 var str1 = $("." + popupID).html(); var str = $(str1).clone().wrapAll("
").parent().html(); $("#popup_helpers").html(str); $("#popup_helpers table").css("text-align","center"); /* 출력창 변수 끝 */ $("#popup_helpers").dialog({ title: title, modal: true, resizable: true, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#popup_helpers").dialog("open"); }) /*** 라인광고 관련 스크립트 종료 ***/ function display_app() { //pop_window_size(); window_new_width = $("#tabs").width() * 0.9;//창 가로크기 window_new_height = $(window).height() * 0.9; //창 세로크기/350 $("#ad_area").hide(); /* 출력창 변수 시작 */ var title = "Released App";//창 제목줄에 나타낼 광고 문구 var str = $("#display_released app_message").html(); str += "
"; str += "
"+m_browser_chrom[Temp_language]+" | "+m_browser_IE[Temp_language]+"
"; $("#dialog_app").html(str); $("#dialog_app").css("text-align","center"); /* 출력창 변수 끝 */ $("#dialog_app").dialog({ title: title, modal: true, resizable: false, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#dialog_app").dialog("open"); } function islowIE10_message() { pop_window_size(); if (Browser.islowIE10) { $("#ad_area").hide(); /* 출력창 변수 시작 */ var title = "Notice";//창 제목줄에 나타낼 광고 문구 var str = $("#display_optimized_browser").html(); str += "
"; str += "
"+m_browser_chrom[Temp_language]+" | "+m_browser_IE[Temp_language]+"
"; $("#dialog_ie10").html(str); $("#dialog_ie10").css("text-align","center"); /* 출력창 변수 끝 */ $("#dialog_ie10").dialog({ title: title, modal: true, resizable: false, autoOpen: false, width: window_new_width, height: window_new_height, show: show_transition, hide: hide_transition, buttons: { "Close": function () { $(this).dialog("close") } }, open: function( event, ui ) { $(this).scrollTop(0); }, position: ['center', 'middle'] }); $("#dialog_ie10").dialog("open"); /* var text = $("#display_optimized_browser").html().replace(/
/gi,"\n"); //var text = ''; var answer = confirm(text); if(answer) { window.open("http://www.google.com/intl/"+Real_language+"/chrome/browser/","_blank"); } */ } } /* 숫자앞에 0 붙이기 */ //fillzero(33, 5) : 00033 유효자릿수 5자로 맞추되 자릿값 부족분만큼 0 채우기 function fillzero(obj, len) { obj= '00000000000'+obj; return obj.substring(obj.length-len); } /* urlencode시켜줌 */ // %BE%C8%B3%E7 와 같은 형태로 만들어줌 function urlencode(str) { str = (str + '').toString(); return encodeURIComponent(str) .replace(/!/g, '%21') .replace(/'/g, '%27') .replace(/\(/g, '%28') .replace(/\)/g, '%29') .replace(/\*/g, '%2A') .replace(/%20/g, '+'); }