/* Copyrights ¨Ï gwkplus. All rights reserved. This article may not be published, rewritten or redistributed. developer : gwkplus at korea dot com */ // ÇÁ·ÎÅä ŸÀÔ Number.prototype.format = function (places) { var n = (Math.round(this * Math.pow(10, places))).toString(); var s1 = parseFloat('0'+n.slice(0, -(places))); var s2 = parseFloat('0.'+n.slice(-(places))); return s1+s2; } Number.prototype.zf = function(l) { return this.toString().zf(l); } // ¹øÈ£ Á¦·ÎÇÊ String.prototype.zf = function(l) { return '0'.string(l - this.length) + this; } // ¹®ÀÚ¿­ Á¦·ÎÇÊ String.prototype.string = function(l) { var s = '', i = 0; while (i++ < l) { s += this; } return s; } // ¹®ÀÚ¿­ ¹Ýº¹ String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/gi, "");} Date.prototype.format = function(f) { if (!this.valueOf()) return ''; var d = this; return f.replace(/(yyyy|mmmm|mm|dd|hh|mi|nn|ss)/gi, function($1) { switch ($1.toLowerCase()) { case 'yyyy': return d.getFullYear().zf(4); case 'mm': return (d.getMonth() + 1).zf(2); case 'dd': return d.getDate().zf(2); case 'hh': return d.getHours().zf(2); case 'mi': case 'nn': return d.getMinutes().zf(2); case 'ss': return d.getSeconds().zf(2); } } ); } var filters = { opacity:function(obj, opacity) { obj.style.opacity=opacity; obj.style.filter = "alpha(opacity="+opacity*100+")"; }, //filters.transform(´ë»ó, À̺¥Æ®Çڵ鷯, ÃʱⰪ, Áõ°¡°ª, ½ÇÇàȽ¼ö, Áö¿¬½Ã°£ms); transform:function(obj, handler, start, inc, count, delay) { if(count>=0) { handler(obj, start); start += inc; count -= 1; window.setTimeout(function(){filters.transform(obj,handler,start,inc,count,delay)},delay); } } }; function setThrow(num,desc) { //¿¹¿ÜÁ¤º¸ ¼³Á¤ var error= { number:num, description:desc }; return error; } //================================================================================================================== // ´ÙÀ̾ó·Î±× À̺¥Æ® 󸮱â var __DivOpen; function DivOpenMsDown(obj) { __DivOpen = obj; obj.cX = event.clientX; obj.cY = event.clientY; addEvent(document,'mouseup',DivOpenMsUp); addEvent(document,'mousemove',DivOpenMsMove); document.body.onselect = function (){return false;}; return false; } function DivOpenMsUp() { var obj = __DivOpen; filters.opacity(obj,1.0); removeEvent(document,'mouseup', DivOpenMsUp); removeEvent(document,'mousemove', DivOpenMsMove); document.body.onselectstart = function (){return true;}; return false; } function DivOpenMsMove() { var obj = __DivOpen; if(!(event.clientX > 0 && event.clientY > 0)){ return false;} var left = (parseInt(obj.style.left) + (-obj.cX - (-event.clientX))); var top = (parseInt(obj.style.top) + (-obj.cY - (-event.clientY))); filters.opacity(obj,0.7); obj.style.left = left; obj.style.top = top; obj.cX = event.clientX; obj.cY = event.clientY; return false; } parseOptions = function(style) { this.top=0; this.left=0; this.width=0; this.height=0; this.innerWidth=0; this.innerHeight=0; this.outerWidth=0; this.outerHeight=0; this.fullscreen=0;//Àüü È­¸é Â÷Áö this.alwaysLowered = 'no';//Ç×»ó±ò¸² this.alwaysRaised = 'no';//Ç×»óµå·¯³² this.moveable=0; //·¹À̾îâ¿¡¼­¸¸ this.resizable='no';//Å©±âº¯°æ Çã¿ë ¿©ºÎ this.scrollbars='no';//½ºÅ©·Ñ¹Ù this.titlebar='yes'; //Á¦¸ñÇ¥½ÃÁÙ this.layerWindow = 'no'; //·¹À̾îâ var options = style.split(","); for(var i = 0; i < options.length; i+=1) { var name,value; var option = options[i].split("="); if(option.length == 2) { name = option[0].trim(); value = option[1].trim(); } switch(name) { case "top":this.top = value;break; case "left":this.left = value;break; case "width":this.width = value;break; case "height":this.height = value;break; case "fullscreen":this.fullscreen = value;break; case "moveable":this.moveable = value;break; case "resizable":this.resizable = value;break; case "titlebar":this.titlebar = value;break; } } } createDivWin = function(location,id,style) { if(document.getElementById(id) != null) return; this.id = id; this.style = style; this.getWindow = function(){return document.getElementById(id);}; this.getContainer = function() { var obj = this.getWindow(); obj = obj.children[0].children[0].children[1].children[0]; return obj; }; this.setTitle = function(){}; this.setTop=function(num){this.getWindow().style.top=num;}; this.setLeft=function(num){this.getWindow().style.left=num;}; this.setWidth = function(num){this.getWindow().style.width=num;}; this.setHeight = function(num){this.getWindow().style.height=num;}; this.close = function() { this.getWindow().close(); } this.setVisible = function(b) { if(this.getWindow() == null) { this.init(); } this.getWindow().setVisible(b); } this.getVisible = function() { if(this.getWindow() == null) { return false; } return this.getWindow().getVisible(); } this.setHTML = function(str) { var obj = this.getContainer(); obj.innerHTML = str; } this.setLocation = function(location) { if(location!='') { var lv = new LoadVars(); lv.win = this; lv.onLoad = function() { if(this.win.getVisible() == false) this.win.init(); this.win.setHTML(this.getResponseText()); this.win.setVisible(true); } lv.open("get",location); lv.send(null); } } this.formAction = function(f) { var lv = new LoadVars(); lv.win = this; lv.onLoad = function() { this.win.setVisible(true); this.win.setHTML(this.getResponseText()); } var content = lv.setForm(f); lv.send(content); } this.init = function(){//init document.body.insertAdjacentHTML('afterBegin','