// ÀÚ·á»çÀü¿¡¼­ »ç¿ëÇÏ´Â »ó¼ö var DICSEP1 = '¦¡'; // argumentsÀÇ ±¸ºÐÀÚ var DICSEP2 = '¦¢'; // Á¶°ÇÀÇ ±¸ºÐÀÚ // CRUD üũ¿¡ »ç¿ëÇÏ´Â »ó¼ö var CHECK_OK_PK = 0; var CHECK_OK_ETC = 1; var CHECK_SKIP = 2; var CHECK_RETURN = 3; var DETAIL_ERROR = 'ERROR'; var ERROR = 'ERROR'; // ±ÛÀÚ»ö var COLOR_READONLY = '777777'; var COLOR_DELETE = 'FF3333'; var COLOR_TEXT = '333333'; // ³¯Â¥±¸ºÐÀÚ var dateGuBun = '-'; // ³¯Â¥±¸ºÐÀÚ(Á¤±Ô½Ä) - ±¸ºÐÀÚ Á¦°Å¿¡ »ç¿ë var dateGuBun2 = /\-/g; // ¿ìÆí¹øÈ£, ÁֹιøÈ£, »ç¾÷ÀÚ¹øÈ£ var zipGuBun = '-'; // ±¸ºÐÀÚ(Á¤±Ô½Ä) - ±¸ºÐÀÚ Á¦°Å¿¡ »ç¿ë var zipGuBun2 = /\-/g; // ½Ã°£±¸ºÐÀÚ var timeGuBun = ':'; // ½Ã°£±¸ºÐÀÚ(Á¤±Ô½Ä) - ±¸ºÐÀÚ Á¦°Å¿¡ »ç¿ë var timeGuBun2 = /\:/g; // °á°ú messageÀÇ type var code; // °á°ú message var message; // messageÀÇ type, replace ¹®ÀÚ var ALERT = 0; // alert var CONFIRM = 1; // confirm var STATUS = 2; // status var MSGSEP = '^'; /* * ¼³ ¸í : ¸ðµç ÆäÀÌÁö°¡ onloadµÉ °¡Àå ¸ÕÀú ¼öÇàµÈ´Ù. */ function initialize() { var fields; try { fields = baseForm.elements; } catch(e){ return; } var size = fields.length; for (i=0; i, '; } /* * ¼³ ¸í : ÀÔ·ÂµÈ name, value, size·Î input(file) ű׸¦ ¸¸µç´Ù. * ÀÎÀÚ 1 : name - Çʵå¸í * ÀÎÀÚ 2 : value - °ª(ÆÄÀϰæ·Î) * ¸®Åϰª : input ű×ÀÇ ¹®ÀÚ¿­ */ function makeFileField(name, value) { return ''; } /* * ¼³ ¸í : ÆÄÀÏŸÀÔÀ» µ¿ÀûÀ¸·Î »ý¼ºÇÑ´Ù.. * ¸®Åϰª : ÆÄÀÏŸÀÔÀÇ input ű×ÀÇ ¹®ÀÚ¿­ */ function fileUpload() { var field = event.srcElement; var fname = field.name; if(getSField(field.name)==null) { //sendFields.innerHTML += makeFileField(field.name); sendForm.innerHTML += makeFileField(field.name); } var fileField = eval('sendForm.'+fname); fileField.click(); var viewField = getField(fname+'_path'); if(viewField!=null) { viewField.value = fileField.value; } } /* * ¼³ ¸í : baseForm¿¡¼­ ÇØ´çÀ̸§ÀÇ Çʵ尴ü¸¦ ¸®ÅÏÇÑ´Ù. * ÀÎÀÚ 1 : name - Çʵå¸í(ÀüüÇʵå¸í) * ¸®Åϰª : baseFormÀÇ Çʵ尴ü */ function getField(name) { if (arguments.length == 0) { var fieldList = new Array(); var idx = 0; var fields = baseForm.elements; var size = fields.length; for (var j=0; j * code : 0 - status : »óÅÂÇ¥½ÃÁÙ¿¡ ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÑ´Ù. * 1 - confirm : false¸¦ ¼±ÅÃÇÑ °æ¿ì¸¸ disConfirm() À» È£ÃâÇÑ´Ù. * 2 - warning : alertâÀ¸·Î ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÑ´Ù. * msg : ¸Þ½ÃÁö * * * */ function displayMessage() { var msgField = document.getElementById('message'); if(msgField==null) { return; } message = msgField.value; if(message.length==0) { return; } if(code==ALERT) { // warning alert(message); return true; } else if(code==CONFIRM) { // confirm return confirm(message); } else if(code==STATUS) { // status setStatus(message); return true; } } /* * ¼³¸í : ¸Þ´º¸¦ À̵¿Çϱâ À§ÇÑ function * */ function gotoMenu(command) { if(command == 'CCBDA01L1') { window.open('http://www.kfda.go.kr/index.kfda?mid=70&cd=190', '_blank','width=1000,height=700,top=0,left=0,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,titlebar=yes,resizable=yes'); } else if(command == 'CCBDA02L1') { window.open('http://www.kfda.go.kr/index.kfda?mid=70&cd=190', '_blank','width=1000,height=700,top=0,left=0,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,titlebar=yes,resizable=yes'); } else if(command == 'CCBAA07L1') { window.open('http://www.kfda.go.kr/index.kfda?mid=70&cd=191', '_blank','width=1000,height=700,top=0,left=0,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,titlebar=yes,resizable=yes'); } else if(command == 'CCBAA09L1') { window.open('http://clinicaltrials.kfda.go.kr/index.jsp', '_blank','width=1000,height=700,top=0,left=0,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,titlebar=yes,resizable=yes'); } else if(command == 'CCBAA04L3') { // º¯°æÁö½Ãµî window.open('http://labelinfo.kfda.go.kr', '_blank','width=1000,height=700,top=0,left=0,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,titlebar=yes,resizable=yes'); } else if(command == 'CCBAA12L1') { // ÷°¡Á¦ÁÖÀÇ»çÇ× window.open('http://addrug.kfda.go.kr/adddrug/index.jsp', '_blank','width=1000,height=700,top=0,left=0,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,titlebar=yes,resizable=yes'); } else if(command == 'CCBAA14L2') { // Çã°¡½É»ç°­Á window.open('http://rndmoa.kfda.go.kr:8080/antibiotics/index.html', '_blank', 'width=950,height=700,top=0,left=0,menubar=yes,toolbar=yes,titlebar=yes,location=yes,scrollbars=yes,resizable=yes'); } else if(command == 'CCBAA14L3') { // CTD window.open('http://ctd.pharmacademy.co.kr', '_blank', 'width=950,height=700,top=0,left=0,menubar=yes,toolbar=yes,titlebar=yes,location=yes,scrollbars=yes,resizable=yes'); } else if(command == 'CCBAB01L4') { // Àç½É»ç°á°ú window.open("http://labelinfo.kfda.go.kr/page/rex.gds", "labelinfo", ""); } else if(command == 'CCJAB01L2') { // »ýµ¿¼º½ÃÇè°èȹ¼­½ÂÀÎÇöȲ window.open('http://betest.kfda.go.kr/index.html', '_blank','width=1000,height=700,top=0,left=0,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,titlebar=yes,resizable=yes'); } else if(command == 'CCCZZ00L1') { // ±Ô°Ý±âÁØÁ¤º¸ window.open('http://search.kfda.go.kr/search/index.jsp', '_blank','width=1000,height=700,top=0,left=0,location=yes,menubar=yes,toolbar=yes,scrollbars=yes,titlebar=yes,resizable=yes'); } else { moveForm.cmd.value = command; moveForm.submit(); } } /* * ¼³¸í : paging¿¡¼­ ÆäÀÌÁö¸¦ À̵¿Çϱâ À§ÇÑ funtion * °¢ ÆäÀÌÁö¿¡¼­ °³¹ßÀÚ°¡ Á÷Á¢ ÀÛ¼ºÇÑ´Ù. */ function gotoPage(command, page) { moveForm.cmd.value = command; moveForm.pageNo.value = page; moveForm.submit(); } /* * ¼³ ¸í : ´Þ·ÂÀ» ¶ç¿î´Ù. * ÀÎÀÚ 1 : ownName - ÁÖÀθí * ¸®Åϰª : */ function openCalendar(ownName) { var param = "/?cmd=XCALENDAR"; //sunken,raised var features = "dialogWidth:168px;dialogHeight:187px;help:no;edge:raised;resizable:0;status:0;"; var retValue = window.showModalDialog(param, getField(ownName), features); if (retValue) { setValue(ownName, retValue); setFocus(getField(ownName)); } } /* * ¼³ ¸í : ¿ìÆí¹øÈ£ °Ë»öâ ¿­±â. * ÀÎÀÚ 1 : param - ÆÄ¶ó¹ÌÅ͵é * ¸®Åϰª : */ function openZipCode(ownName, addrName, focusName) { var param = "?cmd=XZIPCODEF"; var tmp = ""; if (arguments.length >= 1) { tmp += "&owner=" + ownName; } else { alert('ÆÄ¶ó¹ÌÅÍ´Â 1°³ ÀÌ»óÀ̾î¾ß ÇÕ´Ï´Ù.'); return false; } if (arguments.length >= 2) { tmp += "&addr=" + addrName; } if (arguments.length == 3) { tmp += "&focus=" + focusName; } param += tmp.replace(/%/g, "%25"); var width = 582; var height = 360; var loc = getCenter(width, height, 50); var zipcode = window.open(param, "zipcode", loc); } /* * ¼³ ¸í : ¼±ÅÃµÈ ¿ìÆí¹øÈ£ µ¥ÀÌŸ·Î È­¸éÇʵ忡 °ª ä¿ì±â. * ÀÎÀÚ 1 : ownName - ÁÖÀÎÇʵåÀ̸§(¿ìÆí¹øÈ£Çʵå) * ÀÎÀÚ 2 : addrName - ÁÖ¼ÒÇʵåÀ̸§ * ÀÎÀÚ 3 : focusName - Æ÷Ä¿½ºÇʵåÀ̸§ * ÀÎÀÚ 4 : resultArr - °á°ú ¹è¿­(¿ìÆí¹øÈ£,ÁÖ¼Ò) * ¸®Åϰª : */ function returnZipCode(ownName, zipcode, address, addrName, focusName) { // openZipCode ÇÔ¼ö ÆÄ¶ó¹ÌÅÍ °¹¼ö : 1 // owner¿¡¸¸ ¿ìÆí¹øÈ£¸¦ ¼¼ÆÃÇÑ´Ù. if (arguments.length >= 3) { setValue(ownName, zipcode); // ¿ìÆí¹øÈ£ } // openZipCode ÇÔ¼ö ÆÄ¶ó¹ÌÅÍ °¹¼ö : 2 // owner¿¡ ¿ìÆí¹øÈ£¸¦, addrName¿¡ ÁÖ¼Ò¸¦ ¼¼ÆÃÇÑ´Ù. if (arguments.length >= 4) { setValue(addrName, address); // ÁÖ¼Ò } // openZipCode ÇÔ¼ö ÆÄ¶ó¹ÌÅÍ °¹¼ö : 3 // owner¿¡ ¿ìÆí¹øÈ£¸¦, addrName¿¡ ÁÖ¼Ò¸¦ ¼¼ÆÃÇϰí, // focusName¿¡ FOCUS¸¦ ÁØ´Ù. if (arguments.length == 5) { setFocus(getField(focusName)); // FOCUS } } /* * ¼³¸í : whereÀýÀ» ¸¸µç´Ù. * key, value * key, value, * key, value, , op(and, or, ...) * key, value, , op(=, <, >, ...), cond(and, or, ...) * ÀÎÀÚ1: key * ÀÎÀÚ2: value * ÀÎÀÚ3: type * ÀÎÀÚ4: op * ÀÎÀÚ5: condition * ¸®Åϰª: whereÀý */ function makeCondition(key, value, type, op, cond) { var CCOND = 'AND'; var CTYPE = 'TRUE'; var COP = '='; var result = ''; if(arguments.length < 2) { result += ''; } else if(arguments.length == 2) { result = key + DICSEP1 + value + DICSEP1 + COP + DICSEP1 + CCOND + DICSEP1 + CTYPE + DICSEP1; result += DICSEP2; } else if(arguments.length == 3) { result = key + DICSEP1 + value + DICSEP1 + COP + DICSEP1 + CCOND + DICSEP1 + type + DICSEP1; result += DICSEP2; } else if(arguments.length == 4) { result = key + DICSEP1 + value + DICSEP1 + op + DICSEP1 + CCOND + DICSEP1 + type + DICSEP1; result += DICSEP2; } else if(arguments.length == 5) { result = key + DICSEP1 + value + DICSEP1 + op + DICSEP1 + cond + DICSEP1 + type + DICSEP1; result += DICSEP2; } return result; } /* * ¼³ ¸í : ÀÚ·á»çÀü ¿­±â. * ÀÎÀÚ 1 : param - ÆÄ¶ó¹ÌÅ͵é * ¸®Åϰª : */ function openDataViewer(param) { //param = encodeURI(param); param = param.replace(/%/g, "%25"); // % ó¸® param = param.replace(/#/g, "%23"); // # ó¸® param = "?cmd=XDATADIC"+param; //var width = 582; var width = 642; var height = 614; // 768 À϶§ var scrHeight = screen.height; if (scrHeight < 768) { height = 500; } else if (scrHeight > 768) { width = 682; height = 714; } var loc = getCenter(width, height, 50); var datadic = window.open(param, "datadic", loc); /* width += 10; height += 30; //param = "DataDicFrame.jsp"+param;//sunken,raised var features = "dialogWidth:"+width+"px;dialogHeight:"+height+"px;help:no;edge:raised;resizable:0;status:0;"; var retValue = window.showModalDialog(param, window, features); */ } /* * ¼³ ¸í : ÀÚ·á»çÀü ÆÄ¶ó¹ÌÅ͸¦ ¿­¾î ÀÚ·á»çÀüÀ» ¶ç¿î´Ù. * ÀÎÀÚ 1 : ownName - ÁÖÀθí * ÀÎÀÚ 2 : dicCode - »çÀü¹øÈ£ * ¸®Åϰª : */ function openDataDic(ownName, dicCode) { var owner = getField(ownName); // ÁÖÀΰ´Ã¼ //if (owner.disabled || owner.readOnly) { // return; //} var orgName = ownName; // ÁÖÀθí(¿ø·¡) var ownValue = clearMask(owner); // ÁÖÀΰª var addWhere = ""; // Ãß°¡Á¶°Ç(°íÁ¤) var editWhere = ""; // Ãß°¡Á¶°Ç(clear) // Ãß°¡Á¶°ÇÀÌ ÀÖÀ¸¸é ±¸ÇöÇÑ´Ù. /* if (isField(owner)) { if (ownName == "name") { // key, value, type, op, cond addWhere += makeCondition("key", "value", "true", "=", "AND"); } } */ var param = "&dicCode=" + dicCode; // »ç¹ø¹øÈ£ param += "&ownName=" + orgName; // ÁÖÀθí param += "&ownValue=" + ownValue; // ÁÖÀΰª param += "&addWhere=" + addWhere; // Ãß°¡Á¶°Ç(°íÁ¤) param += "&editWhere=" + editWhere; // Ãß°¡Á¶°Ç(clear) openDataViewer(param); // ÀÚ·á»çÀü ¿­±â } /* * ¼³ ¸í : ÀÚ·á»çÀü¿¡¼­ °á°úÇà Ŭ¸¯½Ã ³Ñ°ÜÁÖ´Â ÇÔ¼ö. * ownNameÀ¸·Î ÀÚ·á»çÀüÀ» ±¸ºÐÇÏ¿© * resultArr¿¡ ´ã°ÜÀÖ´Â °á°ú¸¦ ó¸®ÇÑ´Ù. * ÀÎÀÚ 1 : ownName - ÁÖÀÎÇʵå¸í * ÀÎÀÚ 1 : resultArr - °á°ú¹è¿­ * ¸®Åϰª : */ function resultDataDic(ownName, resultArr) { var owner = getField(ownName); // ÁÖÀΰ´Ã¼ setValue(ownName, resultArr[0]); // ÁÖÀÎÇʵå // ÁÖÀÎÇʵå ÀÌ¿ÜÀÇ ¼¼ÆÃÀÌ ÀÖÀ» °æ¿ì ±¸ÇöÇÑ´Ù. if (ownName == "m_aak_no") { // ±¹°¡ÄÚµå setValue("m_aac_nm", resultArr[1]); // ±¹°¡¸í } } /* * clientÀÇ ¸Þ½ÃÁö¸¦ ó¸®ÇÑ´Ù. * ÀÎÀÚ 1 : key * ÀÎÀÚ 2 : (key, type) ¶Ç´Â (key, msgList) * ÀÎÀÚ 3 : key, type, msgList * * * key : message key * type : 0 - warning : alertâÀ¸·Î ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÑ´Ù. * 1 - confirm : false¸¦ ¼±ÅÃÇÑ °æ¿ì¸¸ disConfirm() À» È£ÃâÇÑ´Ù. * 2 - status : »óÅÂÇ¥½ÃÁÙ¿¡ ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÑ´Ù. * msgList : ¸Þ½ÃÁö¿¡ Æ÷ÇÔÇÒ value list (¿¹, a^b^c) * * * result : boolean - ó¸® °á°ú * */ function showMessage(arg0, arg1, arg2) { var DEFAULT_TYPE = STATUS; var DEFAULT_MSGLIST = ''; var message = ''; try { message = eval(arg0); } catch(e) { alert('À߸øµÈ ¸Þ½ÃÁöÀÔ´Ï´Ù.'); return; } var result = true; switch (arguments.length) { case 1 : result = showMsg(message, DEFAULT_TYPE, DEFAULT_MSGLIST, arg0); break; case 2 : result = showMsg(message, arg1, DEFAULT_MSGLIST, arg0); break; case 3 : result = showMsg(message, arg1, arg2, arg0); break; default : return true; // undefined } return result; } /* * clientÀÇ ¸Þ½ÃÁö¸¦ ó¸®ÇÑ´Ù. * * * key : message key * type : 0 - warning : alertâÀ¸·Î ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÑ´Ù. * 1 - confirm : false¸¦ ¼±ÅÃÇÑ °æ¿ì¸¸ disConfirm() À» È£ÃâÇÑ´Ù. * 2 - status : »óÅÂÇ¥½ÃÁÙ¿¡ ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÑ´Ù. * msgList : ¸Þ½ÃÁö¿¡ Æ÷ÇÔÇÒ value list (¿¹, a^b^c) * msgCode : message code * * * result : boolean - ó¸® °á°ú * */ function showMsg(key, type, msgList, msgCode) { var message = key; if(msgList.length>0) { message = replaceMessage(message, msgList); } message += "\n" + "["+msgCode+"]"; switch (type) { case ALERT : //setStatus(''); alert(message); return true; break; case CONFIRM : //setStatus(''); return confirm(message); break; case STATUS : setStatus(message); return true; break; default : return; // undefined } } /* * message list¸¦ message¿¡ Æ÷ÇÔÇÑ´Ù. * * * message : ¸Þ½ÃÁö * msgList : ¸Þ½ÃÁö¿¡ Æ÷ÇÔÇÒ value list * * * message : º¯È¯µÈ ¸Þ½ÃÁö * */ function replaceMessage(message, msgList) { var idx = message.indexOf(MSGSEP); if(idx == -1) { return message; } var pre = 0; var cur = 0; do { cur = msgList.indexOf(MSGSEP, pre+1); if(cur<0) break; var rep = msgList.substring(pre, cur); message = message.replace(MSGSEP, rep); pre = cur+1; } while(cur>=0); rep = msgList.substring(pre); message = message.replace(MSGSEP, rep); return message; } function PopupWindow(strName) { var wX = 400; var hX = 300; window.open("/activex/miplatform320/MiOpen.jsp?strName="+strName, "MiOpen", "toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100,left=150,width="+wX+",height="+hX); } function ReportWindow(strName, strParam, rSizeW, rSizeH) { var wX = 400; var hX = 300; window.open("/activex/miplatform/html/MiPlatformReport.jsp?strName="+strName+"&strParam="+strParam+"&rSizeW="+rSizeW+"&rSizeH="+rSizeH, "ReportOpen", "toolbar=no,status=no,menubar=no,scrollbars=auto,resizable=no,top=100,left=150,width="+wX+",height="+hX); } function setCookie(name, value, expire) { document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) } function getCookie(Name) { var search = Name + "=" if (document.cookie.length > 0) { // if there are any cookies offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset) // set index of end of cookie value if (end == -1) end = document.cookie.length return unescape(document.cookie.substring(offset, end)) } } } /** * ´Þ·Â À̹ÌÁö¸¦ ÅëÇÑ ³¯Â¥¼±ÅÃ. */ function Dateinput(input) { var obj = document.getElementById(input); DP_OpenPicker(obj); } /** ¿©±âºÎÅÍ ³¯Â¥ ¼±Åà ·¹ÀÌ¾î °ü·Ã ÇÔ¼öµé **/ var DP_PickerInput = null; function DP_PickerInput_blur() { if (!DP_PickerHasMouse()) DP_DisablePicker(); } function DP_GetPickedDate(date_str) { if (DP_PickerInput != null) DP_PickerInput.value = date_str; DP_DisablePicker(); } function DP_OpenPicker(input) { var top = document.body.clientTop + DP_GetObjectTop(input); var left = document.body.clientLeft + DP_GetObjectLeft(input); DP_PickerInput = input; var DPContainer = document.all.DPContainer; DPContainer.style.pixelTop = top + input.offsetHeight; DPContainer.style.pixelLeft = left; DPContainer.style.display = ''; DP_IFRAME.init(DP_ParseDate(DP_PickerInput.value)); } function DP_DisablePicker() { DP_PickerInput = null; var DPContainer = document.all.DPContainer; DPContainer.style.pixelTop = 0; DPContainer.style.pixelLeft = 0; DPContainer.style.display = 'none'; } function DP_PickerHasMouse() { var DPContainer = document.all.DPContainer; var top = document.body.clientTop + DP_GetObjectTop(DPContainer); var left = document.body.clientLeft + DP_GetObjectLeft(DPContainer); var width = DPContainer.offsetWidth; var height = DPContainer.offsetHeight; return ( (event.y >= top && event.y < top + height) && (event.x >= left && event.x < left + width) ); } function DP_InitPicker() { var div_str = '' + ''; document.writeln(div_str); } function DP_GetObjectTop(obj) { if (obj.offsetParent == document.body) { return obj.offsetTop; } else { return obj.offsetTop + DP_GetObjectTop(obj.offsetParent); } } function DP_GetObjectLeft(obj) { if (obj.offsetParent == document.body) return obj.offsetLeft; else return obj.offsetLeft + DP_GetObjectLeft(obj.offsetParent); } function DP_Calendar(year, month) { if (year == null || month == null) { var d = new Date(); this.year = d.getFullYear(); this.month = d.getMonth(); } else { this.year = year; this.month = month - 1; // Date °³Ã¼ÀÇ °æ¿ì ´ÞÀº 0ºÎÅÍ ½ÃÀÛ } this.first_week = new DP_Week(new Date(this.year, this.month, 1)); this.last_date = new Date(this.year, this.month + 1, 1); this.next_week = this.first_week; this.reset = DP_Calendar_Reset; this.hasNextWeek = DP_Calendar_HasNextWeek; this.nextWeek = DP_Calendar_NextWeek; } function DP_Calendar_Reset() { this.last_week = this.first_week; } function DP_Calendar_HasNextWeek() { return DP_DateCompare(this.next_week.date, this.last_date) < 0; } function DP_Calendar_NextWeek() { next_week = this.next_week; this.next_week = next_week.nextWeek(); return next_week; } function DP_Week(date) { this.hasNextDate = DP_Week_HasNextDate; this.nextDate = DP_Week_NextDate; this.nextWeek = DP_Week_NextWeek; this.getWeekFirstDate = DP_Week_GetWeekFirstDate; this.equals = DP_Week_Equals; this.compare = DP_Week_Compare; this.reset = DP_Week_Reset; this.index = 0; if (date == null) date = new Date(); this.date = this.getWeekFirstDate(date); } function DP_Week_Reset() { this.index = 0; } function DP_Week_GetWeekFirstDate(date) { var d = new Date(date.valueOf()); var wday = d.getDay(); d.setDate(d.getDate() - wday); return d; } function DP_Week_HasNextDate() { return (this.index < 7) } function DP_Week_NextDate() { if (this.index >= 7) return null; var d = new Date(this.date.valueOf()); d.setDate(d.getDate() + this.index); this.index ++; return d; } function DP_Week_NextWeek() { var d = new Date(this.date.valueOf()); d.setDate(d.getDate() + 7); return new DP_Week(d); } function DP_Week_Equals(week) { return DP_DateEquals(this.date, week.date); } function DP_Week_Compare(week) { return Date_Compare(this.date, week.date); } function DP_FormatDate(d) { var year = String(d.getFullYear()); var month = String(d.getMonth() + 1); var mday = String(d.getDate()); var s = year; s += ((month.length < 2)? '0': '') + month; s += ((mday.length < 2)? '0': '') + mday; return s; } function DP_ParseDate(dstr) { var str = String(dstr); if (str == null || str == '') return null; if (str.match(/(\d{4})(\d{2})(\d{2})/)) { var year = Number(RegExp.$1); var month = Number(RegExp.$2) - 1; var mday = Number(RegExp.$3); return new Date(year, month, mday); } else { return null; } } function DP_DateEquals(d1, d2) { return ( (d1.getFullYear() == d2.getFullYear()) && (d1.getMonth() == d2.getMonth()) && (d1.getDate() == d2.getDate()) ) } function DP_DateCompare(d1, d2) { if (d1.getFullYear() > d2.getFullYear()) return 1; else if (d1.getFullYear() < d2.getFullYear()) return -1; else if (d1.getMonth() > d2.getMonth()) return 1; else if (d1.getMonth() < d2.getMonth()) return -1; else if (d1.getDate() > d2.getDate()) return 1; else if (d1.getDate() < d2.getDate()) return -1; else return 0; } /** ¿©±â±îÁö ³¯Â¥ ¼±Åà ·¹ÀÌ¾î °ü·Ã ÇÔ¼öµé **/ /*¸Þ´ºÅ¬¸¯½Ã ÆäÀÌÁö À̵¿ */ function clickMenu(cmd) { field = document.getElementById(cmd); cnt = document.getElementById(cmd+'Cnt'); if(cnt.value>0) { if(field.style.display=='none') { field.style.display = 'block'; } else { field.style.display = 'none'; } } else { gotoMenu(cmd); } } function makeHtml(arrayItem){ var innerHtml = ""; for (i=0; i0){ return false; } if( str.length == 8 ){ vDate = new Date(); vDate.setFullYear(str.substring(0, 4)); vDate.setMonth(str.substring(4, 6)-1); vDate.setDate(str.substring(6)); if( vDate.getFullYear() != str.substring(0, 4) || vDate.getMonth() != (str.substring(4, 6)-1) || vDate.getDate() != str.substring(6) ){ return false; } return true; } } function cookieVal(cookieName){ thisCookie = document.cookie.split("; "); for(i=0; i