var userAgent=navigator.userAgent.toLowerCase();var browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var Common={browserCheck:function(){var result='';switch(navigator.appName){case'Netscape':result='FF';break;default:result='IE';break}return result},int:function(v){return parseInt(v)},str:function(v){return String(v)},addEvent:function(obj,evt,fn){switch(__BR__){case'IE':obj.attachEvent(evt,fn);break;default:evt=evt.replace('on','');obj.addEventListener(evt,fn,true);break}},delEvent:function(obj,evt,fn){switch(__BR__){case'IE':obj.detachEvent(evt,fn);break;default:evt=evt.replace('on','');obj.removeEventListener(evt,fn,true);break}},getObj:function(obj_name,mode){var result='';switch(mode){case'name':result=document.getElementsByName(obj_name);break;case'tagname':result=document.getElementsByTagName(obj_name);break;default:result=document.getElementById(obj_name);break}return result},brWidthHeight:function(){var result=new Array();var win_width=0;var win_height=0;var scroll_width=0;var scroll_height=0;switch(__BR__){case'IE':win_width=document.documentElement.clientWidth;win_height=document.documentElement.clientHeight;scroll_width=document.body.scrollLeft==0?document.documentElement.scrollLeft:document.body.scrollLeft;scroll_height=document.body.scrollTop==0?document.documentElement.scrollTop:document.body.scrollTop;break;case'FF':default:win_width=Common.int(self.innerWidth);win_height=Common.int(self.innerHeight);scroll_width=Common.int(self.pageXOffset);scroll_height=Common.int(self.pageYOffset);break}result['win_width']=win_width;result['win_height']=win_height;result['scroll_width']=scroll_width;result['scroll_height']=scroll_height;return result},rand:function(num){var index='';var result='';var r=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'];var count=r.length;for(var x=0;x3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"")},trim:function(str,charlist){var whitespace,l=0,i=0;str+='';if(!charlist){whitespace=" \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000"}else{charlist+='';whitespace=charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'\$1')}l=str.length;for(i=0;i=0;i--){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(0,i+1);break}}return whitespace.indexOf(str.charAt(0))===-1?str:''},thisFileName:function(){var len=location.href.indexOf('?');return location.href.substring(0,len)},getParam:function(key){var result=null;var len=location.href.indexOf(key);if(len>0){var params=location.href.substring(len,location.href.length);var ex_params1=params.split('=');if(ex_params1[1].indexOf('&')==0){result=''}else if(ex_params1[1].indexOf('&')>0){var ex_params2=ex_params1[1].split('&');result=ex_params2[0]}else{result=ex_params1[1]}return result}},setCookie:function(cookieName,cookieVal,time){var date=new Date();var lifeTime=0;if(time){lifeTime=date.setDate((date.getTime()+1000*60*60*24*365)+time);document.cookie=cookieName+'='+escape(cookieVal)+'; expires='+lifeTime}else{document.cookie=cookieName+'='+escape(cookieVal)}},getCookie:function(cookieName){var result=null;var allCookies=document.cookie.split('; ');var cookieArray=null;for(i=0;i';Common.getObj('ajax_loding').style.zIndex=1000;Common.getObj('ajax_loding').style.position='absolute';Common.getObj('ajax_loding').style.top=this.sc_height+'px';Common.getObj('ajax_loding').style.left=this.sc_width+'px';Common.getObj('ajax_loding').innerHTML=this.div_html}}this.ajaxCreate();return this.ajaxSend()},ajaxCreate:function(){switch(__BR__){case'IE':this.req=new ActiveXObject("Microsoft.XMLHTTP");break;default:this.req=new XMLHttpRequest();break}},ajaxSend:function(){if(this.loding_chk==true){if(typeof Common.getObj('ajax_loding')=='object'){if(Common.getObj('ajax_loding').style.display=='none'){Common.getObj('ajax_loding').style.display=''}}}switch(__BR__){case'IE':if(this.file.indexOf('?')>0){this.file+=(this.type=='POST')?'&charset=utf-8':'&charset=euc-kr'}else{this.file+=(this.type=='POST')?'?charset=utf-8':'?charset=euc-kr'}break;default:this.file+=(this.file.indexOf('?')>0)?'&charset=utf-8':'?charset=utf-8';break}this.req.open(this.type,this.file,this.async);if(this.type=='POST')this.req.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');this.req.send(this.param);var obj=this;this.req.onreadystatechange=function(){return obj.ajaxCallBackFunction(obj.req)}},ajaxCallBackFunction:function(req){if(this.req.readyState==4){if(this.req.status==200){if(this.loding_chk==true){if(typeof Common.getObj('ajax_loding')=='object'){if(Common.getObj('ajax_loding').style.display==''){Common.getObj('ajax_loding').style.display='none'}}}if(this.function_name){return this.function_name(req)}}}},rltXml:function(req){if(typeof(this.req)!='undefined'){req=this.req}return req.responseXML},rltText:function(req){if(typeof(this.req)!='undefined'){req=this.req}return req.responseText},rltXmlLoop:function(obj,tag){var xmlObj=obj.getElementsByTagName(tag);return xmlObj},rltXmlOnce:function(obj,tag){var result;var obj=obj.getElementsByTagName(tag);if(obj[0]){result=obj[0].firstChild.nodeValue}else{return false}return result},encode:function(data){return encodeURIComponent(data)},decode:function(data){return decodeURIComponent(data)},value:function(obj_name,num){var result='';if(num){result=Common.getObj(obj_name,'name')[num-1].name+'='+Common.getObj(obj_name,'name')[num-1].value+'&'}else{result=Common.getObj(obj_name).id+'='+Common.getObj(obj_name).value+'&'}return result},post:function(form_name){if(!form_name){alert('폼이름이 없습니다.');return false}var result='';var item='';var item_name='';var obj_form=document.forms[form_name];var count=obj_form.length;for(var x=0;x0){this.ex_len=this.len.split('-');this.min=this.ex_len[0];this.max=this.ex_len[1];if(this.min==this.max){this.len_chk=" || this.item.value.length != "+this.min}else{this.len_chk=" || this.item.value.length < "+this.min+" || this.item.value.length > "+this.max}if(typeof(this.min)!='undefined'||typeof(this.max)!='undefined'){this.len_text=" ["+this.min+" ~ "+this.max+" 글자]"}}}if(this.checkcount){this.chk_cnt="if(chk < "+this.checkcount+") {";this.chk_cnt+="alert('"+this.msg+"을(를) "+this.checkcount+"개 이상 선택해주세요.');";this.chk_cnt+="this.ret_chk = true;";this.chk_cnt+="}"}else{this.chk_cnt="if(chk < 1) {";this.chk_cnt+="alert('"+this.msg+"을(를) 선택해주세요.');";this.chk_cnt+="this.ret_chk = true;";this.chk_cnt+="}"}switch(this.kind){default:if(this.item.name=='description'&&this.item.style.display=='none'){if(__BR__=='IE'){if(Common.getObj('description_ifr').style.display=='none'){this.result+="if(Common.getObj('description_txt').value == '') {"}else{this.result+="if(Common.getObj('description_ifr').contentWindow.document.body.innerHTML == '' || Common.getObj('description_ifr').contentWindow.document.body.innerHTML == '<p>&nbsp;</p>') {"}this.result+="alert('"+this.msg+"을(를) 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}"}}else{this.result="if("+this.first+"Common.trim(this.item.value) == ''"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}"}break;case'float':this.result="var num_pattern = /(^[0-9]+)\.([0-9]+$)/gi;";this.result+="if("+this.first+"!num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 숫자와 소숫점으로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'num':this.result="var num_pattern = /(^[0-9]+$)/gi;";this.result+="if("+this.first+"!num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 숫자로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'eng':this.result="var eng_pattern = /(^[a-zA-Z]+$)/gi;";this.result+="if("+this.first+"!eng_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 영어로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'kor':this.result="var kor_pattern = /(^[가-힣]+$)/gi;";this.result+="if("+this.first+"!kor_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 한글로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'eng+kor+num':this.result="var eng_kor_num_pattern = /(^[a-zA-Z0-9가-힣]+$)/gi;";this.result+="if("+first+"!eng_kor_num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 영어,한글,숫자로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'num+eng':case'eng+num':this.result="var eng_num_pattern = /(^[a-zA-Z0-9]+$)/gi;";this.result+="if("+this.first+"!eng_num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 숫자 및 영어로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'num+eng2':this.result="var eng_num_pattern = /(^[a-z0-9]+$)/gi;";this.result+="if("+this.first+"!eng_num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 숫자 및 영어로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'email':this.result="var email_pattern = /([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/;";this.result+="if("+this.first+"!email_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'checkbox':this.result="var obj = Common.getObj('"+this.item.name+"', 'name');";this.result+="var count = obj.length;";this.result+="var chk = 0;";this.result+="for(var c=0; c'||Common.getObj('description_ifr').contentWindow.document.body.innerHTML=='
'){alert('내용을 입력해주세요.');return false}}}}if(x==this.count)return true}, //var userAgent=navigator.userAgent.toLowerCase();var browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var Common={browserCheck:function(){var result='';switch(navigator.appName){case'Netscape':result='FF';break;default:result='IE';break}return result},int:function(v){return parseInt(v)},str:function(v){return String(v)},addEvent:function(obj,evt,fn){switch(__BR__){case'IE':obj.attachEvent(evt,fn);break;default:evt=evt.replace('on','');obj.addEventListener(evt,fn,true);break}},delEvent:function(obj,evt,fn){switch(__BR__){case'IE':obj.detachEvent(evt,fn);break;default:evt=evt.replace('on','');obj.removeEventListener(evt,fn,true);break}},getObj:function(obj_name,mode){var result='';switch(mode){case'name':result=document.getElementsByName(obj_name);break;case'tagname':result=document.getElementsByTagName(obj_name);break;default:result=document.getElementById(obj_name);break}return result},brWidthHeight:function(){var result=new Array();var win_width=0;var win_height=0;var scroll_width=0;var scroll_height=0;switch(__BR__){case'IE':win_width=document.documentElement.clientWidth;win_height=document.documentElement.clientHeight;scroll_width=document.body.scrollLeft==0?document.documentElement.scrollLeft:document.body.scrollLeft;scroll_height=document.body.scrollTop==0?document.documentElement.scrollTop:document.body.scrollTop;break;case'FF':default:win_width=Common.int(self.innerWidth);win_height=Common.int(self.innerHeight);scroll_width=Common.int(self.pageXOffset);scroll_height=Common.int(self.pageYOffset);break}result['win_width']=win_width;result['win_height']=win_height;result['scroll_width']=scroll_width;result['scroll_height']=scroll_height;return result},rand:function(num){var index='';var result='';var r=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'];var count=r.length;for(var x=0;x3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"")},trim:function(str,charlist){var whitespace,l=0,i=0;str+='';if(!charlist){whitespace=" \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000"}else{charlist+='';whitespace=charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'\$1')}l=str.length;for(i=0;i=0;i--){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(0,i+1);break}}return whitespace.indexOf(str.charAt(0))===-1?str:''},thisFileName:function(){var len=location.href.indexOf('?');return location.href.substring(0,len)},getParam:function(key){var result=null;var len=location.href.indexOf(key);if(len>0){var params=location.href.substring(len,location.href.length);var ex_params1=params.split('=');if(ex_params1[1].indexOf('&')==0){result=''}else if(ex_params1[1].indexOf('&')>0){var ex_params2=ex_params1[1].split('&');result=ex_params2[0]}else{result=ex_params1[1]}return result}},setCookie:function(cookieName,cookieVal,time){var date=new Date();var lifeTime=0;if(time){lifeTime=date.setDate((date.getTime()+1000*60*60*24*365)+time);document.cookie=cookieName+'='+escape(cookieVal)+'; expires='+lifeTime}else{document.cookie=cookieName+'='+escape(cookieVal)}},getCookie:function(cookieName){var result=null;var allCookies=document.cookie.split('; ');var cookieArray=null;for(i=0;i';Common.getObj('ajax_loding').style.zIndex=1000;Common.getObj('ajax_loding').style.position='absolute';Common.getObj('ajax_loding').style.top=this.sc_height+'px';Common.getObj('ajax_loding').style.left=this.sc_width+'px';Common.getObj('ajax_loding').innerHTML=this.div_html}}this.ajaxCreate();return this.ajaxSend()},ajaxCreate:function(){switch(__BR__){case'IE':this.req=new ActiveXObject("Microsoft.XMLHTTP");break;default:this.req=new XMLHttpRequest();break}},ajaxSend:function(){if(this.loding_chk==true){if(typeof Common.getObj('ajax_loding')=='object'){if(Common.getObj('ajax_loding').style.display=='none'){Common.getObj('ajax_loding').style.display=''}}}switch(__BR__){case'IE':if(this.file.indexOf('?')>0){this.file+=(this.type=='POST')?'&charset=utf-8':'&charset=euc-kr'}else{this.file+=(this.type=='POST')?'?charset=utf-8':'?charset=euc-kr'}break;default:this.file+=(this.file.indexOf('?')>0)?'&charset=utf-8':'?charset=utf-8';break}this.req.open(this.type,this.file,this.async);if(this.type=='POST')this.req.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');this.req.send(this.param);var obj=this;this.req.onreadystatechange=function(){return obj.ajaxCallBackFunction(obj.req)}},ajaxCallBackFunction:function(req){if(this.req.readyState==4){if(this.req.status==200){if(this.loding_chk==true){if(typeof Common.getObj('ajax_loding')=='object'){if(Common.getObj('ajax_loding').style.display==''){Common.getObj('ajax_loding').style.display='none'}}}if(this.function_name){return this.function_name(req)}}}},rltXml:function(req){if(typeof(this.req)!='undefined'){req=this.req}return req.responseXML},rltText:function(req){if(typeof(this.req)!='undefined'){req=this.req}return req.responseText},rltXmlLoop:function(obj,tag){var xmlObj=obj.getElementsByTagName(tag);return xmlObj},rltXmlOnce:function(obj,tag){var result;var obj=obj.getElementsByTagName(tag);if(obj[0]){result=obj[0].firstChild.nodeValue}else{return false}return result},encode:function(data){return encodeURIComponent(data)},decode:function(data){return decodeURIComponent(data)},value:function(obj_name,num){var result='';if(num){result=Common.getObj(obj_name,'name')[num-1].name+'='+Common.getObj(obj_name,'name')[num-1].value+'&'}else{result=Common.getObj(obj_name).id+'='+Common.getObj(obj_name).value+'&'}return result},post:function(form_name){if(!form_name){alert('폼이름이 없습니다.');return false}var result='';var item='';var item_name='';var obj_form=document.forms[form_name];var count=obj_form.length;for(var x=0;x0){this.ex_len=this.len.split('-');this.min=this.ex_len[0];this.max=this.ex_len[1];if(this.min==this.max){this.len_chk=" || this.item.value.length != "+this.min}else{this.len_chk=" || this.item.value.length < "+this.min+" || this.item.value.length > "+this.max}if(typeof(this.min)!='undefined'||typeof(this.max)!='undefined'){this.len_text=" ["+this.min+" ~ "+this.max+" 글자]"}}}if(this.checkcount){this.chk_cnt="if(chk < "+this.checkcount+") {";this.chk_cnt+="alert('"+this.msg+"을(를) "+this.checkcount+"개 이상 선택해주세요.');";this.chk_cnt+="this.ret_chk = true;";this.chk_cnt+="}"}else{this.chk_cnt="if(chk < 1) {";this.chk_cnt+="alert('"+this.msg+"을(를) 선택해주세요.');";this.chk_cnt+="this.ret_chk = true;";this.chk_cnt+="}"}switch(this.kind){default:if(this.item.name=='description'&&Common.getObj('description').style.display=='none'){if(__BR__=='IE'){if(Common.getObj('description_ifr').style.display=='none'){this.result+="if(Common.getObj('description_txt').value == '') {"}else{this.result+="if(Common.getObj('description_ifr').contentWindow.document.body.innerHTML == '' || Common.getObj('description_ifr').contentWindow.document.body.innerHTML == '<p>&nbsp;</p>') {"}this.result+="alert('"+this.msg+"을(를) 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}"}}else{this.result="if("+this.first+"Common.trim(this.item.value) == ''"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}"}break;case'float':this.result="var num_pattern = /(^[0-9]+)\.([0-9]+$)/gi;";this.result+="if("+this.first+"!num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 숫자와 소숫점으로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'num':this.result="var num_pattern = /(^[0-9]+$)/gi;";this.result+="if("+this.first+"!num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 숫자로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'eng':this.result="var eng_pattern = /(^[a-zA-Z]+$)/gi;";this.result+="if("+this.first+"!eng_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 영어로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'kor':this.result="var kor_pattern = /(^[가-힣]+$)/gi;";this.result+="if("+this.first+"!kor_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 한글로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'eng+kor+num':this.result="var eng_kor_num_pattern = /(^[a-zA-Z0-9가-힣]+$)/gi;";this.result+="if("+first+"!eng_kor_num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 영어,한글,숫자로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'num+eng':case'eng+num':this.result="var eng_num_pattern = /(^[a-zA-Z0-9]+$)/gi;";this.result+="if("+this.first+"!eng_num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 숫자 및 영어로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'num+eng2':this.result="var eng_num_pattern = /(^[a-z0-9]+$)/gi;";this.result+="if("+this.first+"!eng_num_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 숫자 및 영어로만 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'email':this.result="var email_pattern = /([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/;";this.result+="if("+this.first+"!email_pattern.test(this.item.value)"+this.len_chk+")) {";this.result+="alert('"+this.msg+"을(를) 정확히 입력하세요."+this.len_text+"');";this.result+="this.ret_chk = true;";this.result+="}";break;case'checkbox':this.result="var obj = Common.getObj('"+this.item.name+"', 'name');";this.result+="var count = obj.length;";this.result+="var chk = 0;";this.result+="for(var c=0; c'||Common.getObj('description_ifr').contentWindow.document.body.innerHTML=='
'){alert('내용을 입력해주세요.');return false}}}}if(x==this.count)return true}, /*juminNumberChk:function(jumin_number){alert(jumin_number);jumin_number=jumin_number.replace('-','');if(jumin_number.length>13)return false;var last=jumin_number.substring(13,12);var val=0;for(var i=0;i<12;i++)val+=(i%8+2)*jumin_number.substring(i,i+1);val=(11-(val%11))%10;if(parseInt(val)!=parseInt(jumin_number.substring(12,13))){return false}else{return true}}};*/ /** * 등록번호 체크(주민등록번호,법인번호,여권번호,외국인등록번호) * @param jumin_number 000000-0000000 */ bRegNumberChk : function(number) { number = number.replace('-', ''); var rtnType = this.getRegNoType('ssn'); if(rtnType>0) { switch(rtnType) { case '1' : return this.bRegNumberChk01(number); break; case '2' : return this.bRegNumberChk02(number); break; case '3' : if(number.length==9) { return this.bRegNumberChk03(number); } else { return this.bRegNumberChk04(number); } } return false; } else { if(number.length==13) { if(this.bRegNumberChk01(number)==true) return true; if(this.bRegNumberChk02(number)==true) return true; } else { if(this.bRegNumberChk03(number)==true) return true; if(this.bRegNumberChk04(number)==true) return true; } return false; } }, /** * 주민등록번호/외국인등록번호/여권번호/법인번호 선택 확인 (이주영, 2009-10-13) * @param code = "ssn" * @return : 1 주민등록번호, 2 법인번호, 3 여권번호, 4 외국인등록번호 */ getRegNoType : function(code) { var rtnType = "-1"; var type = document.getElementsByName(code + '_type'); for(var i=0; i '9') { digit = digit + 1 } } if ((str_serial1 == '') || (digit != 0)) { return false; } var digit1 = 0 for (var i = 0; i < str_serial2.length; i++) { var str_dig1 = str_serial2.substring(i, i + 1); if (str_dig1 < '0' || str_dig1 > '9') { digit1 = digit1 + 1 } } if ((str_serial2 == '') || (digit1 != 0)) { return false; } if (str_serial1.substring(2, 3) > 1) { return false; } if (str_serial1.substring(4, 5) > 3) { return false; } if (str_serial2.substring(0, 1) > 4 || str_serial2.substring(0, 1) == 0) { return false; } var a1 = str_serial1.substring(0, 1) var a2 = str_serial1.substring(1, 2) var a3 = str_serial1.substring(2, 3) var a4 = str_serial1.substring(3, 4) var a5 = str_serial1.substring(4, 5) var a6 = str_serial1.substring(5, 6) var check_digit = a1 * 2 + a2 * 3 + a3 * 4 + a4 * 5 + a5 * 6 + a6 * 7 var b1 = str_serial2.substring(0, 1) var b2 = str_serial2.substring(1, 2) var b3 = str_serial2.substring(2, 3) var b4 = str_serial2.substring(3, 4) var b5 = str_serial2.substring(4, 5) var b6 = str_serial2.substring(5, 6) var b7 = str_serial2.substring(6, 7) var check_digit = check_digit + b1 * 8 + b2 * 9 + b3 * 2 + b4 * 3 + b5 * 4 + b6 * 5 check_digit = check_digit % 11 check_digit = 11 - check_digit check_digit = check_digit % 10 if (check_digit != b7) { return false; } return true; }, /** * 법인번호 체크 * @param number 000000-0000000 */ bRegNumberChk02 : function(number) { if(number.length != 13) return false; if(number == '0000000000000') return false; var szChkDgt = new Array(1,2,1,2,1,2,1,2,1,2,1,2); var szCoNo = number; var lV1 = 0; var nV2 = 0; var nV3 = 0; for(var i = 0; i < 12; i++) { lV1 = parseInt(szCoNo.substring(i,i+1)) * szChkDgt[i]; if(lV1 >= 10) { nV2 += lV1 % 10; } else { nV2 += lV1; } } nV3 = nV2 % 10; if(nV3 > 0) { nV3 = 10 - nV3; } else { nV3 = 0; } if(szCoNo.substring(12,13) != nV3) { return false; } else { return true; } }, /** * 여권번호 체크 * @param number NN0000000 or N00000000 */ bRegNumberChk03 : function(number) { if(number.length != 9) return false; var zone = number.substring(0, 1); var no1 = number.substring(1, 9); var no2 = number.substring(2, 9); if (isNaN(no1) && isNaN(no2)) { return false; } else { return true; } return false; }, /** * 외국인등록번호 체크 * @param number 000000-0000000 */ bRegNumberChk04 : function(number) { if(number.length != 13) return false; var sum = 0; var odd = 0; var buf = new Array(13); for (i = 0; i < 13; i++) { buf[i] = parseInt(number.charAt(i)); } odd = buf[7]*10 + buf[8]; if (odd%2 != 0) { return false; } if ((buf[11] != 6)&&(buf[11] != 7)&&(buf[11] != 8)&&(buf[11] != 9)) { return false; } var multipliers = [2,3,4,5,6,7,8,9,2,3,4,5]; for (i = 0, sum = 0; i < 12; i++) { sum += (buf[i] *= multipliers[i]); } sum = 11 - (sum%11); if (sum>=10) sum -= 10; sum += 2; if (sum>=10) sum -= 10; if (sum != buf[12]) { return false; } else { return true; } } }; /** * ================================================================================ * 카드 결재 관련 * ================================================================================ */ var Payment = {}; Payment.main = function(form_name, url) { if(typeof(Common.getObj('iframe_payment', 'name')[0]) == 'object') { this.form = document.forms[form_name]; this.form.action = url; this.form.target = 'iframe_payment'; if(typeof(gRelay) != "undefined") { gRelay.relayForm(this.form); } this.form.submit(); } else { alert('결제시 필요한 iframe 태그가 없습니다. 관리자에게 문의 하세요.'); return false; } }; /** * ================================================================================ * SSL 전송 * ================================================================================ */ function loadScript(url, callback) { var script = document.createElement("script"); script.type = "text/javascript"; if (script.readyState){ //IE script.onreadystatechange = function(){ if (script.readyState == "loaded" || script.readyState == "complete"){ script.onreadystatechange = null; if( typeof callback == 'undefined' ) return; callback(); } }; } else { //Others script.onload = function(){ if( typeof callback == 'undefined' ) return; callback(); }; } script.src = url; //document.getElementsByTagName("head")[0].appendChild(script); document.body.appendChild(script); } var SSL = { oForm : null ,aElement : null ,bCheckSend : false ,sPostName : null ,'send' : function(oSSLParams) { if (typeof Array.prototype.search == 'function') delete Array.prototype.search; if(oSSLParams.formName) { this.oForm = eval('document.'+oSSLParams.formName); } else if(oSSLParams.idName) { this.oForm = document.getElementById(oSSLParams.idName); } this.aElement = oSSLParams.elementName; this.sPostName = oSSLParams.postName; var self = this; loadScript('https://login2.simplexi.com/crypt/AuthSSLManager.js', function() { try { AuthSSLManager.weave({ 'auth_mode': 'encrypt' , 'aEleId': self.aElement , 'auth_callbackName': 'SSL.encrypt' }); } catch(e) { alert('body 태그가 없습니다. 고객센터에 문의해 주시기 바랍니다.'); return false; } }); } ,'encrypt' : function(sEncrypt) { if(AuthSSLManager.isError(sEncrypt) == true) { alert('SSL 전송을 하지 못했습니다. 고객센터에 문의해 주시기 바랍니다.'); return false; } else { var count = this.aElement.length; for(var x=0; x0){for(var i=0;i0){runAjax[k]=importAjax[j].replace(/.js/,'');k++}}}}}var f=0;for(var t=0;t0){ajaxformmailProcess()}}