// °´½Ç»çÁø Æ˾÷ function preViewPopup(nIdx) { window.open('/chtml/reservation/reservation_previewroom.php?template=bizdemo45964&productIdx=' + nIdx,'viewPouup',"width=740,height=850,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=50,top=50"); } //¿¹¾à°¡´É °´½Ç üũÆû function formChk() { var obj,idxs; obj = document.getElementsByName('productIdx[]'); for( i = 0; i < obj.length; i++ ) { if( obj[i].checked == false ) continue; idxs = obj[i].value; } if (idxs == undefined) { alert('¿¹¾àÇÒ °´½ÇÀ» ¼±ÅÃÇØÁÖ¼¼¿ä.'); return false; } if(document.getElementsByName('reservationChk')[0].checked== false) { alert('ÀÌ¿ë±âÁØ¿¡ µ¿ÀÇÇÏ¼Å¾ß ¿¹¾àÀÌ °¡´ÉÇÕ´Ï´Ù.'); return false; } document.getElementById('listChk').submit(); } function payment(bankCancel) { var frm=document.payment; if(frm.repeatChk.value == '1') { // Áߺ¹Ã³¸® ¾ÈµÇ°Ô alert('ó¸®ÁßÀÔ´Ï´Ù.'); } else { var obj,idxs; obj = document.getElementsByName('mothod[]'); for( i = 0; i < obj.length; i++ ) { if( obj[i].checked == false ) continue; idxs = obj[i].value; } if (idxs == undefined) { alert('°áÁ¦¼ö´ÜÀ» ¼±ÅÃÇØ ÁÖ½Ã±æ ¹Ù¶ø´Ï´Ù.'); return; } var paymentLink = '/chtml/pg/pg_payment_reservation_order_exe.php'; if(idxs == 'BANK') { if(bankCancel == false) { alert('¹«ÅëÀåÀÔ±Ý °èÁ°¡ ¼³Á¤µÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù. °ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇØÁֽʽÿÀ.'); return; } if(document.getElementById('orderPerson').value == false) { alert('ÀÔ±ÝÀÚ¸íÀ» ÀÔ·ÂÇØ ÁÖ½Ã±æ ¹Ù¶ø´Ï´Ù.'); return; } } else if(idxs == 'CARD') { if(frm.builderPgName.value!="") { switch(frm.builderPgName.value) { case 'inicis': if(document.INIpay == null || document.INIpay.object == null) { alert("\nÀÌ´ÏÆäÀÌ Ç÷¯±×ÀÎ ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù. \n\n¾ÈÀüÇÑ °áÁ¦¸¦ À§ÇÏ¿© ÀÌ´ÏÆäÀÌ Ç÷¯±×ÀÎÀÇ ¼³Ä¡°¡ ÇÊ¿äÇÕ´Ï´Ù. \n\n´Ù½Ã ¼³Ä¡ÇϽ÷Á¸é Ctrl + F5Å°¸¦ ´©¸£½Ã°Å³ª ¸Þ´ºÀÇ [º¸±â/»õ·Î°íħ]À» ¼±ÅÃÇÏ¿© ÁֽʽÿÀ."); return false; } break; } } } try { if(document.getElementById('agree_payment').style.display != 'none' && document.getElementById('check_agree_order').checked == false) { alert('±¸¸ÅÁøÇà µ¿ÀÇ¿¡ üũÇØ ÁÖ¼¼¿ä.'); return; } } catch (e) {} frm.action = paymentLink; frm.repeatChk.value = 1; frm.sslHiddenForm.value=frm.hiddenForm.value; // ssl ó¸® SSL.send({ 'formName':'payment' ,'elementName':['sslHiddenForm'] ,'postName':'sslEncode' }); return; } } function mothodChoice(method) { if(method == 'CARD') { document.getElementById('card').style.display = 'block'; document.getElementById('bank').style.display = 'none'; try { document.getElementById('agree_payment').style.display = 'none'; } catch (e) {} } else if(method == 'BANK') { document.getElementById('card').style.display = 'none'; document.getElementById('bank').style.display = 'block'; try { document.getElementById('agree_payment').style.display = 'block'; } catch (e) {} } } var vld = { setOptions: {}, continueObject: new Array('fm', 'target', 'action', 'method'), init: function(options) { // set Object.extend(this.setOptions, options || ''); for( field in this.setOptions ) { // check if( typeof field == null ) continue; if( this.continueObject.search(field) != -1 ) continue; // process if( this.check(field) == false ) return false; } if(private_info_agreement() == false) return false; switch(this.setOptions['mode']) { default: var f = this.setOptions.fm; f.method = this.setOptions.method || 'post'; f.target = this.setOptions.target || ''; f.action = this.setOptions.action || ''; if(typeof(gRelay) != "undefined") { gRelay.relayForm(f); } f.submit(); break; // ajax mode ÀÏ °æ¿ì Æû üũ¸¸ ÇÑ´Ù. case 'boolen': case 'ajax': return true; break; } return true; }, /** * check main process * @param {String} field üũÇÒ ¿ÀºêÁ§Æ® ¾ÆÀ̵ð * @return {Boolen} */ check: function(field) { // set var optValue = this.setOptions[field]['type']; switch(typeof optValue) { case 'object': for(var i = 0; i < optValue.length; i++) { switch(optValue[i]) { default: if( this.checkSwitch(field, optValue[i]) == false ) return false; break; // ¿ÜºÎ ÇÔ¼ö case 'func': if( this.callFunc(field) == false ) return false; break; // Á¤±ÔÇ¥Çö½Ä case 'match': if( this.checkMatch(field) == false ) return false; break; } } return true; break; case 'undefined': case 'string': default: return this.checkSwitch(field, optValue); break; } return true; }, /** * ¿ÜºÎ ÇÔ¼ö ½ÇÇà * @param {String} field id name * @return {Boolen} true / fasle */ callFunc: function(field) { switch(typeof this.setOptions[field]['func']) { case 'function': return this.setOptions[field]['func'](field, true); break; case 'object': default: for(var j = 0; j < this.setOptions[field]['func'].length; j++) { if( this.setOptions[field]['func'][j](field, true) == false ) return false; } break; } return true; }, /** * ±¸ºÐº° üũ ·çƾ * @param {String} field id name * @param {String} optValue ¿É¼Ç°ª * @return {Boolen} true / fasle */ checkSwitch: function(field, optValue) { // check case switch(optValue) { case 'length': return this.length(field); break; case 'email': return this.email(field); break; case 'digit': return this.digit(field); break; case 'radiobox': case 'checkbox': return this.box(field); break; case 'ssn': return this.ssn(field); break; case undefined: default: return this.checkDefault(field); break; } return true; }, /** * check default * @param {String} field id name * @return {Boolen} */ checkDefault: function(field) { // set var tarObj = document.getElementById(field); // process if( tarObj != null && tarObj.style.display != null && tarObj.style.display != 'none' && tarObj.parentNode.style.display != 'none' && tarObj.value == '' ) { switch( tarObj.tagName ) { case 'SELECT': var msg = printf('%s0À»(¸¦) ¼±ÅÃÇØÁֽʽÿÀ.', this.setOptions[field]['msg']); break; default: var msg = this.setOptions[field]['noSuffix'] ? printf('%s0', this.setOptions[field]['msg']): printf('%s0À»(¸¦) ÀÔ·ÂÇØÁֽʽÿÀ.', this.setOptions[field]['msg']); break; } if(this.setOptions[field]['check']==true) { alert(msg); this.focus(tarObj); return false; } } return true; }, /** * focus for object * @param {Object} tarObj * @return {Boolen} */ focus: function(tarObj) { switch(this.setOptions[field]['noSuffix']) { case true: return true; break; default: tarObj.focus(); break; } }, /** * check for RexExp * @param {String} field id name * @return {Boolen} */ checkMatch: function(field) { // set var tarObj = document.getElementById(field); // process var str = eval('/' + this.setOptions[field]['match'] + '/'); if( tarObj.value.match(str) != null ) { alert(this.setOptions[field]['msgMatch']); tarObj.focus(); return false; } return true; }, /** * check function length * @param {String} field id name * @return {Boolen} true / false */ length: function(field) { // set var tarObj = document.getElementById(field); // check default if( this.checkDefault(field) == false ) return false; // set var maxlength = this.setOptions[field]['maxlength']; var minlength = this.setOptions[field]['minlength']; if( typeof maxlength == 'undefined' || maxlength < 0 ) return false; if( typeof minlength == 'undefined' || minlength < 0 ) return false; // process if( tarObj.value.length < minlength || tarObj.value.length > maxlength ) { if(this.setOptions[field]['check']==true) { var msg = printf('%s0ÀÇ ±æÀÌ´Â %s1~%s2 À¸·Î Á¦ÇѵǾî ÀÖ½À´Ï´Ù.', this.setOptions[field]['msg'], minlength, maxlength); alert(msg); tarObj.focus(); return false; } } return true; }, /** * check email type * @param {String} field id name * @return {Boolen} true / false */ email: function(field) { // set var tarObj = document.getElementById(field); // check default if( this.checkDefault(field) == false ) return false; if( chkEmail(tarObj.value) == false ) { if(this.setOptions[field]['check']==true) { var msg = printf('%s0Çü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.', this.setOptions[field]['msg']); alert(msg); tarObj.focus(); return false; } } return true; }, /** * check number only * @param {String} field id name * @return {Boolen} true / false */ digit: function(field) { // set var tarObj = document.getElementById(field); // check default if( this.checkDefault(field) == false ) return false; if( chkNum(tarObj) == false ) { if(this.setOptions[field]['check']==true) { var msg = printf('%s0 Çü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.', this.setOptions[field]['msg']); this.tarObj.focus(); return false; } } return true; }, /** * check for radiobox checkbox * @param {String} field üũ or ¶óµð¿À¹Ú½º name * @return {Boolen} true / false */ box: function(field) { if( checkbox({name: field, mode: 'check'}) == false ) { if(this.setOptions[field]['check']==true) { var msg = printf("%s0À»(¸¦) ¼±ÅÃÇØ ÁֽʽÿÀ.", this.setOptions[field]['msg']); alert(msg); return false; } } return true; }, /** * check for jumin * @param {String} field id name * @param {Object} tarObj check object * @return {Boolen} true / false */ ssn: function(field) { // set var f = this.setOptions.fm; var arr = field.split(','); var obj = eval('f.' + arr[0]); var obj2 = eval('f.' + arr[1]); // check default if( this.checkDefault(arr[0]) == false ) return false; if( this.checkDefault(arr[1]) == false ) return false; // process if( ssn.init( obj.value.toString() + obj2.value.toString() ) == false ) { obj.focus(); return false; } return true; } } /** * üũ¹Ú½º checked °ü·Ã * ex) * @param {Object object} options {name:''[, mode: 'un or all or check or null']} * @return {Null} */ function checkbox(options) { var o = document.getElementsByName(options.name); if( o == null ) return; switch(o.length) { case 0: var chk = false; var o = document.getElementById(options.name); if( o == null ) return; if( o.checked == true ) var chk = true; switch(options.mode) { default: return chk; break; case 'val': return chk == true ? o.value : -1; break; } return false; break; default: for( var i = 0, stack = []; i < o.length; i++ ) { switch(options.mode) { default: o[i].checked =! o[i].checked; break; case 'un': o[i].checked = false; break; case 'all': o[i].checked = true; break; case 'check': if( o[i].checked == true ) var chk = true; break; case 'val': if( o[i].checked == true ) var val = i; break; case 'stack': if( o[i].checked == true ) stack.push(o[i].value); break; case 'key': if( o[i].checked == true ) var key = i; break; } } if( options.mode == 'check' && chk != true ) { if( typeof options.msg != 'undefined' ) alert(options.msg); return false; } else if( options.mode == 'val' ) { if(typeof val == 'undefined') return -1; return o[val].value; } else if( options.mode == 'stack' ) { return stack; } else if( options.mode == 'key' ) { if(typeof key == 'undefined') return -1; return key; } break; } } /** * ¿ÀºêÁ§Æ® È®Àå * @param {Object} destination * @param {Object} source * @return {Object} */ Object.extend = function(destination, source) { for(var property in source) { destination[property] = source[property]; } return destination; } /** * sprint ÇÔ¼ö javascript version * @param {String} lang * @return {String} */ function printf(lang) { var args = printf.arguments; for( var i = 0; i < args.length; i++ ) { if( typeof args[i + 1] == 'undefined' ) continue; lang = lang.replace('%s' + i, args[i + 1]); } return lang; } /** * À̸ÞÀÏüũ * @param {String} strValue * @return {Null} */ function chkEmail(strValue) { if((strValue.length != 0) && (strValue.search(/(\S+)@(\S+)\.(\S+)/) == -1)) return false; else return true; } /** * ¼ýÀÚüũ * @param {String} strValue * @return {Null} */ function chkNum(inputname) { var formstr=eval(inputname); for(var i = 0;i'9') && chr!='-' && chr!='_') { return false; } } return true; } /** * ÁֹιøÈ£ üũ ssn.init(ÁֹιøÈ£°ª13ÀÚ¸®) * @param String juminno ÁֹιøÈ£°ª13ÀÚ¸® * @return Boolen */ var ssn = { juminno: null, init: function(juminno) { this.juminno = juminno; if( this.juminno=="" || this.juminno==null ) { alert("Áֹεî·Ï¹øÈ£¸¦ Àû¾îÁֽʽÿÀ."); return false; } var jumin1 = this.juminno.substr(0,6); var jumin2 = this.juminno.substr(6,7); var yy = jumin1.substr(0,2); // ³âµµ var mm = jumin1.substr(2,2); // ¿ù var dd = jumin1.substr(4,2); // ÀÏ var genda = jumin2.substr(0,1); // ¼ºº° var msg, ss, cc; // ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì if( this.isNumeric(jumin1) == false ) { alert("Áֹεî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇϽʽÿÀ."); return false; } // ±æÀÌ°¡ 6ÀÌ ¾Æ´Ñ °æ¿ì if( jumin1.length != 6 ) { alert("Áֹεî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϽʽÿÀ."); return false; } // ù¹ø° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ±âº» ±¸¼º °Ë»ç if(yy < "00" || yy > "99" || mm < "01" || mm > "12" || dd < "01" || dd > "31") { alert("Áֹεî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϽʽÿÀ."); return false; } // ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì if( this.isNumeric(jumin2) == false ) { alert("Áֹεî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇϽʽÿÀ."); return false; } // ±æÀÌ°¡ 7ÀÌ ¾Æ´Ñ °æ¿ì if( jumin2.length != 7 ) { alert("Áֹεî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϽʽÿÀ."); return false; } // ¼ºº°ºÎºÐÀÌ 1 ~ 4 °¡ ¾Æ´Ñ °æ¿ì if( genda < "1" || genda > "4" ) { alert("Áֹεî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϽʽÿÀ."); return false; } // ¿¬µµ °è»ê - 1 ¶Ç´Â 2: 1900³â´ë, 3 ¶Ç´Â 4: 2000³â´ë cc = (genda == "1" || genda == "2") ? "19" : "20"; // ù¹ø° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ³¯Â¥ Çü½Ä °Ë»ç if( this.isYYYYMMDD(parseInt(cc+yy), parseInt(mm), parseInt(dd)) == false ) { alert("Áֹεî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϽʽÿÀ."); return false; } // Check Digit °Ë»ç if( this.isSSN(jumin1, jumin2) == false ) { alert("ÀÔ·ÂÇÑ Áֹεî·Ï¹øÈ£¸¦ °ËÅäÇÑ ÈÄ, ´Ù½Ã ÀÔ·ÂÇϽʽÿÀ."); return false; } return true; }, isYYYYMMDD: function(y, m, d) { switch(m) { // 2¿ùÀÇ °æ¿ì case 2: if(d > 29) return false; // 2¿ù 29ÀÇ °æ¿ì ´çÇØ°¡ À±³âÀÎÁö¸¦ È®ÀÎ if(d == 29) { if((y % 4 != 0) || (y % 100 == 0) && (y % 400 != 0)) return false; } break; // ÀÛÀº ´ÞÀÇ °æ¿ì case 4: case 6: case 9: case 11: if(d == 31) return false; } // Å« ´ÞÀÇ °æ¿ì return true; }, // ¼ýÀÚüũ isNumeric: function(s) { var c = ''; for(var i = 0; i "9") return false; } return true; }, // ÁֹιøÈ£ isSSN: function(s1, s2) { var c = ''; n = 2; sum = 0; for (var i = 0; i