String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.ltrim = function() { return this.replace(/(^\s*)/, ""); } String.prototype.rtrim = function() { return this.replace(/(\s*$)/, ""); } String.prototype.isNum = function() { return (/^[0-9]+$/).test(this.remove(arguments[0])) ? true : false; } String.prototype.num = function() { return (this.trim().replace(/[^0-9]/g, "")); } String.prototype.isBlank = function() { var str = this.trim(); for(var i = 0; i < str.length; i++) { if ((str.charAt(i) != "\t") && (str.charAt(i) != "\n") && (str.charAt(i)!="\r")) { return false; } } return true; } String.prototype.isJumin = function() { var arg = arguments[0] ? arguments[0] : ""; var jumin = eval("this.match(/[0-9]{2}[01]{1}[0-9]{1}[0123]{1}[0-9]{1}" + arg + "[1234]{1}[0-9]{6}$/)"); if(jumin == null) { return false; } else { jumin = jumin.toString().num().toString(); } // »ý³â¿ùÀÏ Ã¼Å© var birthYY = (parseInt(jumin.charAt(6)) == (1 ||2)) ? "19" : "20"; birthYY += jumin.substr(0, 2); var birthMM = jumin.substr(2, 2) - 1; var birthDD = jumin.substr(4, 2); var birthDay = new Date(birthYY, birthMM, birthDD); if(birthDay.getYear() % 100 != jumin.substr(0,2) || birthDay.getMonth() != birthMM || birthDay.getDate() != birthDD) { return false; } var sum = 0; var num = [2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5] var last = parseInt(jumin.charAt(12)); for(var i = 0; i < 12; i++) { sum += parseInt(jumin.charAt(i)) * num[i]; } return ((11 - sum % 11) % 10 == last) ? true : false; } String.prototype.isEmail = function() { return (/\w+([-+.]\w+)*@\w+([-.]\w+)*\.[a-zA-Z]{2,4}$/).test(this.trim()); } String.prototype.isNum = function() { return (/^[0-9]+$/).test(this.remove(arguments[0])) ? true : false; } String.prototype.isPhone = function() { var arg = arguments[0] ? arguments[0] : ""; return eval("(/(02|0[3-9]{1}[0-9]{1})" + arg + "[1-9]{1}[0-9]{2,3}" + arg + "[0-9]{4}$/).test(this)"); } String.prototype.isMobile = function() { var arg = arguments[0] ? arguments[0] : ""; return eval("(/01[016789]" + arg + "[1-9]{1}[0-9]{2,3}" + arg + "[0-9]{4}$/).test(this)"); } String.prototype.replaceAll = function(str1, str2) { var temp_str = ""; if (this.trim() != "" && str1 != str2) { temp_str = this.trim(); while (temp_str.indexOf(str1) > -1){ temp_str = temp_str.replace(str1, str2); } } return temp_str; } /* °øÁö»çÇ× ½ºÅ©·Ñ¸µ*/ function scrolling(objId,sec1,sec2,speed,height){ this.objId=objId; this.sec1=sec1; this.sec2=sec2; this.speed=speed; this.height=height; this.h=0; this.div=document.getElementById(this.objId); this.htmltxt=this.div.innerHTML; this.div.innerHTML=this.htmltxt+this.htmltxt; this.div.isover=false; this.div.onmouseover=function(){this.isover=true;} this.div.onmouseout=function(){this.isover=false;} var self=this; this.div.scrollTop=0; window.setTimeout(function(){self.play()},this.sec1); } scrolling.prototype={ play: function(){ var self=this; if(!this.div.isover){ this.div.scrollTop+=this.speed; if(this.div.scrollTop>this.div.scrollHeight/2) this.div.scrollTop=0; else { this.h+=this.speed; if(this.h>=this.height){ if(this.h>this.height|| this.div.scrollTop%this.height !=0){ this.div.scrollTop-=this.h%this.height; } this.h=0; window.setTimeout(function(){self.play()},this.sec1); return; } } } window.setTimeout(function(){self.play()},this.sec2); }, prev: function(){ if(this.div.scrollTop == 0) this.div.scrollTop = this.div.scrollHeight/2; this.div.scrollTop -= this.height; }, next:function(){ if(this.div.scrollTop == this.div.scrollHeight/2) this.div.scrollTop =0; this.div.scrollTop += this.height; } }; /* °øÁö»çÇ× ½ºÅ©·Ñ¸µ*/ function viewMessage(){ var msgView = window.open('/message/view.php', 'mymessage', 'width=450,height=400,scrollbars=yes'); if(msgView.focus) msgView.focus(); return; } function checkTotalSearchForm(){ if(document.getElementById('totalSearchKeyword').value.isBlank()){ alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.'); document.getElementById('totalSearchKeyword').focus(); return false; } } function mf(s,d,w,h,t){ return ""; } // write document contents function documentwrite(src){ document.write(src); } // assign code innerHTML function setcode(target, code){ target.innerHTML = code; }