////////////////////////////////////////////////////////////////////////////////////////////////////////////// // function goEvtDetailBanner(Temp) { var TTemp; //Temp.indexOf("hana"); //alert(Temp); SERVER_NAME = window.location.hostname; TTemp_1 = SERVER_NAME.indexOf("hanatour"); TTemp_2 = SERVER_NAME.indexOf("hana.webtour"); //alert(TTemp); //alert(SERVER_NAME); if (TTemp_1 != -1 || TTemp_2 != -1) { location.href = "http://" + SERVER_NAME + "/00001/GEvent/ev_detail.asp?eIdx=" + Temp; } else { location.href = "http://" + SERVER_NAME + "/GEvent/ev_detail.asp?eIdx=" + Temp; } } function WebHostName(){ var Dns; Dns = location.href; Dns = Dns.split("//"); Dns = Dns[1].substr(0,Dns[1].indexOf("/")); return Dns; } // Obj function getObject(objectId) { if(document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId); } else if (document.all && document.all(objectId)) { return document.all(objectId); } else if (document.layers && document.layers[objectId]) { return document.layers[objectId]; } else { return false; } } // ̸ŭ Ǹ ĭ Ŀ function checkFull(obj1, obj2 ,len) { if(obj1.value.length >= len) obj2.focus(); } // Ǵ function isNull(obj, msg) { if(obj.value.replace(/\s/g, "") == "") { if(msg) alert(msg); obj.focus(); return true; } return false; } // зüũ function isOver(obj, limit, msg) { if(obj.value.replace(/\s/g, "") == "") { return false; }else { if (obj.value.length > parseInt(limit) ) { alert(msg); obj.focus(); return true; } return false; } } // Ǵ function isSame(obj1, obj2, msg) { var str1 = obj1.value; var str2 = obj2.value; if(str1 != str2) { if(msg) alert(msg); obj2.value = ""; obj2.focus(); return false; } return true; } // Ǵ function isShort(obj, len, len2, msg) { var str = obj.value; if(str.length < len || str.length > len2) { if(msg) { alert(msg); } obj.focus(); obj.select(); return true; } return false; } // Ǵ function isNumber() { var obj = window.event.srcElement; var str = obj.value; for(var i=0; i < str.length; i++) { if(!(('0' <= str.charAt(i) && str.charAt(i) <= '9'))) { alert ("ڸ Է°մϴ.."); obj.value = ""; obj.focus(); return false; } } return true; } // Ǵ : 1̻ üũ function isNumber1() { var obj = window.event.srcElement; var str = obj.value; if(isNull(obj)) obj.value = "1"; for(var i=0; i < str.length; i++) { if(!(('0' <= str.charAt(i) && str.charAt(i) <= '9'))) { alert ("ڸ Է°մϴ.."); obj.value = "1"; obj.focus(); return false; } if(parseInt(str) <= 0) { alert ("1 ̻ Էϼ."); obj.value = "1"; obj.focus(); return false; } } return true; } // Ǵ : '-' function isNumber2() { var obj = window.event.srcElement; var str = obj.value; for(var i=0; i < str.length; i++) { if(!(('0' <= str.charAt(i) && str.charAt(i) <= '9') || str.charAt(i) == "-")) { alert ("ڸ Է°մϴ.."); obj.value = ""; obj.focus(); return false; } } return true; } // ĺ Ǵ function isAlphabet(obj) { var str = obj.value; if(str.length == 0) return false; str = str.toUpperCase(); str = str.replace(/\s/g, ""); for(var i=0; i < str.length; i++) { if(!('A' <= str.charAt(i) && str.charAt(i) <= 'Z')) { alert (" Է°մϴ.."); obj.focus(); return false; } } return true; } // or ĺ Ǵ function isAlphaNumeric(obj) { var str = obj.value; if(str.length == 0) return false; str = str.toUpperCase(); for(var i=0; i < str.length; i++) { if(!(('A' <= str.charAt(i) && str.charAt(i) <= 'Z') || ('0' <= str.charAt(i) && str.charAt(i) <= '9'))) return false; } return true; } // Ư Է Ǵ function checkSpecailChars(obj) { var chars = "~#!@$%^&*()+|}{:?><`=\][;/,'"; var StrObj = eval(obj); var str = StrObj.value; var flag = false; for (var inx = 0; inx < str.length; inx++) { if(chars.indexOf(str.charAt(inx)) != -1) flag = true; } if(flag) { alert(chars + " Ưڴ \nϽ ϴ."); StrObj.value = ""; StrObj.focus(); } } // ڿ "," ǥϱ function formatCurrency(obj) { if(obj.value.length = 0) return if(isNumber(obj)) { var cutNum = 3; var tempArray = new Array(); var returnValue = ""; for(i = 0; i < obj.value.length/cutNum; i++) tempArray[i] = obj.value.substring(obj.value.length - cutNum * (i+1), obj.value.length - cutNum * i); for(i = tempArray.length-1; i >= 0; i--) { if(i > 0) returnValue = returnValue + tempArray[i] + ","; else returnValue = returnValue + tempArray[i]; } obj.value = returnValue; } } // ڿ "," ǥϱ function formatCurrency2(obj) { if(obj.value.length = 0) return if(isNumber(obj)) { var cutNum = 3; var tempArray = new Array(); var returnValue = ""; for(i = 0; i < obj.value.length/cutNum; i++) tempArray[i] = obj.value.substring(obj.value.length - cutNum * (i+1), obj.value.length - cutNum * i); for(i = tempArray.length-1; i >= 0; i--) { if(i > 0) returnValue = returnValue + tempArray[i] + ","; else returnValue = returnValue + tempArray[i]; } return returnValue; } } // ڿ "," ǥϱ function formatCurrency3(objStr) { objStr = objStr + ""; if(objStr.length = 0) return "0" var minusStr = ""; if(parseInt(objStr) < 0) { minusStr = "-"; objStr = objStr.substring(1, objStr.length); } var cutNum = 3; var tempArray = new Array(); var returnValue = ""; for(i = 0; i < objStr.length/cutNum; i++) tempArray[i] = objStr.substring(objStr.length - cutNum * (i+1), objStr.length - cutNum * i); for(i = tempArray.length-1; i >= 0; i--) { if(i > 0) returnValue = returnValue + tempArray[i] + ","; else returnValue = returnValue + tempArray[i]; } return minusStr + returnValue; } // ڿ "," ǥϱ function formatComma(n) { var reg = /(^[+-]?\d+)(\d{3})/; // Խ n += ''; // ڸ ڿ ȯ while (reg.test(n)) n = n.replace(reg, '$1' + ',' + '$2'); return n; } // ̵ Ǵ function isID(obj) { obj.value = obj.value.replace(/\s+/, ""); // var str = obj.value; str = str.toUpperCase(); // if(str.length < 3 || str.length > 10) { if(str.length < 4) { alert ("̿ ̵ 4 ̻ ԷϿ ֽñ ٶϴ."); obj.focus(); return false; } if(!('A' <= str.charAt(0) && str.charAt(0) <= 'Z')) { alert ("̿ ̵ ݵ ؾ մϴ."); obj.focus(); return false; } if(!isAlphaNumeric(obj)) { alert ("̿ ̵ ݵ ڸ ˴ϴ."); obj.focus(); return false; } return true; } // ̸ Ǵ function isEmail(obj) { var regular_email = /^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g; if(!regular_email.test(obj.value)) { alert("̸ Ȯ ԷϽʽÿ"); obj.focus(); return false; } return true; } // ̸ Ǵ function isEmail2(obj1, obj2) { var regular_email = /^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g; if(!regular_email.test(obj1.value + "@" + obj2.value)) { alert("̸ Ȯ ԷϽʽÿ"); obj1.focus(); return false; } return true; } // ֹιȣ Ǵ ڵԷ function ssnCheck1(obj1, obj2, obj3, obj4, obj5) { var str = obj1.value.length; if(str == 6) { if(isNumber(obj1)) { var str = obj1.value; var temp1=str.substring(0,2); var temp2=str.substring(2,4); var temp3=str.substring(4,6); if( temp1 < 30 ) obj3.value = "20"+temp1; else obj3.value = "19"+temp1; obj4.value = temp2; obj5.value = temp3; obj2.focus(); } else { obj3.value = ""; obj4.value = ""; obj5.value = ""; } } } //ֹιȣ ȿ Ȯ... function isSSN(obj1, obj2) { var birthday = obj1.value; var num = obj2.value; if(birthday.length != 6) { alert(" ֹιȣ 6ڸ Ȯ ԷϽʽÿ"); obj1.focus(); return false; } if(num.length != 7) { alert(" ֹιȣ 7ڸ Ȯ ԷϽʽÿ"); obj2.focus(); return false; } var hap = 0; for(var i=0; i < 6; i++) { var temp = birthday.charAt(i) * (i+2); hap += temp; } var n1 = num.charAt(0); var n2 = num.charAt(1); var n3 = num.charAt(2); var n4 = num.charAt(3); var n5 = num.charAt(4); var n6 = num.charAt(5); var n7 = num.charAt(6); hap += n1*8+n2*9+n3*2+n4*3+n5*4+n6*5; hap %= 11; hap = 11 - hap; hap %= 10; if(hap != n7) { alert("ֹιȣ Ȯ ԷϽʽÿ"); obj1.value = ""; obj2.value = ""; obj1.focus(); return false; } return true; } // ÷ 翩 Ǵ function isFile(obj) { // Ŀ ڱ... return true; } // ÷ ׸ Ǵ function isImgFile(obj) { var str = obj.value; if(str != "" ) { if(isFile(obj)) { var str1 = str.split("."); var str2 = str1[str1.length-1]; str2 = str2.toUpperCase(); if(!(str2 =="GIF" || str2 =="JPG" || str2 == "JPEG")) { alert("JPG, GIF Ͼε մϴ."); obj.focus(); return false; } else return true; } else { obj.focus(); return false; } } else { // alert("÷ ̹ ּ"); // obj.focus(); // return false; return true; } } // ֹιȣ ϱ function calJuminManAge(jumin) { jumin = jumin.replace(/\-/g,""); if(jumin.length != 13) { return -1; } else { var now = new Date(); var year = now.getFullYear(); var month = now.getMonth() + 1; var day = now.getDate(); var sex = jumin.substring(6, 7); if(sex == "1" || sex == "2" || sex == "3" || sex == "4" || sex == "5" || sex == "6" || sex == "7" || sex == "8") { if(sex == "1" || sex == "2" || sex == "5" || sex == "6") minusAge = 0; else if(sex == "3" || sex == "4" || sex == "7" || sex == "8") minusAge = 100; var birthDay = new Date(year, parseInt(eval(jumin.substring(2,4)))-1, parseInt(eval(jumin.substring(4,6)))); var now = new Date(year, month-1, day); if(birthDay > now) minusAge += 1; return (year - (1900 + parseInt(eval(jumin.substring(0,2))) + minusAge)); } else { return -1; } } } // Ϸ ϱ ( 񱳱 date ׳, ) function calBirthManAge(birth, date) { if(typeof(date) == "undefined") { var now = new Date(); var year = now.getYear(); var month = now.getMonth() + 1; var day = now.getDate(); if(month < 10) month = "0" + month; if(day < 10) day = "0" + day; date = year + "-" + month + "-" + day; } birth = birth.replace(/\-/g,""); date = date.replace(/\-/g,""); if(birth.length != 8 || date.length != 8) { return -1; } else { if(birth.substring(4) <= date.substring(4)) { return parseInt(date.substring(0, 4))-parseInt(birth.substring(0, 4)); } else { return parseInt(date.substring(0, 4))-parseInt(birth.substring(0, 4))-1; } } } function toTimeObject(time) { time = time.replace(/\s/g, "").replace(/\-/g, "").replace(/\:/g, ""); var year = time.substring(0,4); var month = time.substring(4,6) - 1; // 1=0,12=11 var day = time.substring(6,8); return new Date(year,month,day); } function toTimeObject2(time) { time = time.replace(/\s/g, "").replace(/\-/g, "").replace(/\:/g, ""); var year = time.substring(0,4); var month = time.substring(4,6) - 1; // 1=0,12=11 var day = time.substring(6,8); var hour = time.substring(8,10); var minute = time.substring(10,12); var second = time.substring(12,14); return new Date(year,month,day,hour,minute,second); } function getDayInterval(time) { var date1 = new Date(); var date2 = toTimeObject(time); var day = 1000 * 3600 * 24; //24ð return parseInt((date2 - date1) / day, 10); } function getDayInterval2(time1, time2) { var date1 = toTimeObject(time1); var date2 = toTimeObject(time2); var day = 1000 * 3600 * 24; //24ð return parseInt((date2 - date1) / day, 10); } function getTimeInterval(str, time1, time2) { if(time1 == null || time1 == "") var date1 = new Date(); else var date1 = toTimeObject2(time1); var date2 = toTimeObject2(time2); if(str == "day") var day = 1000 * 3600 * 24; //24ð else if(str == "hour") var day = 1000 * 3600; //1ð else if(str == "minute") var day = 1000 * 60; //1 else if(str == "second") var day = 1000; //1 return parseInt((date2 - date1) / day, 10); } function setDateAdd(gubun, period, date) { var date = toTimeObject(date); if(gubun == "d") { date.setDate(date.getDate() + period); var year = date.getFullYear(); var month = date.getMonth() + 1; var day = date.getDate(); if(month < 10) month = "0" + month; if(day < 10) day = "0" + day; var returnDate = year + "-" + month + "-" + day; } return returnDate; } function getDayStr(time) { var date = toTimeObject(time); var dayNum = date.getDay(); var dayStr = ""; if(dayNum == 0) dayStr = ""; else if(dayNum == 1) dayStr = ""; else if(dayNum == 2) dayStr = "ȭ"; else if(dayNum == 3) dayStr = ""; else if(dayNum == 4) dayStr = ""; else if(dayNum == 5) dayStr = ""; else if(dayNum == 6) dayStr = ""; return dayStr; } function fnFDate(date, fm) { var oDate = toTimeObject(date); var year = oDate.getFullYear(); var month = oDate.getMonth() + 1; var day = oDate.getDate(); if(month < 10) month = "0" + month; if(day < 10) day = "0" + day; var fmStr = fm; fmStr = fmStr.replace('YYYY', year); fmStr = fmStr.replace('YY', year.toString().substring(2,4)); fmStr = fmStr.replace('MM', month); fmStr = fmStr.replace('DD', day); fmStr = fmStr.replace('WD', getDayStr(date)); return fmStr; } //¥üũ function checkcal(obj,msg) { var now = new Date(); var year = now.getYear(); var month = now.getMonth() + 1; var day = now.getDate(); var cal = obj.value; var checkyear = cal.substring(0,4); var checkmonth = cal.substring(5,7); var checkday = cal.substring(8,10); if((checkyear-0 nextDate.value) { alert(msg); return true; } return false; } //¥ Ⱓ üũ function checkCalendarTerm(prevDate, nextDate, msg) { if(prevDate.value > nextDate.value) { alert(msg); return false; } return true; } // ˻ üũ function goSearch(form) { var term = form.whereVL.value; if(term == "") { alert("˻ Է ֽʽÿ."); form.whereVL.focus(); return; } else if(quoteCheck(term)) { alert("˻ ǥ(') ԵǾ ȵ˴ϴ."); form.whereVL.value = ""; form.whereVL.focus(); return; } else if(term.charAt(0) == ' ') { alert("˻ ϴ."); form.whereVL.value = ""; form.whereVL.focus(); return; } form.method = "get" form.submit(); } // ˻ üũ flag : true => ʼ, false => function checkSearchString(obj, flag) { var term = obj.value; if(flag && term == "") { alert("˻ Է ֽʽÿ."); obj.focus(); return false; } if(quoteCheck(term)) { alert("˻ ǥ(') ԵǾ ȵ˴ϴ."); obj.value = ""; obj.focus(); return false; } if(term.charAt(0) == ' ') { alert("˻ ϴ."); obj.value = ""; obj.focus(); return false; } return true; } //οȣ üũ function quoteCheck(id) { for(var j=0;j"); str = str.replace(/\"/g, "\""); str = str.replace(/\'/g, "'"); return str; } function checkDisabledAll(obj, flag) { if(typeof(obj) == "undefined") { return; } var len = obj.length; if(len > 1) { for(var i=0; i 1) { for(var i=0; i 1) { for(var i=0; i 1) { for (var inx = 0; inx < input.length; inx++) { if (input[inx].checked) returnStr += input[inx].value + ","; } if(returnStr.length > 1) returnStr = returnStr.substr(0,returnStr.length-1); } else { if (input.checked) returnStr = input.value; } return returnStr; } function getCheckedRadioValue(input) { if (input.length > 1) { for (var inx = 0; inx < input.length; inx++) { if (input[inx].checked) return input[inx].value; } } else { if (input.checked) return input.value; } return ""; } function whatCheckedRadio(input) { if (input.length > 1) { for (var inx = 0; inx < input.length; inx++) { if (input[inx].checked) return inx; } } else { if (input.checked) return 1; } return -1; } function hasCheckedRadio(input) { if (input.length > 1) { for (var inx = 0; inx < input.length; inx++) { if (input[inx].checked) return true; } } else { if (input.checked) return true; } return false; } function hasAbledRadio(input) { if (input.length > 1) { for (var inx = 0; inx < input.length; inx++) { if (input[inx].disabled == false) return true; } } else { if (input.checked) return true; } return false; } function countCheckedRadio(input) { var chk = 0; if(typeof(input) != "undefined") { if (input.length > 1) { for (var inx = 0; inx < input.length; inx++) { if (input[inx].checked) chk++; } } else { if (input.checked) chk++; } } return chk; } function moveSelect(obj, type) { var sel = obj.selectedIndex; if(type == "up") { if(sel > 0) { var onetext = obj.options[sel-1].text; var onevalue = obj.options[sel-1].value; obj.options[sel-1].text = obj.options[sel].text; obj.options[sel-1].value = obj.options[sel].value; obj.options[sel].text = onetext; obj.options[sel].value = onevalue; obj.selectedIndex = sel-1; } } else if(type == "down") { if(sel >= 0 && sel < obj.options.length-1) { var onetext = obj.options[sel+1].text; var onevalue = obj.options[sel+1].value; obj.options[sel+1].text = obj.options[sel].text; obj.options[sel+1].value = obj.options[sel].value; obj.options[sel].text = onetext; obj.options[sel].value = onevalue; obj.selectedIndex = sel+1; } } else if(type == "top") { if(sel > 0) { var onetext = obj.options[sel].text; var onevalue = obj.options[sel].value; for(var i=sel-1; i >=0; i--) { obj.options[i+1].text = obj.options[i].text; obj.options[i+1].value = obj.options[i].value; } obj.options[0].text = onetext; obj.options[0].value = onevalue; obj.selectedIndex = 0; } } else if(type == "bottom") { if(sel >= 0 && sel < obj.options.length-1) { var onetext = obj.options[sel].text; var onevalue = obj.options[sel].value; for(var i=sel+1; i < obj.options.length; i++) { obj.options[i-1].text = obj.options[i].text; obj.options[i-1].value = obj.options[i].value; } obj.options[obj.options.length-1].text = onetext; obj.options[obj.options.length-1].value = onevalue; obj.selectedIndex = obj.options.length-1; } } } function removeSelect(obj) { var sel = obj.selectedIndex; if(sel >= 0) { for (i=sel; i 0) obj.selectedIndex = sel-1; } } function addSelect(obj, value, text, maxnum) { var flag = true; if(obj.options.length >= maxnum) { alert("ִ " + maxnum + " ðմϴ."); flag = false; return; } for (i=0; i 0) { obj.selectedIndex = 0; return obj.options[0].value; } else return ""; } function setMatchingSelect(obj, val) { if(typeof(obj) == "undefined" || val == "" || val == null) { return; } var len = obj.options.length; if(len > 0) { for (i=0; i= 0) { return obj.options[obj.selectedIndex].value; } else return ""; } function inputImageFocus() { var obj = window.event.srcElement; obj.style.backgroundImage= ""; } function inputImageBlur(img) { var obj = window.event.srcElement; if(obj.value == "") { obj.style.backgroundImage = "url('" + img + "')"; } else obj.style.backgroundImage= ""; } function inputStringFocus(str) { var obj = window.event.srcElement; if(obj.value == str) { obj.value = ""; } } function inputStringBlur(str) { var obj = window.event.srcElement; if(obj.value == "") { obj.value = str; } } function getCookie(name) { var Found = false var start, end var i = 0 // cookie ڿ ü ˻ while(i <= document.cookie.length) { start = i end = start + name.length // name ڰ ִٸ if (document.cookie.substring(start, end) == name) { Found = true break } i++ } // name ڿ cookie ãҴٸ if(Found == true) { start = end + 1 end = document.cookie.indexOf(";", start) // κ̶ ǹ( ";" ) if (end < start) end = document.cookie.length // name شϴ value Ͽ Ѵ. return document.cookie.substring(start, end) } // ã ߴٸ return "" } function setCookie( name, value, expiredays ){ var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays); // document.cookie.domain="webtour.com" document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" return; } function fitFrameHeight(pF, sF) { eval("parent.document.all."+ pF).style.height = eval("document.all."+ sF).offsetHeight; } function fitFrameWidth(pF, sF) { eval("parent.document.all."+ pF).style.width = eval("document.all."+ sF).offsetWidth+20; } function fillEmail(obj1, obj2) { var EmailAddr = obj2.options[obj2.selectedIndex].text; if(EmailAddr == "Է") { obj1.readOnly = false; obj1.value = ""; obj1.focus(); } else { obj1.readOnly = true; obj1.value = EmailAddr; } } function checkSmsLen(objTxt, objCnt) { tot_count = 0; another_count = 0; str = objTxt.value; for(var i=0; i 4) { tot_count += 2; } else { tot_count++; } } objCnt.value = tot_count; if(tot_count > 90) { alert("ڼ 90byte Ѿϴ."); disp_str = ""; for(var k=0; k<=str.length; k++) { temp = str.charAt(k); if(escape(temp).length > 4) { another_count+=2; } else { another_count++; } if(another_count < tot_count&&another_count <= 80){ disp_str = disp_str + temp; objCnt.value = another_count; } } objTxt.value = ""; objTxt.value = disp_str; } } function checkSmsLen2(objTxt, objCnt,gubun) { tot_count = 0; another_count = 0; str = objTxt.value; if (gubun == "main") { var span1 = document.getElementById("span_byte1"); var span2 = document.getElementById("span_byte2"); var LenCnt = document.getElementById("smsLenCnt"); var Type = document.getElementById("smsType"); } else if(gubun == "parent") { var span1 = parent.document.getElementById("span_byte1"); var span2 = parent.document.getElementById("span_byte2"); var LenCnt = parent.document.getElementById("smsLenCnt"); var Type = parent.document.getElementById("smsType"); } else { var span1 = document.getElementById("span_popbyte1"); var span2 = document.getElementById("span_popbyte2"); var LenCnt = document.getElementById("smspopLenCnt"); var Type = document.getElementById("smspopType"); } for (var i = 0; i < str.length; i++) { if (escape(str.charAt(i)).length > 4) { tot_count += 2; } else { tot_count++; } } objCnt.value = tot_count; if (tot_count > 90 && Type.value == "s") { alert("ڼ 90byte Ѿϴ."); if (confirm("mms ۼϽðڽϱ?")) { span1.innerHTML = "2000"; span2.innerHTML = "2000"; Type.value = "m"; LenCnt.size = 3; } else { disp_str = ""; for (var k = 0; k <= str.length; k++) { temp = str.charAt(k); if (escape(temp).length > 4) { another_count += 2; } else { another_count++; } if (another_count < tot_count && another_count <= 80) { disp_str = disp_str + temp; objCnt.value = another_count; } } objTxt.value = ""; objTxt.value = disp_str; } } else if (tot_count > 2000 && Type.value == "m") { alert("ڼ 2000byte Ѿϴ."); disp_str = ""; for (var k = 0; k <= str.length; k++) { temp = str.charAt(k); if (escape(temp).length > 4) { another_count += 2; } else { another_count++; } if (another_count < tot_count && another_count <= 2000) { disp_str = disp_str + temp; objCnt.value = another_count; } } objTxt.value = ""; objTxt.value = disp_str; } else if (tot_count <= 90 && Type.value == "m") { alert("ڼ 90byte Դϴ.\nsms ȯմϴ"); span1.innerHTML = "90"; span2.innerHTML = "90"; Type.value = "s"; LenCnt.size = 2; } } function checkSmsLen3(objTxt, objCnt, gubun) { tot_count = 0; another_count = 0; str = objTxt.value; if (gubun == "main") { var span1 = document.getElementById("span_byte1"); var span2 = document.getElementById("span_byte2"); var span3 = document.getElementById("span_byte3"); var LenCnt = document.getElementById("smsLenCnt"); var Type = document.getElementById("smsType"); } else if (gubun == "parent") { var span1 = parent.document.getElementById("span_byte1"); var span2 = parent.document.getElementById("span_byte2"); var LenCnt = parent.document.getElementById("smsLenCnt"); var Type = parent.document.getElementById("smsType"); } else { var span1 = document.getElementById("span_popbyte1"); var span2 = document.getElementById("span_popbyte2"); var LenCnt = document.getElementById("smspopLenCnt"); var Type = document.getElementById("smspopType"); } for (var i = 0; i < str.length; i++) { if (escape(str.charAt(i)).length > 4) { tot_count += 2; } else { tot_count++; } } objCnt.value = tot_count; if (tot_count > 90 && Type.value == "s") { span3.innerHTML = "80byte Ѿϴ.\nmms ۼ մϴ"; span1.innerHTML = "2000"; span2.innerHTML = "2000"; Type.value = "m"; LenCnt.size = 3; /*alert("ڼ 80byte Ѿϴ."); if (confirm("mms ۼϽðڽϱ?")) { span1.innerHTML = "2000"; span2.innerHTML = "2000"; Type.value = "m"; LenCnt.size = 3; } else { disp_str = ""; for (var k = 0; k <= str.length; k++) { temp = str.charAt(k); if (escape(temp).length > 4) { another_count += 2; } else { another_count++; } if (another_count < tot_count && another_count <= 80) { disp_str = disp_str + temp; objCnt.value = another_count; } } objTxt.value = ""; objTxt.value = disp_str; }*/ } else if (tot_count > 2000 && Type.value == "m") { alert("ڼ 2000byte Ѿϴ."); disp_str = ""; for (var k = 0; k <= str.length; k++) { temp = str.charAt(k); if (escape(temp).length > 4) { another_count += 2; } else { another_count++; } if (another_count < tot_count && another_count <= 2000) { disp_str = disp_str + temp; objCnt.value = another_count; } } objTxt.value = ""; objTxt.value = disp_str; } else if (tot_count <= 80 && Type.value == "m") { //alert("ڼ 80byte Դϴ.\nsms ȯմϴ"); span3.innerHTML = "80byte Դϴ.\nsms ۼ մϴ"; span1.innerHTML = "80"; span2.innerHTML = "80"; Type.value = "s"; LenCnt.size = 2; } } function deleteTableRow(e) { var eventSrc = window.event ? window.event.srcElement : e.target; var eventTable = eventSrc.parentNode.parentNode.parentNode.parentNode // input(ڽ).td.tr.thead.table if(eventTable.rows.length <= 1) { alert("̻ ϴ."); return; } eventTable.deleteRow(); } function deleteTableRowSelf(e) { var eventSrc = window.event ? window.event.srcElement : e.target; var eventTable = eventSrc.parentNode.parentNode.parentNode.parentNode // input(ڽ).td.tr.thead.table var eventRowIndex = eventSrc.parentNode.parentNode.rowIndex; // input(ڽ).td.tr rowIndex if(eventTable.rows.length <= 1) { alert("̻ ϴ."); return; } eventTable.deleteRow(eventRowIndex); } function getOffsetTop(obj) { var vTop = 0; if(obj.offsetParent){ do { vTop += obj.offsetTop; } while(obj = obj.offsetParent); } return vTop; } function getOffsetLeft(obj) { var vLeft = 0; if(obj.offsetParent) { do { vLeft += obj.offsetLeft; } while(obj = obj.offsetParent); } return vLeft; } function checkImg(obj){ if(typeof(JS_gSalerCode) != "undefined" && JS_gSalerCode == "NX"){ obj.src="//www.nextour.co.kr/NImg/common/noimg_list.gif"; }else{ obj.src="//www.webtour.com/Domestic/img/noimg_100_70.gif"; } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// function goOpenerUrl(url, close) { if(checkOpener() == true) { opener.location.href = url; opener.focus(); } else { var openWin = window.open(url, "", ""); opener = openWin; } if(close) self.close(); } function checkOpener() { try { opener.window; return true; } catch(e) { return false; } } function checkId_sample(form) { if(isNull(form.M_ID, "̵ Էϼ")) return; if(!isID(form.M_ID)) return; window.open("../common/pop_id.asp?m_id="+form.M_ID.value,"chkId", "toolbar=no,top=50,left=300,width=310,height=320,resize=no,status=no"); } var tmp_post1 = ""; var tmp_post2 = ""; var tmp_addr1 = ""; function findPost_sample(post1, post2, addr1) { tmp_post1 = post1; tmp_post2 = post2; tmp_addr1 = addr1; window.open("../common/pop_post.asp","findFost", "toolbar=no,top=50,left=300,width=320,height=370,resize=no,status=yes, scrollbars=yes"); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// function movieSetPlayer(width, height) { var width_val = 320; var height_val = 310; if(width) width_val = width; if(height) height_val = height; str = "" + "" + "" + "" + "" + "" + "" document.write(str); } function moviePlay(div1, div2, moviefile, x, y) { eval("document.all." + div1).style.display = "none"; eval("document.all." + div2).style.display = "block"; var mgPlayer = document.all["mgPlayer"]; mgPlayer.URL = moviefile; mgPlayer.controls.play(); } function movieMute() { var mgPlayer = document.all["mgPlayer"]; if(mgPlayer.settings.mute == false) mgPlayer.settings.mute = true; else mgPlayer.settings.mute = false; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// function WriteLine(html) { document.writeln(html); } function getFlash(URL,wid,hei,mode,zindex,LT) { if(zindex == "") zindex = "1"; document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); } function getFlashHttps(URL,wid,hei,mode,zindex,LT) { if(zindex == "") zindex = "1"; document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); } function insrtFlash(swf, width, height, bgcolor, id, flashvars) { var strFlashTag = new String(); if (navigator.appName.indexOf("Microsoft") != -1) { strFlashTag += ''; strFlashTag += ''; if(flashvars != null) {strFlashTag += ''}; strFlashTag += ''; strFlashTag += ''; strFlashTag += ''; strFlashTag += ''; strFlashTag += ''; strFlashTag += ''; strFlashTag += ''; strFlashTag += ''; } else { strFlashTag += '0) { for (var j=1; j0) { for (var j=1; j0) { for (var j=1; j0) { for (var k=1; k"; text += " "; text += ""; obj.innerHTML = text; OnListMovePreview(); obj.style.visibility = "visible"; } function OnListMovePreview() { var obj = document.all["id_preview"]; if(obj.innerHTML != ""){ obj.style.posLeft = event.x - 40 + document.documentElement.scrollLeft; obj.style.posTop = event.y + 10 + document.documentElement.scrollTop; } } function OnListHidePreview() { document.all["id_preview"].style.visibility = "hidden"; } ////////////////////////////////////////////////////////////////// var _YP = {}; _YP.Ajax = {}; // Init Style 1 : new _YP.Ajax.SmplAjax("divid", "url"); // Init Style 2 : new _YP.Ajax.SmplAjax("divid", "url", "params"); // Init Style 3 : new _YP.Ajax.SmplAjax("divid", "url", "params", callback); // Init Style 4 : new _YP.Ajax.SmplAjax("divid", "url", "params", callback, "method"); // callback Լ ֵǥ Լ ٷ ۼ. _YP.Ajax.SmplAjax = function(divid, url, params, callback, method, scriptflag) { this.divid = divid; this.url = url; this.params = params; this.callback = callback; this.method = method; this.scriptExecFlag = (scriptflag == true) ? true : false; this.loadImgTimer = null; this.sendRequest(); } _YP.Ajax.SmplAjax.prototype = { createRequest : function() { try { return new XMLHttpRequest(); } catch (trymicrosoft) { try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (othermicrosoft) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { return null; } } } }, sendRequest : function() { this.req = this.createRequest(); var tMethod = this.method ? this.method : "GET"; if(tMethod != "GET" && tMethod != "POST") tMethod != "GET"; var tUrl = this.url; var tParams = (this.params == null || this.params == "") ? null : this.params; if(tMethod == "GET" && tParams != null) tUrl = tUrl + "?" + tParams; this.req.open(tMethod, tUrl, true); this.req.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); var request = this; this.req.onreadystatechange = function() { request.onStateChange.call(request); } this.req.send(tMethod == "POST" ? tParams : null); }, onStateChange : function() { var thisDivID = this.divid; if (this.req.readyState == 1) { if(location.hostname == "dev.prism.webtour.com" || location.hostname == "prism.webtour.com" ) { if(this.divid != null && this.divid != "") { this.loadImgTimer = setTimeout( function() { document.getElementById(thisDivID).innerHTML = "


