var cs_username = ""; var cs_ape_username = ""; var cs_name = ""; var cs_english_name = ""; var cs_nickname = ""; var cs_email = ""; var cs_level = ""; var cs_mobile = ""; var cs_tel_country_code = ""; var cs_language_code = ""; var cs_nationality_code = ""; var cs_country_code = ""; var cs_kor_country_name = ""; var cs_eng_country_name = ""; var cs_location_code =""; var MobileDevice = new Object(); var Browser = new Object(); var Browser_language = "";//브라우저의 언어 var Browser_language1 = "";//브라우저의 임시저장 언어 var Temp_language = "";//한국어와 한국어가 아닌 경우의 두가지로만 분류하여 처리할 때 임시로 쓰일 언어 var Real_language = "";//로그인되어 있을 경우:프로필 정보에 세팅되어 있는 사용언어 / 로그인되어 있지 않을 경우:브라우저의 언어 var Real_country_code = "";//실제 국가 코드 var Temp_country_code = "";//한국과 한국이 아닌 경우의 두가지로만 분류하여 처리할 때 임시로 쓰일 국가 var Tel_country_code = ""//국가 전화 코드 var Temp_country_name = "";//한국과 한국이 아닌 경우의 두가지로만 분류하여 처리할 때 임시로 쓰일 국가명 /* json데이타의 무한루프 도는 문자 제거 */ function del_looping(json) { if(json.substring(0,8) == "for(;;);") { json = json.substring(8); } return json; } /* get_username_from_ape_username */ function get_username_from_ape_username(ape_username) { var temp_username = new Array(); temp_username = ape_username.split("*"); return temp_username[0]; } function get_country_code_from_ip(){ if("") {//로그인된 경우 Real_country_code = ""; Tel_country_code = ""; if(Real_language == 'ko') { Temp_country_name = ""; } else { Temp_country_name = ""; } } else { //아이피로부터 국가코드 가져오기 var num_temp = Math.ceil(Math.random() * 10000); var requester_str = "num_temp=" + num_temp + "&mode=get_country_code_from_ip&ip=" + "18.226.185.23&language=" + Real_language; $.ajax({ url: 'common/search_data.php', type: 'post', data: requester_str, success: function (content) { contents = eval("(" + content + ")"); if(contents.ok=='ok'){ Real_country_code = contents.country_code; Tel_country_code = contents.tel_country_code; if(Real_language == 'ko') { Temp_country_name = contents.country_name_ko; } else { Temp_country_name = contents.country_name_en; } } } }) } } //문자열을 timestamp값으로 변환 function toTimestamp(strDate){ var datum = Date.parse(strDate); return datum / 1000; } /* 유닉스 타임스탬프 구하기 유닉스 타임스탬프는 1970년 1월 1일 0시부터 지금까지 시각을 초로 환산한 것이다. 각종 시간 수치의 기본형으로 활용하기 편하다. 다양한 값으로 변환해 사용할 수 있다. */ fetch_unix_timestamp = function() { return Math.floor(new Date().getTime() / 1000); } fetch_unix_timestamp_str = function(str) { return Math.floor(new Date(str).getTime() / 1000); } //trim 함수 function trim(str) { if(!str) { return ''; } else { str = str.replace(/^\s+/, ''); for (var i = str.length - 1; i > 0; i--) { if (/\S/.test(str.charAt(i))) { str = str.substring(0, i + 1); break; } } return str; } } /* 브라우저간 호환성을 위한 함수들 */ function setInnerTextProperty()//FF에서 innerText 사용 가능하게 함. { if (typeof HTMLElement != "undefined" && typeof HTMLElement.prototype.__defineGetter__ != "undefined") { HTMLElement.prototype.__defineGetter__("innerText", function () { if (this.textContent) { return(this.textContent) } else { var r=this.ownerDocument.createRange(); r.selectNodeContents(this);return r.toString(); } } ); HTMLElement.prototype.__defineSetter__("innerText", function (sText) { this.innerHTML=sText } ); } } function IE_Ver() {//IE 버전 체크 함수 if(navigator.appName.match(/Explorer/i)) { return navigator.appVersion.match(/MSIE \d+.\d+/)[0].split(" ")[1]; } else { return 0; } } function browser_check(){//브라우저 체크함수 Browser.isIE = (navigator.userAgent.toLowerCase().indexOf("msie")!=-1); Browser.isIE_SV1 = (navigator.userAgent.toLowerCase().indexOf("sv1")!=-1); Browser.isIE_SV2 = (navigator.userAgent.toLowerCase().indexOf("sv2")!=-1); Browser.isIE_7 = (navigator.userAgent.toLowerCase().indexOf("msie 7")!=-1); Browser.isIE_8 = (navigator.userAgent.toLowerCase().indexOf("msie 8")!=-1); Browser.isIE_9 = (navigator.userAgent.toLowerCase().indexOf("msie 9")!=-1); Browser.isIE_10 = (navigator.userAgent.toLowerCase().indexOf("msie 10")!=-1); Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1); Browser.isChrome = (navigator.userAgent.toLowerCase().indexOf("chrome")!=-1); Browser.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari")!=-1); Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1); Browser.isNetscape = (navigator.userAgent.toLowerCase().indexOf("netscape")!=-1); Browser.isEtc = (navigator.userAgent.toLowerCase().indexOf("gecko")!=-1 && navigator.userAgent.toLowerCase().indexOf("firefox")==-1 && navigator.userAgent.toLowerCase().indexOf("netscape")==-1 ); if(Browser.isIE && IE_Ver() <= 10) { // IE 브라우저인 경우 버전10 미만인일 때 Browser.islowIE10 = true; } } function mobile_check() { var deviceAgent = navigator.userAgent.toLowerCase(); MobileDevice.is_android = deviceAgent.match(/android/i); MobileDevice.is_webos = deviceAgent.match(/webos/i); MobileDevice.is_iphone = deviceAgent.match(/iphone/i); MobileDevice.is_ipod = deviceAgent.match(/ipod/i); MobileDevice.is_ipad = deviceAgent.match(/ipad/i); MobileDevice.is_blackberry = deviceAgent.match(/blackberry/i); if(deviceAgent.match(/android/i) || deviceAgent.match(/webos/i) || deviceAgent.match(/iphone/i) || deviceAgent.match(/ipod/i) || deviceAgent.match(/ipad/i) || deviceAgent.match(/blackberry/i)){ return true; } else { return false; } } // ************** 공용 함수 ************** // //화면 중앙에 오도록 새창 뛰우는 함수 시작 function win_comment(mypage, myname, w, h, scroll) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrolling='+scroll+',noresizable=yes'+',location=no,menubar=no,status=no,toolbar=no'; win=window.open(mypage, myname, winprops); if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } win.focus(); } //화면 중앙에 오도록 새창 뛰우는 함수 끝 //html 문서 없이 이미지창 열게 하는 스크립트 시작 var win1Open = null function displayImage(picName, windowName, windowWidth, windowHeight){ return window.open(picName,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + (parseInt(windowWidth)+20) + ",height=" + (parseInt(windowHeight)+15)) } function winClose(){ if(win1Open != null) win1Open.close() } function doNothing(){} function displayImage(picName, windowName, windowWidth, windowHeight){ var winl = (screen.width - windowWidth) / 2; var wint = (screen.height - windowHeight) / 2; var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + windowHeight + ",left=" + winl + ",top=" + wint) if(winHandle != null){ var htmlString = "