/** * @projectDescription °øÅë ¶óÀ̺귯¸® ¸ðÀ½ * * @author ¹Ú³­ÇÏ nanhap@gmail.com * @version 1.0 * @sdoc null * @date 2007-02-22 ¿ÀÈÄ 4:27 */ // ¹®ÀÚ¿­ ÇÁ·ÎÅäŸÀÔ String.prototype.ltrim = new Function("return this.replace(/^\\s+/,'')"); // trim left String.prototype.rtrim = new Function("return this.replace(/\\s+$/,'')"); // trim right String.prototype.trim = new Function("return this.replace(/^\\s+|¦Æ|\\s+$/g,'')"); // trim both String.prototype.strip = new Function("return this.replace(/^\s+/, '').replace(/\s+$/, '')"); String.prototype.number_format = function() { return this.replace(/(\d)(?=(?:\d{3})+(?!\d))/g,'$1,'); } // ¹®ÀÚ¿­ ű×Á¦°Å String.prototype.stripTag = function() { return this.replace(/<[^>]+>/g, ''); } String.prototype.toArray = new Function("return this.split('')"); Array.prototype.each = function(iterator) { for(var i = 0, length = this.length; i < length; i++) iterator(this[i]); } // ¹è¿­¿¡ °Ë»öÇÑ °ªÀÌ ÀÖÀ¸¸é À妽º ¹øÈ£¸¦ ¸®ÅÏ, ¾øÀ¸¸é -1À» ¸®ÅÏ Array.prototype.search = function(val) { var len = this.length; for (var i = 0; i < len; i++) { if(this[i].trim() == val.trim()) return i; } return -1; } // ¹è¿­ÀÇ °¢ ¿ä¼Ò¿¡ °°Àº ÇÔ¼ö Àû¿ë // ¸¸¾à, funcName À̶ó´Â ÇÔ¼ö°¡ ÀÖ´Ù°í Çϸé, Array.walk(funcName)°ú °°ÀÌ »ç¿ëÇÑ´Ù. // ÇÔ¼öÀÇ Ã¹¹ø° Àü´ÞÀÚ¿¡ °ªÀÌ, µÎ¹ø° Àü´ÞÀÚ¿¡ À妽º°¡ Àü´ÞµÈ´Ù. Array.prototype.walk = function(Func) { var len = this.length; for (var i = 0; i val ) { val = this[i]; } } } return val; } /** * ¹è¿­ ¿ÀºêÁ§Æ®¿¡¼­ °¡Àå ÀÛÀº°ª ±¸Çϱâ * @param {Null} * @return {Number} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-26 */ Array.prototype.min = function() { var val; for( var i = 0; i < this.length; i++ ) { if( typeof val == 'undefined' ) val = this[i]; else { if( this[i] < val ) { val = this[i]; } } } return val; } function log(val) { var objLog = document.getElementById('log'); if( objLog == null ) { var o = document.createElement('textarea'); o.style.position = 'absolute'; o.style.top = '10px'; o.style.left = ( document.body.offsetWidth - 300 ) +'px'; o.style.width = '300px'; o.setAttribute('id', 'log'); o.setAttribute('rows', 100); document.body.appendChild(o); } if( val ) objLog.value += val +"\n"; } /** * debug for object * @param {Object, String} o * @param {Object object} options * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-02-13 */ function debug(o, options) { // check if( o == null ) return; if( typeof options == 'undefined' ) options = {pos: false}; // process if( typeof o == 'string' || typeof o == 'number' ) { var debugStr = o; } else { // process #2 var debugStr = ''; for( i in o ) { //if( o[i] == '[object HTMLFormElement]' ) continue; debugStr += ''; if( options.optSub == 1 ) { if( typeof o[i] == 'object' ) { for( j in o[i] ) { debugStr += '======>' + j + '=' + o[i][j] + '
'; } } } } debugStr += '
' + i + '' + o[i] + '' + typeof o[i] + '
'; if( options.cookie == true ) debugStr += 'document.cookie:' + document.cookie + '
'; } var divObj = document.createElement('div'); divObj.id = 'debug'; if( options.pos == true ) { divObj.style.position = 'absolute'; divObj.style.top = ( options.top || 0 ) + 'px'; divObj.style.left = ( options.left || 500 ) + 'px'; divObj.style.zIndex = options.zIndex || 10000; } divObj.innerHTML = debugStr; document.body.appendChild(divObj); } /** * ¿ÀºêÁ§Æ® È®Àå * @param {Object} destination * @param {Object} source * @return {Object} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-09 */ Object.extend = function(destination, source) { for(var property in source) { destination[property] = source[property]; } return destination; } /** * À̺¥Æ® ¼³Á¤ Å©·Î½ººê¶ó¿ì¡ * @param {Object} elm * @param {String} evType À̺¥Æ® ŸÀÔ * @return {Function} fn ÇÔ¼ö¸í * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-16 */ function addEvent(elm, evType, fn, capture) { if( !capture ) var capture = true; if(elm.addEventListener) { elm.addEventListener(evType, fn, capture); return true; } else if(elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r; } else { elm['on' + evType] = fn; } } /** * sprint ÇÔ¼ö javascript version * @param {String} lang * @return {String} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-09 */ 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; } /** * php rand javascript version * @param {Number} num ÃÖ´ë¼ýÀÚ * @return {Number} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-09 */ function ranx(num) { var ran = Math.random( ); var ten = ran * num; var integ = Math.ceil(ten); return integ; } /** * üũ¹Ú½º checked °ü·Ã * ex) * @param {Object object} options {name:''[, mode: 'un or all or check or null']} * @return {Null} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-09 */ function checkbox(options) { var o = document.getElementsByName(options.name); if( o == null ) return; switch(o.length) { case 0: var o = document.getElementById(options.name); if( o == null ) return; if( o.checked == true ) var chk = true; break; default: for( var i = 0; 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; } } 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; } } /** * ¿ÀºêÁ§Æ® °¨Ã߱⠺¸À̱â * @param {String} id * @return {Null} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-09 */ function showObj(id) { if(document.getElementById(id).style.display == 'none') { document.getElementById(id).style.display = 'block'; return 'block' } else { document.getElementById(id).style.display = 'none'; return 'none' } } // ¼ýÀÚÆ÷¸Ë function chkNumberFormat(fn) { var str = fn.value; var Re = /^0([0-9])+|[^0-9]/g; var ReN = /(-?[0-9]+)([0-9]{3})/; str = str.replace(Re,'$1'); while (ReN.test(str)) { str = str.replace(ReN, "$1,$2"); } fn.value = str; } // null function chkNull(_value) { var reg = /\s+/g; _value = _value.replace(reg,''); if(_value == '' || _value == null) return false; return true; } // »ç¾÷ÀÚ ¹øÈ£ function chkResidentid(biz_no) { if(biz_no.length == 10) { a = biz_no.charAt(0); b = biz_no.charAt(1); c = biz_no.charAt(2); d = biz_no.charAt(3); e = biz_no.charAt(4); f = biz_no.charAt(5); g = biz_no.charAt(6); h = biz_no.charAt(7); i = biz_no.charAt(8); Osub = biz_no.charAt(9); suma = a*1 + b*3 + c*7 + d*1 + e*3 + f*7 + g*1 + h*3; sumb = (i*5) %10; sumc = parseInt((i*5) / 10,10); sumd = sumb + sumc; sume = suma + sumd; sumf = a + b + c + d + e + f + g + h + i k = sume % 10; Modvalue = 10 - k; LastVal = Modvalue % 10; if(sumf == 0) { alert("»ç¾÷ÀÚ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. ´Ù½ÃÀÔ·ÂÇÏ¿© ÁֽʽÿÀ"); return false; } } else { alert("»ç¾÷ÀÚ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. ´Ù½ÃÀÔ·ÂÇÏ¿© ÁֽʽÿÀ"); return false; } if(Osub == LastVal) { return true; } else { alert("»ç¾÷ÀÚ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. ´Ù½ÃÀÔ·ÂÇÏ¿© ÁֽʽÿÀ"); return false; } } // °ø¹éüũ function chkSpace(strValue) { if(strValue.indexOf(" ")>=0) { return true; } else { return false; } } // À̸ÞÀÏüũ function chkEmail(strValue) { if((strValue.length != 0) && (strValue.search(/(\S+)@(\S+)\.(\S+)/) == -1)) { return false; } else { return true; } } // ÇѱÛüũ function chkHan(strValue) { for(var i = 0;i 128 ) { var ret = true; } else { var ret = false; } } return ret; } // ¼ýÀÚüũ function chkNum(inputname) { var formstr=eval(inputname); for(var i = 0;i'9') && chr!='-' && chr!='_') { return false; } } return true; } /*************************************************** * ÁֹιøÈ£ üũ ssn.init(ÁֹιøÈ£°ª13ÀÚ¸®) * @param juminno string ÁֹιøÈ£°ª13ÀÚ¸® * @return boolen * @author ¹Ú³­ÇÏ * @date 2007-02-23 ¿ÀÈÄ 1:30 **************************************************/ 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) { for(var i = 0; i "9") return false; } return true; }, // ÁֹιøÈ£ isSSN: function(s1, s2) { n = 2; sum = 0; for (var i = 0; i * @param id string selectbox object * @param mode string 'first', 'last', 'up', 'down' * @return null * @date 2007-02-23 ¿ÀÈÄ 5:55 */ function sltMenuMove(id, mode) { var obj = document.getElementById(id); var idx = obj.selectedIndex; if (idx < 0) idx = obj.selectedIndex = 0; var opt = obj.options[obj.selectedIndex]; switch(mode) { case 'first': obj.insertBefore(opt, obj.options[0]); break; case 'last': obj.appendChild(opt); break; case 'up': if (idx > 0) obj.insertBefore(opt, obj.options[idx-1]); break; case 'down': if (idx < obj.options.length-1) obj.insertBefore(obj.options[idx+1], opt); break; } } /** * return nodevalue after search xml dom * @param id obj object * @param id tag string * @return string * @date 2007-02-23 ¿ÀÈÄ 5:55 */ function getNodeValue(obj,tag) { return obj.getElementsByTagName(tag)[0].firstChild.nodeValue; } /** * ¾ÆÀ̵ð´Â ¿µÀÚ È¤Àº ¿µ¼ýÀÚÁ¶ÇÕÀ¸·Î ÀÌ·ç¾îÁ®¾ß ÇÏ¸ç ¼ýÀÚ°¡ ù° ÀÚ¸®¿¡ ¿Ã ¼ö ¾ø½À´Ï´Ù. * @param {String} field üũÇÒ ¿ÀºêÁ§Æ® ¾ÆÀ̵ð * @return {Boolen} true / false */ function isMixedNum(field, msg) { var o = document.getElementById(field); var str = o.value; var theValue = false; for( var i = 0; i < str.length; i++ ) { var cha = str.substring(i, i+1); if( (cha >= "A") && (cha <= "Z")) theValue = true; else if ( (cha >= "a") && (cha <= "z")) theValue = true; else if ( (cha >= 0) && (cha <= 9)) theValue = true; else { if( msg == true ) alert('¿µÀÚ È¤Àº ¿µ¼ýÀÚÁ¶ÇÕÀ¸·Î ÀÌ·ç¾îÁ®¾ß Çϸç\r\n¼ýÀÚ°¡ ù° ÀÚ¸®¿¡ ¿Ã ¼ö ¾ø½À´Ï´Ù.'); o.focus(); return theValue; } } return theValue; } /** * ´ë¹®ÀÚ Ã¼Å© * @param {String} field üũÇÒ ¿ÀºêÁ§Æ® ¾ÆÀ̵ð * @param {String} msg alert ½ÇÇà À¯¹« * @return {Boolen} true / false */ function chkUpper(field, msg) { var o = document.getElementById(field); for(var i = 0; i < o.value.length; i++) { var a = o.value.charCodeAt(i); if(a >= 65 && a <= 90) { if( msg == true ) alert("´ë¹®ÀÚ°¡ Æ÷ÇԵǾîÁ® ÀÖ½À´Ï´Ù."); o.focus(); return false; } } return true; } /** * ¾ÆÀÌÇÁ·¹ÀÓ ³ôÀÌ Á¶Àý * @param {String} x object id * @return {Null} * @author ¹Ú³­ÇÏ */ function ifh(x) { var tmpTerm = 200; var o = document.getElementById(x); if( document.all ) { o.onreadystatechange = function() { if( o.readyState == 'complete' ) { o.style.height = ( o.contentWindow.document.body.scrollHeight + tmpTerm ) + 'px'; } } } else { o.onload = function() { o.style.height = o.contentWindow.document.body.scrollHeight + 'px'; } } } /*************************************************************** * ³¯Â¥°ü·Ã ÇÔ¼ö * ex) var today = dt.today(); this.g('year').value = today.y; this.g('month').value = today.m.replace('0', ''); this.g('day').value = today.d.replace('0', ''); var yesterday = dt.yesterday(); this.g('year').value = yesterday.y; this.g('month').value = yesterday.m.replace('0', ''); this.g('day').value = yesterday.d.replace('0', ''); // Àú¹ø´Þ dt.oneDayTS = dt.oneDayTS * 30; var yesterday = dt.yesterday(); this.g('year').value = yesterday.y; this.g('month').value = yesterday.m.replace('0', ''); // À̹ø´Þ dt.oneDayTS = dt.oneDayTS * 30; var today = dt.today(); this.g('year').value = today.y; this.g('month').value = today.m.replace('0', ''); * @author ¹Ú³­ÇÏ * @date 2007-03-07 *****************************************************************/ var dt = { todayDate: new Date(), oneDayTS: 24*60*60*1000, past: {}, now: {}, next: {}, /** * ¿À´Ã ŸÀÓ½ºÅÆÇÁ * @param {Null} * @return {Object object} */ today: function() { var ty = this.todayDate.getFullYear(); var tm = this.todayDate.getMonth() + 1; var td = this.todayDate.getDate(); if( tm < 10 ) tm = '0' + tm; if( td < 10 ) td = '0' + td; this.now.y = ty; this.now.m = parseInt(tm); this.now.d = parseInt(td); return this.now; }, /** * ¾îÁ¦ ŸÀÓ½ºÅÆÇÁ * @param {Null} * @return {} */ yesterday: function() { var y = new Date( this.todayDate.valueOf() - this.oneDayTS ); var yy = y.getFullYear(); var ym = y.getMonth() + 1; var yd = y.getDate(); if( ym < 10 ) ym = '0' + ym; if( yd < 10 ) yd = '0' + yd; this.past.y = yy; this.past.m = parseInt(ym); this.past.d = parseInt(yd); return this.past; }, /** * ³»ÀÏ Å¸ÀÓ½ºÅÆÇÁ * @param {Null} * @return {} */ tommorrow: function() { var t = new Date( this.todayDate.valueOf() + this.oneDayTS ); var yy = t.getFullYear(); var ym = t.getMonth() + 1; var yd = t.getDate(); if( ym < 10 ) ym = '0' + ym; if( yd < 10 ) yd = '0' + yd; this.next.y = ty; this.next.m = parseInt(tm); this.next.d = parseInt(td); return this.next; } } /** * ¿ÜºÎ URL ÀÎÁö ¾Æ´ÑÁö ÆǺ° * @param {Object} o * @return {Boolen} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-13 */ function chkOutUrl(o) { try { var ret = o.contentWindow.document.body; return false; } catch(e) { return true; } } /** * ºê¶ó¿ìÁ®? * @param {Null} * @return {String} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-03-15 */ function getBrowserType() { var detect = navigator.userAgent.toLowerCase(); var browser; var doCheckIt = function(bString) { place = detect.indexOf(bString) + 1; return place; }; if (doCheckIt('konqueror')) { browser = 'konqueror'; } else if (doCheckIt('safari')) { browser = 'safari'; } else if (doCheckIt('omniweb')) { browser = 'omniweb'; } else if (doCheckIt('opera')) { browser = 'opera'; } else if (doCheckIt('webtv')) { browser = 'webtv'; } else if (doCheckIt('icab')) { browser = 'icab'; } else if (doCheckIt('msie')) { browser = 'msie'; } else if (doCheckIt('firefox')) { browser = 'firefox'; } else if (!doCheckIt('compatible')) { browser = 'nn'; } return browser; } /** * validate image * @param {String} filename * @return {Boolen} true/false */ function validateImg(filename) { if( filename.match(/\.(jpg|jpeg|gif|bmp)$/i) ) return true; else return false; } /** * Æ˾÷â °¡¿îµ¥ ¶ç¿ì±â * @param {Object object} url ,name, w, h, opt * @return {Void} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-04-12 */ function popWinC(options) { var x = screen.width / 2 - options.w / 2; var y = screen.height / 2 - options.h / 2; o = options.opt + ',width=' + options.w + ',height=' + options.h + ',left=' + x + ',top=' + y; newwindow = window.open(options.url, options.name || '', o); newwindow.focus(); } /** * ½ºÅ©·Ñ Y °ª °¡Á®¿À±â * @param {Void} * @return {Array} * @author ¹Ú³­ÇÏ * @date 2007-04-15 */ function getPageScroll() { var yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; } else if(document.documentElement && document.documentElement.scrollTop) { yScroll = document.documentElement.scrollTop; } else if(document.body) { yScroll = document.body.scrollTop; } return yScroll; } /** * ÆäÀÌÁö ³Êºñ °ª °¡Á®¿À±â * quirkmode.com °¨»ç ^^ * @param {Void} * @return {Array} * @author ¹Ú³­ÇÏ nanhap@gmail.com * @date 2007-04-17 */ function getPageSize() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight, xScroll, yScroll) return arrayPageSize; } // Àý´ë ³ôÀÌ °è»ê function getAbsoluteTop(oNode) { var oCurrentNode=oNode; var iTop=0; while(oCurrentNode.tagName!="BODY") { iTop+=oCurrentNode.offsetTop; oCurrentNode=oCurrentNode.offsetParent; } return iTop; } // Àý´ë ÁÂÃø °è»ê function getAbsoluteLeft(oNode) { var oCurrentNode=oNode; var iLeft=0; while(oCurrentNode.tagName!="BODY") { iLeft+=oCurrentNode.offsetLeft; oCurrentNode=oCurrentNode.offsetParent; } return iLeft; } // open modal window function openModal(obj, file_name, width, height) { var rand = Math.random() * 4; window.showModalDialog(file_name + '?rand=' + rand, obj, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;resizable=no;status=no;scroll=no;help=no'); } function moveA(Name) { var objs = document.getElementsByName(Name); if (Name == "" || Name == "top") document.body.scrollTop = 0; if (objs == null || objs.length == 0) return false; if (typeof moveA.obj == "undefined") { moveA.obj = document.createElement("A"); moveA.obj.href = "#"; document.body.appendChild(moveA.obj); } // focus on the bottom of the page moveA.obj.style.display = ""; moveA.obj.focus(); moveA.obj.style.display = "none"; if (objs[0].tagName.toLowerCase() == "a") { // for IE var ref = objs[0].href; objs[0].href = "#"; objs[0].focus(); if (ref == "") objs[0].removeAttribute("href"); else objs[0].href = ref; } else { objs[0].focus(); } objs[0].blur(); return false; } // // row ´ÜÀ§ »ö»óº¯°æ (by ÇູÇÑ°í´Ï) // function rowCh(obj, fixed_row) { var args = rowCh.arguments; var argl = args.length; var TRs = new Array; var idx, orgColor, colorIdx=0; if (argl < 3) return; if (typeof(obj.already) == 'undefined') obj.already = false; if (obj.already) return; TRs = obj.getElementsByTagName('TR'); for (idx=fixed_row; idx 0) orgColor = TRs[idx].style.backgroundColor; TRs[idx].onmouseover = new Function('this.style.backgroundColor="'+(args[2+colorIdx])+'";'); TRs[idx].onmouseout = new Function('this.style.backgroundColor="'+orgColor+'";'); if (++colorIdx > argl-3) colorIdx = 0; } obj.already = true; } // ¿µ¿ª ÆäÀÌÁö ÀÚµ¿ È®ÀÎÇϱâ function confirmPage(type, url) { // Àý´ë ÁÖ¼ÒÀÏ °æ¿ì if( url.indexOf('http') != -1 ) { window.open(url, '_blank'); return; } switch(type) { // malladmin default: case 1: var actionUrl = 'http://ect760.cafe24.com/admin/confirmPage.php'; break; } actionUrl += '?page=' + url; stf.init({ method: 'get', action: actionUrl, debug: false }); } /** * ¿¤¸®¸ÕÆ® ¼öÁ¤½Ã * selected, checked * @param object Object * @return void */ function modifyElement(param) { if( typeof param['targetIDKey'] == 'number' ) { var objTarget = document.getElementsByName(param['targetID'])[param['targetIDKey']]; } else { var objTarget = document.getElementById(param['targetID']); } var mode = param['mode']; var value = param['val']; if( !value ) return; switch(mode) { default: break; case 'selectbox': for(var i = 0, t = objTarget.length; i < t; i++) { if( value == objTarget[i].value ) { objTarget.selectedIndex = i; break; } } break; } } /** * À̺¥Æ® Çڵ鸵 µð¹ö±ë * @param String id * @param object oEvent * @return void */ function handleEvent(id, oEvent) { var oTextbox = document.getElementById(id); if( oTextbox == null ) return; oTextbox.value += "\n>" + oEvent.type; oTextbox.value += "\n target is " + (oEvent.target || oEvent.srcElement).id; oTextbox.value += "\n keyCode is " + oEvent.keyCode; oTextbox.value += "\n charCode is " + oEvent.charCode; var arrKeys = []; if (oEvent.shiftKey) { arrKeys.push("Shift"); } if (oEvent.ctrlKey) { arrKeys.push("Ctrl"); } if (oEvent.altKey) { arrKeys.push("Alt"); } oTextbox.value += "\n keys down are " + arrKeys; }