" }, 1000); } } } else if (this.req.readyState == 4) { if (this.req.status == 200) { clearTimeout(this.loadImgTimer); if(this.callback == null || this.callback == "") { if(document.getElementById(this.divid) != null && document.getElementById(this.divid) != "") { document.getElementById(this.divid).innerHTML = this.req.responseText; if(this.scriptExecFlag) { if (scriptStr = this.req.responseText.match(/]*>(([^<]|\n|\r|<[^\/])+)<\/script>/)) { eval(scriptStr[1]); } } } } else { this.callback(this.req); } } else if (this.req.status == 500) { if(location.hostname == "dev.prism.webtour.com" || location.hostname == "prism.webtour.com" ) { clearTimeout(this.loadImgTimer); if(this.callback == null || this.callback == "") { if(this.divid != null && this.divid != "") { document.getElementById(this.divid).innerHTML = this.req.responseText; } } else { this.callback(this.req); } } } } }, setScriptExecFlag : function(flag) { if(flag) this.scriptExecFlag = true; else this.scriptExecFlag = false; } } // 巡 ̾˾ // ȣ 1 : openDPopup('p1', 'ajx', 'test1.htm', '޽1', 200, 200, 100, 100, true, true); // ȣ 2 : openDPopup('p1', 'frm', 'test2.htm', '޽1', 200, 200, 100, 100, false, false); var _YP_offX = 0; var _YP_offY = 0; var _YP_zIndex = 99000; var _YP_currDivM = null; function openDPopup(id, type, url, title, width, height, left, top, mdlFlag, drgFlag) { if(document.getElementById('divPop_' + id) == null) { _YP_zIndex += 1; if(top.toString().toLowerCase() == "auto") top = (document.documentElement && document.documentElement.scrollTop || document.body && document.body.scrollTop) + 100; top = (top.toString().indexOf('px') >=0) ? top.replace('px', '') : top; left = (left.toString().indexOf('px') >=0) ? left.replace('px', '') : left; width = (width.toString().indexOf('px') >=0) ? width.replace('px', '') : width; height = (height.toString().indexOf('px') >=0) ? height.replace('px', '') : height; // var mStyle = "position:absolute; visibility:visible; border:2px solid #808080; background-color:#FFFFFF;" + // "z-index:" + _YP_zIndex + "; width:" + width + "px; height:" + height + "px; left:" + left + "px; top:" + top + "px;"; // var divHtml = "
" + // "
" + // "
" + title + "
" + // "
close
" + // "
" + // "
" + // "
"; // if(location.hostname.indexOf("nextour.co.kr") >= 0 && location.hostname.indexOf("prism.nextour.co.kr") < 0) { var hStyle = "cursor:" + ( (drgFlag == true) ? "move" : "") + "; width:" + (width-75) + "px;"; var cStyle = "cursor:pointer;"; var bStyle = "width:" + (width-8) + "px; height:" + (height-54) + "px;"; var divHtml = "
" + "
" + "
" + "
" + "
" + title + "
" + "
ݱ
" + "
" + "
" + "
" + "
" + "
"; } else if (location.hostname.indexOf("webtour.com") >= 0 && location.hostname.indexOf("prism.webtour.com") < 0) { var hStyle = "cursor:" + ((drgFlag == true) ? "move" : "") + "; padding:5px 0 3px 5px; float:left; width:" + (width - 45) + "px;"; var cStyle = "cursor:hand;cursor:pointer; padding:3px 5px 3px 0; float:right;"; var bStyle = "width:" + (width - 8) + "px; height:" + (height - 54) + "px;"; var divHtml = "
" + "
" + "
" + "
" + "
" + title + "
" + "
ݱ
" + "
" + "
" + "
" + "
" + "
"; } else { var hStyle = "cursor:" + ( (drgFlag == true) ? "move" : "") + "; padding:5px 0 3px 5px; float:left; width:" + (width-45) + "px;"; var cStyle = "cursor:hand;cursor:pointer; padding:3px 5px 3px 0; float:right;"; var bStyle = "width:" + (width-4) + "px; height:" + (height-29) + "px; overflow:auto; font: 9pt Dotum,Verdana; padding:3px; line-height: 120%;"; var divHtml = "
" + "
" + "
" + title + "
" + "
close
" + "
" + "
" + "
"; } var DivMObj = document.createElement("div"); // DivMObj.id = "divPop_" + id; DivMObj.id = "divPop_M_" + id; DivMObj.style.position = 'absolute'; DivMObj.style.top = top + 'px'; DivMObj.style.left = left + 'px'; DivMObj.style.width = width + 'px'; DivMObj.style.height = height + 'px'; DivMObj.style.zIndex = _YP_zIndex; DivMObj.innerHTML = divHtml; document.body.appendChild(DivMObj); this.DivH = document.getElementById('divPop_H_' + id); this.DivH.DivM = document.getElementById('divPop_M_' + id); this.DivH.DivC = document.getElementById('divPop_C_' + id); this.DivH.DivB = document.getElementById('divPop_B_' + id); this.DivH.DivM.ElmM = this.DivH.DivM; this.DivH.DivC.ElmC = this.DivH.DivC; this.DivH.DivB.ElmB = this.DivH.DivB; this.DivH.BodyType = type; this.DivH.Mdl = mdlFlag; if(url != null && url != "") { if(type == "a" || type == "ajx") { new _YP.Ajax.SmplAjax(this.DivH.DivB.id, url, null, null, null, true); } else if(type == "f" || type == "frm") { var ifrm = document.createElement("iframe"); ifrm.style.width = '100%'; ifrm.style.height = '100%'; ifrm.frameBorder = 0; ifrm.src = url; this.DivH.DivB.appendChild(ifrm); } } if(mdlFlag == true) { showLayerFilmDiv(mdlFlag, "#000000", 10); } if(drgFlag) { this.DivH.onmousedown=initDPopUp; // this.DivH.onmouseup=stopDPopUp; Event.observe('divPop_M_' + id, 'click', stopDPopUp); } this.DivH.DivM.onmousedown=focusDPopUp; this.DivH.DivC.onclick=closeDPopup; document.onmousemove=moveDPopUp; } else { var cDivM = document.getElementById('divPop_M_' + id); _YP_zIndex += 1; cDivM.style.zIndex = _YP_zIndex; } return DivMObj; } function closeDPopup(objId) { var cDivM = document.getElementById('divPop_M_' + ( (typeof(objId) == "string" && objId != null && objId != "" ) ? objId : this.id.split('_')[2] )); if(cDivM != null) { cDivM.parentNode.removeChild( cDivM ); } hideLayerFilmDiv(); stopDPopUp(); } function focusDPopUp() { _YP_zIndex += 1; this.ElmM.style.zIndex = _YP_zIndex; } function initDPopUp(e) { var ev = e || window.event; _YP_offX = parseInt( this.DivM.style.left) - ev.clientX; _YP_offY = parseInt( this.DivM.style.top) - ev.clientY; _YP_currDivM = this.DivM; _YP_zIndex += 1; // ȣĿ ŸƲ κ Ŭ _YP_currDivM.ElmM.style.zIndex = _YP_zIndex; // Ŀ Ƿ ̺κп ߰ if(this.BodyType == "f" || this.BodyType == "frm") { showIFameFilmDiv(this.DivB); } if(this.Mdl == false) { showLayerFilmDiv(this.Mdl, "#FFFFFF", 0); } } function moveDPopUp(e) { if(_YP_currDivM!=null) { var ev = e || window.event; _YP_currDivM.style.left = (ev.clientX + _YP_offX) + "px"; _YP_currDivM.style.top = (ev.clientY + _YP_offY) + "px"; if(ev.clientX < 5 || ev.clientY < 5 || ev.clientX > (document.body.clientWidth - 50) || ev.clientY > (document.body.clientHeight - 50) ) stopDPopUp(); return false; } } function stopDPopUp() { _YP_currDivM = null; hideIFameFilmDiv(); if(this.Mdl == false) { hideLayerFilmDiv(); } } function showLayerFilmDiv(xMdl, xbgClr, xOpcty) { var sHeight = document.body.scrollHeight; if(document.getElementById('_YPDDLayerFilmDiv') == null ) { var _YPDDLayerFilmDivObj = document.createElement("div"); with(_YPDDLayerFilmDivObj) { id = "_YPDDLayerFilmDiv"; style.position = "absolute"; style.display = "none"; style.left = 0; style.top = 0; style.width = "100%"; style.height = sHeight + "px"; style.backgroundColor = xbgClr; style.filter = "Alpha(opacity=" + xOpcty + ")"; style.opacity = (xOpcty/100); // style.zIndex = xMdl ? 99000 : _YP_zIndex; // style.zIndex = xMdl ? (_YP_zIndex - 1) : _YP_zIndex; style.zIndex = _YP_zIndex - 1; // ׷ xMdl ʿ } document.body.appendChild(_YPDDLayerFilmDivObj); _YPDDLayerFilmDivObj.style.display = "block"; } } function hideLayerFilmDiv() { var cDivFilm = document.getElementById('_YPDDLayerFilmDiv'); if(cDivFilm != null) { cDivFilm.parentNode.removeChild( cDivFilm ); } } function showIFameFilmDiv(bObj) { hideIFameFilmDiv(); var _YPDDIFrmFilmDivObj = document.createElement("div"); with(_YPDDIFrmFilmDivObj) { id = "_YPDDIFrmFilmDiv"; style.position = "absolute"; style.display = "none"; style.left = 0; style.top = (window.event) ? 0 : '27px'; style.width = bObj.style.width; style.height = bObj.style.height; style.backgroundColor = "#FFFFFF"; style.filter = "Alpha(opacity=0)"; style.opacity = 0; } bObj.appendChild(_YPDDIFrmFilmDivObj); _YPDDIFrmFilmDivObj.style.display = "block"; } function hideIFameFilmDiv() { var cDivFilm = document.getElementById('_YPDDIFrmFilmDiv'); if(cDivFilm != null) { cDivFilm.parentNode.removeChild( cDivFilm ); } } // ˻ڵϼ : , Ŭ ƴ. // window.onload = function() { // document.Form1.txtUserInput.obj = setTextSuggest(document.Form1.txtUserInput, 'test2.asp'); // document.Form1.txtUserInput2.obj = setTextSuggest(document.Form1.txtUserInput2, 'test2.asp'); //} var txtSgst_isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!= -1); var txtSgst_arrOptions = new Array(); // α׷ û ʿ 迭 var txtSgst_strLastValue = ""; // ؽƮ Էâ Էµִ ֱ ڿ var txtSgst_bMadeRequest; // û ٸ ִ üũ, ߺ û , Ÿ ڿ å var txtSgst_theTextBox; // ڰ Է Ŀ ̵Ų ؽƮ Էâ Ʈ var txtSgst_objLastActive; // ֱٿ Է Ŀ ϰ ִ Ʈ var txtSgst_currentValueSelected = -1; // ޺ ڽ ִ selectedIndex Ӽ · . -1 => ڰ ׸ ٴ ǹ var txtSgst_bNoResults = false; // û õ => ִٴ ϰ óϰ ִ ߰ ۾ ʵ var txtSgst_isTiming = false; // ð ѿ Ÿ̸Ӱ ϰ ִ var txtSgst_countForId = 0; function setTextSuggest(xElem, xServerUrl, xWidth, xHeight, xCallback) { if(document.getElementById("txtSgst_SpanOutput") == null) { var elemSpan = document.createElement("span"); elemSpan.id = "txtSgst_SpanOutput"; elemSpan.className = "spanTextDropdown"; document.body.appendChild(elemSpan); } if(xElem != null) { if(document.getElementById(xElem.id + "_hidden") == null){ // ȣÿ input Ǵ if ߰ if(xElem.id != "srchKywrd") { new Insertion.After( xElem, '' ); new Insertion.After( xElem, '' ); } else { var input_A = document.createElement("input"); input_A.type = "text"; input_A.id = xElem.id + "_preventtsubmit"; input_A.style.display = "none"; document.body.appendChild(input_A); var input_B = document.createElement("input"); input_B.type = "hidden"; input_B.id = xElem.id + "_hidden"; input_B.name = xElem.id + "_hidden"; document.body.appendChild(input_B); } } var xHidden = document.getElementById(xElem.id + "_hidden"); } return TxtSgst_SetProperties(xElem, xHidden, xServerUrl, true, true, xWidth, xHeight, xCallback, true, "
", false, null); } function TxtSgst_SetProperties( xElem, // Էâ xHidden, // õ ϰ Ʈ xserverCode, // xignoreCase, // ˻ ҹ xmatchAnywhere, // ڿ κ ڿ ãƳ xmatchTextBoxWidth, // ˻ õ ؽƮ Էâ xmatchTextBoxHeight, // ˻ õ : ü, ش & ڵ ũ xCallbackMethod, // ÿϷ ޼ xshowNoMatchMessage, // Է ڿ شϴ ܾ ٴ ޽ ǥ xnoMatchingDataMessage, // Է ڿ شϴ ܾ ٴ ޽ xuseTimeout, // ð ˻ ڵ xtheVisibleTime // ð ˻ ڵ ð ) { var props = { elem: xElem, hidden: xHidden, serverCode: xserverCode, regExFlags: ( (xignoreCase) ? "i" : "" ), regExAny: ( (xmatchAnywhere) ? "" : "^" ), matchAnywhere: xmatchAnywhere, matchTextBoxWidth: xmatchTextBoxWidth, matchTextBoxHeight: xmatchTextBoxHeight, callbackMethod: xCallbackMethod, theVisibleTime: xtheVisibleTime, showNoMatchMessage: xshowNoMatchMessage, noMatchingDataMessage: xnoMatchingDataMessage, useTimeout: xuseTimeout }; TxtSgst_AddHandler(xElem); return props; } function TxtSgst_AddHandler(objText) { objText.onkeyup = TxtSgst_GiveOptions; objText.onblur = function() { if(this.obj.useTimeout) TxtSgst_StartTimeout(); // else TxtSgst_HideTheBox(); } if(txtSgst_isOpera)objText.onkeypress = TxtSgst_GiveOptions; } function TxtSgst_GiveOptions(e) { // Ű Է Ȯ var intKey = -1; if(window.event){ intKey = event.keyCode; txtSgst_theTextBox = event.srcElement; } else{ intKey = e.which; txtSgst_theTextBox = e.target; } // Ű Ű Ű ԷµǸ hidden value if(! ( intKey == 9 || intKey == 13 || (intKey >= 37 && intKey <= 40) ) ) { TxtSgst_EraseHiddenValue(); } // ð Ÿ̸ ʱȭ if(txtSgst_theTextBox.obj.useTimeout) { if(txtSgst_isTiming)TxtSgst_EraseTimeout(); TxtSgst_StartTimeout(); } // ؽƮ Էâ Էµ ִ Ȯ if(txtSgst_theTextBox.value.length == 0 && !txtSgst_isOpera) { txtSgst_arrOptions = new Array(); TxtSgst_HideTheBox(); txtSgst_strLastValue = ""; return false; } // Ű if(txtSgst_objLastActive == txtSgst_theTextBox) { if(intKey == 13){ if(event.srcElement.id != "srchKywrd") { TxtSgst_GrabHighlighted(); txtSgst_theTextBox.blur(); // ġ ̾ ߰. TxtSgst_HideTheBox(); } return false; } else if(intKey == 38){ TxtSgst_MoveHighlight(-1); if(txtSgst_currentValueSelected >= 0){ xVal = document.getElementById("OptionsList_" + txtSgst_currentValueSelected).getAttribute("theArrayNumber"); txtSgst_theTextBox.value = txtSgst_arrOptions[xVal][0]; //set text value txtSgst_theTextBox.obj.hidden.value = txtSgst_arrOptions[xVal][1]; } return false; } else if(intKey == 40){ TxtSgst_MoveHighlight(1); if(txtSgst_currentValueSelected >= 0){ xVal = document.getElementById("OptionsList_" + txtSgst_currentValueSelected).getAttribute("theArrayNumber"); txtSgst_theTextBox.value = txtSgst_arrOptions[xVal][0]; //set text value txtSgst_theTextBox.obj.hidden.value = txtSgst_arrOptions[xVal][1]; } return false; } else{} } // Ű Է ó => ûϴ Ǽ ִ ̱ if( txtSgst_objLastActive != txtSgst_theTextBox || // Է Ŀ ִ ؽƮ Էâ Ʈ ijϰ ִ ؽƮ Էâ Ȯ txtSgst_theTextBox.value.indexOf(txtSgst_strLastValue) != 0 || // ڰ Է ü ڿ ij ڿ ¿ ǵڿ ϳ ߰ Ȯ ((txtSgst_arrOptions.length==0 || txtSgst_arrOptions.length==15 ) && !txtSgst_bNoResults) || // ijϰ ִ ų 15 ̸ (txtSgst_theTextBox.value.length <= txtSgst_strLastValue.length) ) { // ڰ Է ڿ ִ ڿ ª txtSgst_objLastActive = txtSgst_theTextBox; txtSgst_bMadeRequest = true TxtSgst_TypeAhead(txtSgst_theTextBox.value) } else if(!txtSgst_bMadeRequest){ TxtSgst_BuildList(txtSgst_theTextBox.value); } // Էµ txtSgst_strLastValue = txtSgst_theTextBox.value; } function TxtSgst_TypeAhead(xStrText) { var strParams = "q=" + encodeURIComponent(xStrText) + "&where=" + txtSgst_theTextBox.obj.matchAnywhere; var loader1 = new _YP.Ajax.SmplAjax("", txtSgst_theTextBox.obj.serverCode, strParams, TxtSgst_BuildChoices, "POST"); } function TxtSgst_BuildChoices(reg) { var strText = reg.responseText; // alert(strText); eval(strText); TxtSgst_BuildList(txtSgst_strLastValue); txtSgst_bMadeRequest = false; } function TxtSgst_BuildList(theText) { TxtSgst_SetElementPosition(txtSgst_theTextBox); var theMatches = TxtSgst_MakeMatches(theText); theMatches = theMatches.join().replace(/\,/gi,""); if(theMatches.length > 0) { document.getElementById("txtSgst_SpanOutput").innerHTML = theMatches + "
"; document.getElementById("OptionsList_0").className = "spanHighElement"; txtSgst_currentValueSelected = 0; txtSgst_bNoResults = false; } else{ txtSgst_currentValueSelected = -1; txtSgst_bNoResults = true; if(txtSgst_theTextBox.obj.showNoMatchMessage) document.getElementById("txtSgst_SpanOutput").innerHTML = "" + txtSgst_theTextBox.obj.noMatchingDataMessage + ""; else TxtSgst_HideTheBox(); } } function TxtSgst_SetElementPosition(theTextBoxInt) { var selectedPosX = 0; var selectedPosY = 0; var theElement = theTextBoxInt; if (!theElement) return; var theElemHeight = theElement.offsetHeight; var theElemWidth = theElement.offsetWidth; while(theElement != null){ selectedPosX += theElement.offsetLeft; selectedPosY += theElement.offsetTop; theElement = theElement.offsetParent; } xPosElement = document.getElementById("txtSgst_SpanOutput"); xPosElement.style.left = selectedPosX + "px"; if(theTextBoxInt.obj.matchTextBoxWidth == null || theTextBoxInt.obj.matchTextBoxWidth == "") xPosElement.style.width = (window.event) ? theElemWidth : theElemWidth - 4; else xPosElement.style.width = theTextBoxInt.obj.matchTextBoxWidth + "px"; if(theTextBoxInt.obj.matchTextBoxHeight != null && theTextBoxInt.obj.matchTextBoxHeight != "") { xPosElement.style.height = theTextBoxInt.obj.matchTextBoxHeight + "px"; xPosElement.style.overflow = "auto"; } xPosElement.style.top = (selectedPosY + theElemHeight) + "px"; xPosElement.style.display = "block"; if(theTextBoxInt.obj.useTimeout){ xPosElement.onmouseout = TxtSgst_StartTimeout; xPosElement.onmouseover = TxtSgst_EraseTimeout; } else{ xPosElement.onmouseout = null; xPosElement.onmouseover = null; } } function TxtSgst_MakeMatches(xCompareStr) { // xCompareStr=xCompareStr.replace(/\\|\[|\]|\*|\+|\(|\)/g,""); => ã // xCompareStr, txtSgst_arrOptions[i][0] => escapeԼ unescape Ѽ 2010-02-01 xCompareStr=escape(xCompareStr); txtSgst_countForId = 0; var matchArray = new Array(); var regExp = new RegExp(txtSgst_theTextBox.obj.regExAny + xCompareStr, txtSgst_theTextBox.obj.regExFlags); for(i=0;i"; var selectSpanEnd =""; var regExp = new RegExp(txtSgst_theTextBox.obj.regExAny + xMatchStr,txtSgst_theTextBox.obj.regExFlags); var aStart = xTxtText.search(regExp); var matchedText = xTxtText.substring(aStart, aStart + xMatchStr.length); txtSgst_countForId++; return selectSpanStart + xTxtOption + xTxtText.replace(regExp,undeStart + matchedText + undeEnd) + selectSpanEnd; } function TxtSgst_MoveHighlight(xDir) { if(txtSgst_currentValueSelected >= 0) { newValue = parseInt(txtSgst_currentValueSelected) + parseInt(xDir); if(newValue > -1 && newValue < txtSgst_countForId) { txtSgst_currentValueSelected = newValue; TxtSgst_SetHighColor (null); } } } function TxtSgst_SetHighColor(txtSgst_theTextBox) { if(txtSgst_theTextBox){ txtSgst_currentValueSelected = txtSgst_theTextBox.id.slice(txtSgst_theTextBox.id.indexOf("_")+1, txtSgst_theTextBox.id.length); } for(i = 0; i < txtSgst_countForId; i++){ document.getElementById('OptionsList_' + i).className = 'spanNormalElement'; } document.getElementById('OptionsList_' + txtSgst_currentValueSelected).className = 'spanHighElement'; } function TxtSgst_SetText(xVal) { txtSgst_theTextBox.value = txtSgst_arrOptions[xVal][0]; //set text value txtSgst_theTextBox.obj.hidden.value = txtSgst_arrOptions[xVal][1]; document.getElementById("txtSgst_SpanOutput").style.display = "none"; txtSgst_currentValueSelected = -1; //remove the selected index if(txtSgst_theTextBox.obj.callbackMethod != null && txtSgst_theTextBox.obj.callbackMethod != "" && txtSgst_theTextBox.obj.callbackMethod != "undefined") { txtSgst_theTextBox.obj.callbackMethod(); } } function TxtSgst_EraseHiddenValue() { txtSgst_theTextBox.obj.hidden.value = ""; } function TxtSgst_GrabHighlighted(){ if(txtSgst_currentValueSelected >= 0){ xVal = document.getElementById("OptionsList_" + txtSgst_currentValueSelected).getAttribute("theArrayNumber"); TxtSgst_SetText(xVal); TxtSgst_HideTheBox(); } } function TxtSgst_HideTheBox(){ document.getElementById("txtSgst_SpanOutput").style.display = "none"; txtSgst_currentValueSelected = -1; TxtSgst_EraseTimeout(); } function TxtSgst_EraseTimeout(){ clearTimeout(txtSgst_isTiming); txtSgst_isTiming = false; } function TxtSgst_StartTimeout(){ txtSgst_isTiming = setTimeout("TxtSgst_HideTheBox()", txtSgst_theTextBox.obj.theVisibleTime); } // ڵ ޸ ǥ => class="cnum" Ϸ, => onfocus='javascript:txtICurrency.setEvLstner(this);' var txtICurrency = { createEvLstner : function(form, event) { var findTag = new Selector('input[class="cnum"]'); if(form != null) var findScope = findTag.findElements(form); else var findScope = findTag.findElements(); findScope.each(function(value, index) { Event.observe(value.id, 'keydown', txtICurrency.checkICurrency); Event.observe(value.id, 'blur', txtICurrency.setICurrency); }); }, setEvLstner : function(value) { Event.observe(value.id, 'keydown', txtICurrency.checkICurrency); Event.observe(value.id, 'blur', txtICurrency.setICurrency); }, checkICurrency : function(event) { var keyCode = event.keyCode; if( ! ( ( ( keyCode == 8 || keyCode == 9 || keyCode == 37 || keyCode == 39 || keyCode == 46 || (keyCode > 48 && keyCode <= 57) || (keyCode > 96 && keyCode <= 105) ) ) || ( ( keyCode == 110 || keyCode == 190) && this.value.indexOf('.') < 0 && this.value.replace(/-/g, "").length > 0 ) || ( ( keyCode == 48 || keyCode == 96) && this.value.replace(/-/g, "") != '0' ) || ( ( event.ctrlKey && keyCode == 67) || ( event.ctrlKey && keyCode == 86) ) ) ) { event.preventDefault(); } if(keyCode == 189 || keyCode == 109) { if(this.value.indexOf('-') < 0) this.value = "-" + this.value.replace(/-/g, ""); else this.value = this.value.replace(/-/g, ""); } if(keyCode == 13) { for (var i = 0; i < this.form.elements.length; i++) { if (this == this.form.elements[i]) break; } i = (i + 1) % this.form.elements.length; if(this.form.elements[i].type == "text" || this.form.elements[i].type == "password") { this.form.elements[i].focus(); } else { this.blur(); } } }, setICurrency : function(event) { var objValue = this.value.replace(/[^0-9.-]/g,''); if(objValue.length != 0) { aObjValue = objValue.split('.'); objValue0 = aObjValue[0].replace(/-/g, "").toString(); objValue1 = aObjValue[1]; while(objValue0.indexOf('0') == 0 && objValue0.indexOf('0.') != 0 && objValue0 != '0') { objValue0 = objValue0.substring(1); } var resultStr = ''; for(var i=0; i 0) resultStr += '.' + objValue1; if(objValue.indexOf('-') < 0) this.value = resultStr; else this.value = "-" + resultStr; if(this.value == '-' || this.value == '.') this.value = ''; } } } // ׸ ߰, div ŸϷ ϰ.... function addSrchItem(sCode, sName, tCodeID, tNameID) { if(sCode != null && sName != null && tCodeID != null && tNameID != null) { addItemID = "addItemID_" + sCode; if(sCode != "" && sName != "" && $(addItemID) == null) { var tCodeObj = $(tCodeID); var tNameObj = $(tNameID); tCodeObj.value = tCodeObj.value + sCode + ","; var elemDiv = document.createElement("div"); elemDiv.id = addItemID; elemDiv.className = "addSrchItem"; elemDiv.innerHTML = sName + " " + ""; tNameObj.appendChild(elemDiv); } } } function delSrchItem(id, code, tCodeID, tNameID) { if($(id) != null && code != null&& tCodeID != null && tNameID != null) { var tCodeObj = $(tCodeID); var tNameObj = $(tNameID); tCodeObj.value = tCodeObj.value.replace(code + ",", ""); tNameObj.removeChild($(id)); } } // ̹/CSS Input ü // Select function imgSelectOverClass(objId, objClass) { var obj = document.getElementById(objId); obj.className = objClass; //document.getElementById(objId.substring(0, objId.lastIndexOf("_")) + "_Btn").src = "img/arr_select_out.gif"; } function imgSelectOutClass(objId, objClass) { var obj = document.getElementById(objId); obj.className = objClass; //document.getElementById(objId.substring(0, objId.lastIndexOf("_")) + "_Btn").src = "img/arr_select.gif"; } function imgSelectSelect(iName, text, value, callback) { //alert("a"); //return; var obj = document.getElementById(iName); document.getElementById(iName + "_List").style.display = "none"; document.getElementById(iName + "_Str").innerHTML = text; obj.value = value; if(callback != null && callback != "") { callback(); } } // Checkbox function imgCheckSelect(objId, objValue, imgOn, imgOff, pClass, callback) { var objName = objId.substring(0, objId.lastIndexOf("_")); var objNum = objId.substring(objId.lastIndexOf("_") + 1, objId.length); var hObj = document.getElementById(objName); var hCntObj = document.getElementById(objName + "_cnt"); var hChkObj = document.getElementById(objId + "_chk"); var pObj = document.getElementById(objId + "_p"); var cObj = document.getElementById(objId); if(hChkObj.value == "Y") { cObj.src = imgOff; hChkObj.value = "N"; pObj.className = ""; } else { cObj.src = imgOn; hChkObj.value = "Y"; pObj.className = pClass; } hObj.value = ""; for(i = 1; i <= parseInt(hCntObj.value); i++ ) { if(document.getElementById(objName + "_" + i + "_chk").value == "Y") { hObj.value += document.getElementById(objName + "_" + i + "_value").value + ","; } } if(hObj.value.length > 0) hObj.value = hObj.value.substring(0, hObj.value.length - 1); if(callback != null && callback != "") { callback(); } } function imgCheckSelect_exanadu(objId, objValue, imgOn, imgOff, pClass, callback) { var objName = objId.substring(0, objId.lastIndexOf("_")); var objNum = objId.substring(objId.lastIndexOf("_") + 1, objId.length); var hObj = document.getElementById(objName); var hCntObj = document.getElementById(objName + "_cnt"); var hChkObj = document.getElementById(objId + "_chk"); var pObj = document.getElementById(objId + "_p"); var cObj = document.getElementById(objId); if(hChkObj.value == "Y") { cObj.src = imgOff; hChkObj.value = "N"; pObj.className = ""; } else { cObj.src = imgOn; hChkObj.value = "Y"; pObj.className = pClass; } hObj.value = ""; for(i = 1; i <= parseInt(hCntObj.value); i++ ) { if(document.getElementById(objName + "_" + i + "_chk").value == "Y") { hObj.value += document.getElementById(objName + "_" + i + "_value").value + ","; } } if(hObj.value.length > 0) hObj.value = hObj.value.substring(0, hObj.value.length - 1); var str1 = hObj.value.split(","); var wCarCode_val = ""; var etc = "..."; // for (j = 0; j <= str1.length-1 ;j++) for (j = 0; j <= 1 ;j++) { switch(str1[j]){ case "KE" : wCarCode_val += "װ,"; break; case "OZ" : wCarCode_val += "ƽþƳ,"; break; case "LJ" : wCarCode_val += ","; break; case "7C" : wCarCode_val += "װ,"; break; case "ZE" : wCarCode_val += "̽Ÿװ,"; break; case "TW" : wCarCode_val += "Ƽ,"; break; case "BX" : wCarCode_val += "λ,"; break; case "RS" : wCarCode_val += ","; break; default : wCarCode_val = wCarCode_val; break; } } if (str1.length-1 > 1) { document.getElementById("wCarCode_sel").value = wCarCode_val + etc; }else{ document.getElementById("wCarCode_sel").value = wCarCode_val; } if(callback != null && callback != "") { callback(); } } // Checkbox function imgCheckUnChkAll(objName, imgOff) { var hObj = document.getElementById(objName); var hCntObj = document.getElementById(objName + "_cnt"); hObj.value = ""; for(i = 1; i <= parseInt(hCntObj.value); i++ ) { if(document.getElementById(objName + "_" + i + "_chk").value == "Y") { document.getElementById(objName + "_" + i).src = imgOff; document.getElementById(objName + "_" + i + "_chk").value = "N"; document.getElementById(objName + "_" + i + "_p").className = ""; } } } // Radio function imgRadioSelect(objId, objValue, imgOn, imgOff, pClass, callback) { var objName = objId.substring(0, objId.lastIndexOf("_")); var objNum = objId.substring(objId.lastIndexOf("_") + 1, objId.length); var hObj = document.getElementById(objName); var hTxtObj = document.getElementById(objName + "_txt"); var hCntObj = document.getElementById(objName + "_cnt"); var pObj = document.getElementById(objId + "_p"); var cObj = document.getElementById(objId); for(i = 1; i <= parseInt(hCntObj.value); i++ ) { document.getElementById(objName + "_" + i).src = imgOff; document.getElementById(objName + "_" + i + "_p").className = ""; } cObj.src = imgOn; pObj.className = pClass; hObj.value = objValue; if(hTxtObj != null && hTxtObj != "" && hTxtObj != "undefined") { hTxtObj.value = document.getElementById(objId + "_txt").value; } if(callback != null && callback != "") { callback(); } } // Radio function imgRadioUnChkAll(objName, imgOff) { var hObj = document.getElementById(objName); var hCntObj = document.getElementById(objName + "_cnt"); hObj.value = ""; for(i = 1; i <= parseInt(hCntObj.value); i++ ) { document.getElementById(objName + "_" + i).src = imgOff; document.getElementById(objName + "_" + i + "_p").className = ""; } } // Calendar1M function drawCalendar1M() { inHtml = "
" + "

" + "
" + "
" + "
" + "
"; document.write(inHtml); } function popCalendar1M(objId, objValue, sDate, term, callback, ajxUrl, objTop, objLeft) { var form = document.domSearchForm; document.getElementById("calendarPopBodyDiv").innerHTML = ""; document.getElementById("calendarPopTitleDiv").innerHTML = objValue; srcObj = document.getElementById(objId); popObj = document.getElementById("calendarPopDiv"); popObj.style.position = "absolute"; popObj.style.top = ( getOffsetTop(srcObj) + 25 + ( (objTop != null && objTop != "") ? parseInt(objTop) : 0 ) ) + "px"; popObj.style.left = ( getOffsetLeft(srcObj) + ( (objLeft != null && objLeft != "") ? parseInt(objLeft) : 0 ) ) + "px"; if(ajxUrl == null || ajxUrl == "") ajxUrl = "/_Tpl/nextour/cmn__ajx.asp" var param = "&wObjId=" + objId + "&wObjValue=" + escape(objValue) + "&wDate=" + srcObj.value + "&sDate=" + sDate + "&wTerm=" + term + "&wCallback=" + callback + ( ( ajxUrl != null && ajxUrl != "" ) ? "&ajxUrl=" + ajxUrl : "") + ( ( objTop != null && objTop != "" ) ? "&objTop=" + objTop : "") + ( ( objLeft != null && objLeft != "" ) ? "&objLeft=" + objLeft : ""); new _YP.Ajax.SmplAjax("calendarPopBodyDiv", ajxUrl, "cmd=Ajx_Cmn_SetCalendar1M" + param); } // Calendar2M function drawCalendar2M() { if(document.getElementById("calendarPopDiv") == null) { inHtml = "
" + "

" + "
" + "
" + "
" + "
"; document.write(inHtml); } } function popCalendar2M(objId, objValue, sDate, term, callback, ajxUrl, objTop, objLeft) { if(document.getElementById("calendarPopBodyDiv") == null) { var dDivCalObj = document.createElement("div"); dDivCalObj.id = "calendarPopDiv"; dDivCalObj.className = "calendar2mLyr"; dDivCalObj.innerHTML = "

" + "
" + "
" + "
"; document.body.appendChild(dDivCalObj); } var form = document.domSearchForm; document.getElementById("calendarPopBodyDiv").innerHTML = ""; document.getElementById("calendarPopTitleDiv").innerHTML = objValue; srcObj = document.getElementById(objId); popObj = document.getElementById("calendarPopDiv"); popObj.style.position = "absolute"; popObj.style.top = ( getOffsetTop(srcObj) + 25 + ( (objTop != null && objTop != "") ? parseInt(objTop) : 0 ) ) + "px"; popObj.style.left = ( getOffsetLeft(srcObj) + ( (objLeft != null && objLeft != "") ? parseInt(objLeft) : 0 ) ) + "px"; if(ajxUrl == null || ajxUrl == "") ajxUrl = "/_Tpl/nextour/cmn__ajx.asp" var param = "&wObjId=" + objId + "&wObjValue=" + escape(objValue) + "&wDate=" + srcObj.value + "&sDate=" + sDate + "&wTerm=" + term + "&wCallback=" + callback + ( ( ajxUrl != null && ajxUrl != "" ) ? "&ajxUrl=" + ajxUrl : "") + ( ( objTop != null && objTop != "" ) ? "&objTop=" + objTop : "") + ( ( objLeft != null && objLeft != "" ) ? "&objLeft=" + objLeft : ""); new _YP.Ajax.SmplAjax("calendarPopBodyDiv", ajxUrl, "cmd=Ajx_Cmn_SetCalendar2M" + param); document.body.focus(); } function NewpopCalendar2M(objId, objValue, sDate, term, callback, ajxUrl, objTop, objLeft,obDmiValue) { //alert(obDmiValue); if(document.getElementById("calendarPopBodyDiv") == null) { var dDivCalObj = document.createElement("div"); dDivCalObj.id = "calendarPopDiv"; dDivCalObj.className = "calendar2mLyr"; dDivCalObj.innerHTML = "

" + "
" + "
" + "
"; document.body.appendChild(dDivCalObj); } var form = document.domSearchForm; document.getElementById("calendarPopBodyDiv").innerHTML = ""; document.getElementById("calendarPopTitleDiv").innerHTML = objValue + "* 1̳ մϴ."; srcObj = document.getElementById(objId); popObj = document.getElementById("calendarPopDiv"); popObj.style.position = "absolute"; popObj.style.top = ( getOffsetTop(srcObj) + 25 + ( (objTop != null && objTop != "") ? parseInt(objTop) : 0 ) ) + "px"; popObj.style.left = ( getOffsetLeft(srcObj) + ( (objLeft != null && objLeft != "") ? parseInt(objLeft) : 0 ) ) + "px"; if(ajxUrl == null || ajxUrl == "") ajxUrl = "/_Tpl/nextour/cmn__ajx.asp" var param = "&wObjId=" + objId + "&wObjValue=" + escape(objValue) + "&wDate=" + srcObj.value + "&sDate=" + sDate + "&wTerm=" + term + "&wCallback=" + callback + "&wObDmiValue=" + obDmiValue + ( ( ajxUrl != null && ajxUrl != "" ) ? "&ajxUrl=" + ajxUrl : "") + ( ( objTop != null && objTop != "" ) ? "&objTop=" + objTop : "") + ( ( objLeft != null && objLeft != "" ) ? "&objLeft=" + objLeft : ""); new _YP.Ajax.SmplAjax("calendarPopBodyDiv", ajxUrl, "cmd=Ajx_Cmn_NewSetCalendar2M" + param); document.body.focus(); } function closeCalendar2M() { popObj = document.getElementById("calendarPopDiv"); popObj.style.top = "-1000px"; popObj.style.left = "-1000px"; } function clickCalendar2M(objId, objValue, callback) { document.getElementById(objId).value = objValue; closeCalendar2M(); if(callback != null && callback != "") { callback(); } } // Dynamic Scirpt function scriptDynamicSrc(srcUrl) { var scriptObj = document.createElement("script"); document.body.appendChild(scriptObj); scriptObj.setAttribute("src",srcUrl); } function resize_textarea(id, row, col){ if (col == "") cols = 0; if(document.all[id].rows + row > 0) document.all[id].rows += row; if(document.all[id].cols + col > 0) document.all[id].cols += col; } function reset_textarea(id, row) { document.all[id].rows = row; } //Խ ̵ function OnPageMove(NowPage, FormName){ document.forms[FormName].action = "?NowPage=" + NowPage; document.forms[FormName].submit(); } //Խ Top ̵ function OnPageListCout(form) { form.action = "?NowPage=1"; form.submit(); } // ڵ ޸ ǥ var oldText = ""; function DeleteComma(str) { // ޸ ֱ while(str.indexOf(",") > -1) { str = str.replace(",", ""); } return str; } function ReplaceComma(num){ var rightchar = DeleteComma(num.value); var moneychar = ""; var minusStr = ""; if(rightchar.substring(0,1) == '-') { minusStr = "-"; rightchar = rightchar.substring(1, rightchar.length); } for(index = rightchar.length-1; index>=0; index--){ splitchar = rightchar.charAt(index); if (isNaN(splitchar)) { alert(splitchar +" ڰ ƴմϴ.... \nٽ Էּ"); num.value = ''; num.focus(); return; } moneychar = splitchar+moneychar; if(index%3==rightchar.length%3&&index!=0){ moneychar=','+moneychar; } } num.value = minusStr + moneychar; } function ReplaceCommaSave(num) { oldText = num.value; } ////////////////////////////////////////////////////////////////// function checkImg_PlaceM(obj, strcode, sort){ // if (sort == "Yakdo"){ // obj.src="//www.pensionlife.co.kr/files/jp/map/" + strcode ; // } // else { // obj.src="//www.pensionlife.co.kr/files/jp/photo/" + strcode; // } //̹ ε ɷ ּó return false; } ////////////////////////////////////////////////////////////////// /* NHN UI DevelopeCenter Javascript Library : http://html.nhndesign.com >> frameMove.js => frameMotion
11111111111
2222222222
333333333333
444444444444
var frame=new frameMotion("frame"); frame.setFrame(["0px","-173px","-346px","-519px","-692px"]); frame.doMove("next"); // NEXT Frame frame.doMove("prev"); // PREV Frame */ Function.prototype.bind = function(object) { var __method = this; return function() { return __method.apply(object, arguments); } } function frameMotion(id) { this.frameId=null; this.oSectionFrame=null; this.iFrameLength=null; this.iNowFrame=0; this.iFrameValue=0; this.oTid=null; this._x=0; this.sState=null; this.iSpeed=0.5; this.initialized=function(id) { this.frameId=document.getElementById(id); } this.doMove=function(state) { this.sState=state; if(state=="next") {this._nextFrame();} else if(state=="prev") {this._prevFrame();} } this.goMove=function(num) { this.iNowFrame = this.iNowFrame + num; if(this.iNowFrame >= 0 && this.iNowFrame < this.iFrameLength) { this.iFrameValue=this.oSectionFrame[this.iNowFrame]; this._actionApply(); } } this.setFrame=function(obj) { this.oSectionFrame=obj; this.iFrameLength=obj.length-1; } this._nextFrame=function() { if(this.iFrameLength-1>this.iNowFrame) { this.iNowFrame++; this.iFrameValue=this.oSectionFrame[this.iNowFrame]; this._actionApply(); } } this._prevFrame=function() { if(this.iNowFrame!=0) { this.iNowFrame--; this.iFrameValue=this.oSectionFrame[this.iNowFrame]; this._actionApply(); } } this._actionApply=function() { if(!this.oTid) { this._actionFrame(); this.oTid=setInterval(this._actionFrame.bind(this),13); } } this._actionFrame=function() { if(this.sState=="next") this.itmp=-1; else this.itmp=0; this._x +=this.iSpeed*((parseInt(this.iFrameValue)+this.itmp)-this._x); this.frameId.style.left=this._x+"px"; if(this._x<=parseInt(this.iFrameValue) && this.sState=="next") { this.frameId.style.left=this.iFrameValue; clearInterval(this.oTid); this.oTid=null; } if(parseInt(this._x)>=parseInt(this.iFrameValue) && this.sState=="prev") { this.frameId.style.left=this.iFrameValue; clearInterval(this.oTid); this.oTid=null; } } this.initialized(id); } function frameMotionV(id) { this.frameId=null; this.oSectionFrame=null; this.iFrameLength=null; this.iNowFrame=0; this.iFrameValue=0; this.oTid=null; this._x=0; this.sState=null; this.iSpeed=0.09; this.initialized=function(id) { this.frameId=document.getElementById(id); } this.doMove=function(state) { this.sState=state; if(state=="next") {this._nextFrame();} else if(state=="prev") {this._prevFrame();} } this.setFrame=function(obj) { this.oSectionFrame=obj; this.iFrameLength=obj.length-1; } this._nextFrame=function() { if(this.iFrameLength-1>this.iNowFrame) { this.iNowFrame++; this.iFrameValue=this.oSectionFrame[this.iNowFrame]; this._actionApply(); } } this._prevFrame=function() { if(this.iNowFrame!=0) { this.iNowFrame--; this.iFrameValue=this.oSectionFrame[this.iNowFrame]; this._actionApply(); } } this._actionApply=function() { if(!this.oTid) { this._actionFrame(); this.oTid=setInterval(this._actionFrame.bind(this),13); } } this._actionFrame=function() { if(this.sState=="next") this.itmp=-1; else this.itmp=0; this._x +=this.iSpeed*((parseInt(this.iFrameValue)+this.itmp)-this._x); this.frameId.style.top=this._x+"px"; if(this._x<=parseInt(this.iFrameValue) && this.sState=="next") { this.frameId.style.top=this.iFrameValue; clearInterval(this.oTid); this.oTid=null; } if(parseInt(this._x)>=parseInt(this.iFrameValue) && this.sState=="prev") { this.frameId.style.top=this.iFrameValue; clearInterval(this.oTid); this.oTid=null; } } this.initialized(id); } var isFirstTost = true; var tostTimeObj1,tostTimeObj2,tostTimeObj3; function addToast(msg,time){ clearInterval(tostTimeObj1); clearInterval(tostTimeObj2); clearInterval(tostTimeObj3); if(isFirstTost){ isFirstTost = false; var csstext = document.createTextNode(".toast {opacity:0;position:fixed;z-index:100000;bottom:5rem;left:50%;width:74%;margin-left:-37%;text-align:center;box-sizing:border-box !important;padding:.85rem 2rem;color:#fff;background:rgba(0,0,0,0.7);border-radius:10px;font-size:15px;transition:all .4s ease;}.toast.on {opacity:1;bottom:8rem}"); var cssTag = document.createElement('style'); cssTag.appendChild(csstext); document.head.appendChild(cssTag); } var toastNode = document.getElementById('AddToast'); if(toastNode!=null){ toastNode.parentNode.removeChild(toastNode); } var ttime = 2300; if(typeof time != 'undefined'){ ttime = time; } var toastNode = document.createElement('div'); toastNode.id = 'AddToast'; toastNode.setAttribute('class', 'toast'); toastNode.innerHTML = msg; document.body.appendChild(toastNode); tostTimeObj1 = setTimeout(function(){ toastNode.setAttribute('class', 'toast on'); },50); tostTimeObj2 = setTimeout(function(){ toastNode.setAttribute('class', 'toast'); },(ttime-300)); tostTimeObj3 = setTimeout(function(){ toastNode.parentNode.removeChild(toastNode); },ttime); } var isFirstAlert = true; function addAlert(msg){ if(isFirstAlert){ isFirstAlert = false; var csstext = document.createTextNode(".gt-alert {overflow-y:auto;position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000000;background:rgba(255,255,255,0.8)}.gt-alert .c {border:1px solid #d6d6d6;display:block;text-align:left !important;position:relative;width:74%;max-width:500px;background:#fff;margin:50px auto;box-sizing:border-box !important;padding:10px 20px 50px 20px;color:#111;border-radius:6px;font-size:15px;box-shadow:5px 5px 10px 1px rgb(0 0 0 / .4)}.gt-alert .c .adButton {display:block;position:absolute;bottom:10px;right:10px}.gt-alert .c .adButton button {border:0;margin-left:5px;padding:5px 14px;background:#eaeaea;border-radius:3px;display:inline-block;cursor:pointer;}.gt-alert .c .adButton button:first-child {background:#5398f5;color:#fff}"); var cssTag = document.createElement('style'); cssTag.appendChild(csstext); document.head.appendChild(cssTag); } var alertNode = document.createElement('div'); var spanMsg = document.createElement('span'); var spanBtn = document.createElement('span'); var btn = document.createElement('button'); alertNode.setAttribute('class', 'gt-alert'); spanMsg.setAttribute('class', 'c'); spanMsg.innerHTML = msg; btn.setAttribute('type', 'button'); btn.innerHTML = 'Ȯ'; spanBtn.setAttribute('class', 'adButton'); spanBtn.appendChild(btn); spanMsg.appendChild(spanBtn); alertNode.appendChild(spanMsg); document.body.appendChild(alertNode); btn.addEventListener('click',function(){ alertNode.parentNode.removeChild(alertNode); },false); } var isFirstConfirm = true; function addConfirm(msg,callback1,callback2){ if(isFirstConfirm){ isFirstConfirm = false; var csstext = document.createTextNode(".gt-confirm {overflow-y:auto;position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000000;background:rgba(255,255,255,0.8)}.gt-confirm .c {border:1px solid #d6d6d6;display:block;text-align:left !important;position:relative;width:74%;max-width:500px;background:#fff;margin:50px auto;box-sizing:border-box !important;padding:10px 20px 50px 20px;color:#111;border-radius:6px;font-size:15px;box-shadow:5px 5px 10px 1px rgb(0 0 0 / .4)}.gt-confirm .c .adButton {display:block;position:absolute;bottom:10px;right:10px}.gt-confirm .c .adButton button {border:0;margin-left:5px;padding:5px 14px;background:#eaeaea;border-radius:3px;display:inline-block;cursor:pointer;}.gt-confirm .c .adButton button:first-child {background:#5398f5;color:#fff}"); var cssTag = document.createElement('style'); cssTag.appendChild(csstext); document.head.appendChild(cssTag); } var confirmNode = document.createElement('div'); var spanMsg = document.createElement('span'); var spanBtn = document.createElement('span'); var btn = document.createElement('button'); var btn2 = document.createElement('button'); confirmNode.classList.add('gt-confirm'); spanMsg.classList.add('c'); spanMsg.innerHTML = msg; btn.setAttribute('type', 'button'); btn.innerHTML = 'Ȯ'; btn2.setAttribute('type', 'button'); btn2.innerHTML = ''; spanBtn.classList.add('adButton'); spanBtn.appendChild(btn); spanBtn.appendChild(btn2); spanMsg.appendChild(spanBtn); confirmNode.appendChild(spanMsg); document.body.appendChild(confirmNode); btn.addEventListener('click',function(){ confirmNode.parentNode.removeChild(confirmNode); if(typeof callback1 != 'undefined' && callback1 != 'undefined'){ if(typeof callback1 != 'string'){ callback1(); } } },true); btn2.addEventListener('click',function(){ confirmNode.parentNode.removeChild(confirmNode); if(typeof callback2 != 'undefined' && callback2 != 'undefined'){ if(typeof callback2 != 'string'){ callback2(); } } },false); }