//´Þ·Â ¶Ç´Â ³¯Â¥ °ü·Ã ÇÔ¼öµéÀ» ¸ð¾Æ³õÀº ÆÄÀÏÀÔ´Ï´Ù... // »ý¼º½Ã ÀÎÀÚ : Ãʱ⠳¯Â¥, ´Þ·ÂÀ» »Ñ¸®´Â °÷, ´Þ·Â º¯¼ö À̸§, ÀÔ·ÂÇÒ °÷ ID function Calendar(sDate, oTarget, sName, oDateTarget) { var dispWeekN = new Array(0,1,2,3,4,5,6); var dispWeekH = new Array("ÀÏ","¿ù","È­","¼ö","¸ñ","±Ý","Åä"); var dispWeekE = new Array("SUN","MON","TUE","WED","THU","FRI","SAT"); var dispWeekC = new Array("ìí","êÅ","ûý","â©","ÙÊ","ÐÝ","÷Ï"); var dispMonthN = new Array("1","2","3","4","5","6","7","8","9","10","11","12"); var dispMonthH = new Array("1¿ù", "2¿ù", "3¿ù", "4¿ù", "5¿ù", "6¿ù", "7¿ù", "8¿ù", "9¿ù", "10¿ù", "11¿ù", "12¿ù"); var dispMonthE = new Array("Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); var dispMonthC = new Array("1êÅ", "2êÅ", "3êÅ", "4êÅ", "5êÅ", "6êÅ", "7êÅ", "8êÅ", "9êÅ", "10êÅ", "11êÅ", "12êÅ"); var weekDisplayType = new Array(dispWeekN, dispWeekH, dispWeekE, dispWeekC); var monthDisplayType = new Array(dispMonthN, dispMonthH, dispMonthE, dispMonthC); this.nDate = new Date(); this.target = null; this.dateTarget = null; this.dateYTarget = null; this.dateMTarget = null; this.dateDTarget = null; this.name = sName; this.weekDisplayType = 1; this.MonthDisplayType = 1; if (sDate) { if ( sDate.split('-').length == 3 ) { var tDate = sDate.split('-'); //this.nDate = new Date(tDate[0],parseInt(tDate[1])-1,tDate[2]); this.nDate = new Date(tDate[0],parseInt(tDate[1]),tDate[2]); } if ( sDate.split('/').length == 3 ) { var tDate = sDate.split('/'); //this.nDate = new Date(tDate[0],parseInt(tDate[1])-1,tDate[2]); this.nDate = new Date(tDate[0],parseInt(tDate[1]),tDate[2]); } } if (typeof(oTarget)=="object") { this.target = oTarget; } else { this.target = document.getElementById(oTarget); } if (typeof(oDateTarget)=="object") { this.dateTarget = oDateTarget; } else { this.dateTarget = document.getElementById(oDateTarget); } this.toString = function (oDate, sFormatType) { var rtn = ""; var nY = 0; var nM = 0; var nD = 0; if (!oDate) { nY = this.nDate.getFullYear(); nM = "0" + this.nDate.getMonth()+1; nD = "0" + this.nDate.getDate(); } else { nY = oDate.getFullYear(); nM = "0" + eval(oDate.getMonth()+1) nD = "0" + oDate.getDate(); } nM = nM.substr((nM.length-2),2); nD = nD.substr((nD.length-2),2); switch (sFormatType) { case "yyyyMMdd": rtn = nY+""+nM+""+nD; break; case "yyyy/MM/dd": rtn = nY+"/"+nM+"/"+nD; break; case "yyyy-MM-dd": rtn = nY+"-"+nM+"-"+nD; break; default : rtn = nY+"-"+nM+"-"+nD; break; } return rtn; } this.changeYear = function (y) { this.nDate.setFullYear(y); this.display(); } this.changeMonth = function (m) { this.nDate.setMonth(m-1); this.display(); } this.moveNextYear = function () { this.nDate.addYears(1); this.display(); } this.movePrevYear = function () { this.nDate.addYears(-1); this.display(); } this.moveNextMonth = function () { this.nDate.addMonths(1); this.display(); } this.movePrevMonth = function () { this.nDate.addMonths(-1); this.display(); } this.moveNextDay = function () { this.nDate.addDays(1); this.display(); } this.movePrevDay = function () { this.nDate.addDays(-1); this.display(); } this.setDate = function(sDate, oDateTarget, oDateYTarget, oDateMTarget, oDateDTarget) { if (typeof(oDateTarget)=="object") this.dateTarget = oDateTarget; else if (typeof(oDateTarget)=="string") this.dateTarget = document.getElementById(oDateTarget); if (typeof(oDateYTarget)=="object") this.dateYTarget = oDateYTarget; else if (typeof(oDateYTarget)=="string") this.dateYTarget = document.getElementById(oDateYTarget); if (typeof(oDateMTarget)=="object") this.dateMTarget = oDateMTarget; else if (typeof(oDateMTarget)=="string") this.dateMTarget = document.getElementById(oDateMTarget); if (typeof(oDateDTarget)=="object") this.dateDTarget = oDateDTarget; else if (typeof(oDateDTarget)=="string") this.dateDTarget = document.getElementById(oDateDTarget); if (this.dateTarget!=null && (typeof(sDate)=="undefined" || sDate=="")) { switch (this.dateTarget.tagName){ case "INPUT" : sDate = this.dateTarget.value;break; default : sDate = this.dateTarget.innerHTML;break; } } if (this.dateYTarget!=null && this.dateMTarget!=null && this.dateDTarget!=null && (typeof(sDate)=="undefined" || sDate=="")) { switch (this.dateYTarget.tagName){ case "INPUT" : case "SELECT" : sDate = this.dateYTarget.value+"-"+this.dateMTarget.value+"-"+this.dateDTarget.value; break; } } if ( sDate.split('-').length == 3 ) { var tDate = sDate.split('-'); if (tDate[0]!="0000") { this.nDate = new Date(tDate[0],parseInt(tDate[1])-1,tDate[2]); } else { this.nDate = new Date(); } } else if ( sDate.split('/').length == 3 ) { var tDate = sDate.split('/'); this.nDate = new Date(tDate[0],parseInt(tDate[1])-1,tDate[2]); } this.display(); } this.selectDate = function(sDate) { this.setDate(sDate, this.dateTarget, this.dateYTarget, this.dateMTarget, this.dateDTarget); if (this.dateTarget!=null) { switch (this.dateTarget.tagName){ case "INPUT" : this.dateTarget.value = sDate;break; default : this.dateTarget.innerHTML = sDate;break; } } if (this.dateYTarget!=null && this.dateMTarget!=null && this.dateDTarget!=null) { switch (this.dateYTarget.tagName){ case "INPUT" : case "SELECT" : this.dateYTarget.value = sDate.substring(0,4); this.dateMTarget.value = sDate.substring(5,7); this.dateDTarget.value = sDate.substring(8,10); break; } } } this.display = function (oObj) { if (!this.target) { return; } var weekStyle = ""; var sHTML = ""; sHTML+="
"; //sHTML+=" "; sHTML+=" "; var currentDate = new Date(); sHTML+=""; sHTML+=""; sHTML+="  "; //sHTML+=""; sHTML+="
"; sHTML+=""; sHTML+=""; for (var i=0;i"+weekDisplayType[this.weekDisplayType][i]+""; } sHTML+=""; //sHTML+=""; var tmpDateS = new Date(this.nDate.getFullYear(), this.nDate.getMonth(), 1); var tmpDateE = new Date(this.nDate.getFullYear(), this.nDate.getMonth()+1, 1); var weekOffset = 0; for (var i=tmpDateS;i "; sHTML+=""; weekOffset++; } } weekStyle = "CalDay" if (weekOffset==0) weekStyle = "CalSun"; else if (weekOffset==6) weekStyle = "CalSat"; if (i.getDate()==this.nDate.getDate()) weekStyle += "_On"; tagView = ""+i.getDate()+""; sHTML+=""; weekOffset++; if ( weekOffset>6 ) { sHTML+=""; weekOffset=0; } } if ( weekOffset > 0 && weekOffset<=6 ) { for (var j=weekOffset;j<7;j++) { tagView = " "; sHTML+=""; weekOffset++; } sHTML+=""; } //sHTML+=""; sHTML+="
"+tagView+""+tagView+"
"+tagView+"
"; sHTML+=""; this.target.innerHTML = sHTML; } } /* // ShowIframeCalendar() ÇÔ¼ö¸¦ ÀÌ¿ëÇϱâ À§Çؼ­´Â position.js ¸¦ include ÇØÁà¾ß ÇÕ´Ï´Ù. // calendar.js, position.js ¸¦ include ÇÏ°í ShowIframeCalendar() ÇÔ¼ö¿¡ ÀÎÀÚ·Î ´Þ·ÂÀÌ À§Ä¡ÇÒ °÷¿¡ ÀÖ´Â object, ±×¸®°í ´Þ·ÂÀÇ ¼±ÅðªÀÌ µé¾î°¥ object¸¦ ³Ñ±â¸é µË´Ï´Ù. */ var bCalFrame = false; document.write(""); var objDateField; var calendarType; function ShowIframeCalendar(searchCal, targetObj) { if (bCalFrame==false) { document.write(""); } event.cancelBubble = true; objDateField = targetObj; var calF = document.all.CalFrame; if(event.altKey == true){ //alt Å°¸¦ ´©¸¥ »óÅÂ¸é ³â ¼±Åà ´Þ·Â if(calF.src == "" || calendarType != "selectYear"){ calF.src = "/include/calendar/calendarSelectYear.asp"; calendarType = "selectYear"; } } else{ //±âº»°ªÀº ³â¿ùÀÏ ¼±Åà ´Þ·Â if(calF.src == "" || calendarType != "selectDay"){ calF.src = "/include/calendar/calendar.asp"; calendarType = "selectDay"; } } calF.style.left = getTotalOffsetLeft(searchCal) + searchCal.offsetWidth/2 - calF.width/2 ; calF.style.top = getTotalOffsetTop(searchCal) + searchCal.offsetHeight; calF.style.display = "block"; } function ShowIframeCalendarSelectYear(searchCal, targetObj) { event.cancelBubble = true; objDateField = targetObj; var calF = document.all.CalFrame; if(event.altKey == true){ //alt Å°¸¦ ´©¸¥ »óÅÂ¸é ³â¿ùÀÏ ¼±Åà ´Þ·Â if(calF.src == "" || calendarType != "selectDay"){ calF.src = "/include/calendar/calendar.asp"; calendarType = "selectDay"; } } else{ //±âº»°ªÀº ³â ¼±Åà ´Þ·Â if(calF.src == "" || calendarType != "selectYear"){ calF.src = "/include/calendar/calendarSelectYear.asp"; calendarType = "selectYear"; } } calF.style.left = getTotalOffsetLeft(searchCal) + searchCal.offsetWidth/2 - calF.width/2 ; calF.style.top = getTotalOffsetTop(searchCal) + searchCal.offsetHeight; calF.style.display = "block"; } function pushDateValueToDateField(inputdate){ objDateField.value = inputdate; hideCalFrame(); } document.onclick = hideCalFrame; function hideCalFrame(){ try { document.all.CalFrame.style.display = "none"; } catch (E) {} } // ¿¹Àü ´Þ·Â ÇÔ¼öÀÔ´Ï´Ù. // modal.jsµµ include µÇ¾î¾ß ÇÕ´Ï´Ù. function openModalCalendar(oForm, oTextBox){ //ShowIframeCalendar(event.srcElement, eval('document.' + oForm + '.' + oTextBox)); var rv = openModal('/include/datepicker/calendar_picker.asp','540','400'); var oTarget = eval('document.' + oForm + '.' + oTextBox); if ((rv != null)&&(rv !="")){ oTarget.value = rv; } } //½ÃÀÛ³¯Â¥ Á¾·á³¯Â¥¸¦ ºñ±³ÇÏ´Â ÇÔ¼öÀÔ´Ï´Ù... µÎ³¯Â¥¸¦ ºñ±³.. function OnDiff(sSD, sED) { aSD = sSD.split("-"); aED = sED.split("-"); oSDate = new Date(aSD[0],aSD[1],aSD[2]); oEDate = new Date(aED[0],aED[1],aED[2]); // alert(oSDate.getTime() + "-" + oEDate.getTime()); if ( oSDate.getTime() > oEDate.getTime() ) { //alert("½ÃÀÛÀÏÀÌ ´õ Å®´Ï´Ù"); return false; } else { //alert("Á¤»óÀÔ´Ï´Ù"); return true; } } //³¯Â¥ ÀÚµ¿ÀÔ·Â °ü·Ã Script ½ÃÀÛ vDayOfWeek = new Array(7) vDayOfWeek[0] = "ÀÏ" ; vDayOfWeek[1] = "¿ù" ; vDayOfWeek[2] = "È­" ; vDayOfWeek[3] = "¼ö" ; vDayOfWeek[4] = "¸ñ" ; vDayOfWeek[5] = "±Ý" ; vDayOfWeek[6] = "Åä" ; function setDateFunc(oForm, a){ with(oForm) { if (a=="0") { syear.value=""; smonth.value=""; sday.value=""; sweek.value=""; eyear.value=""; emonth.value=""; eday.value=""; eweek.value=""; } else { today=new Date(); syear.value=today.getYear(); smonth.value=today.getMonth()+1; eyear.value=today.getYear(); emonth.value=today.getMonth()+1; sday.value=today.getDate(); eday.value=today.getDate(); if (a=="1") { //¿À´Ã sday.value=today.getDate(); eday.value=today.getDate(); } else if (a=="2") { //¾îÁ¦ if (today.getDate()==1) { smonth.value = today.getMonth(); emonth.value = today.getMonth(); yy = syear.value; mm = smonth.value; // ¾îÁ¦°¡ 1ÀÏÀΰæ¿ì Áö³­´ÞÀÇ ¸¶Áö¸·ÀÏ °è»ê if(mm == 2) { if(((yy % 4 == 0) && (yy % 100 != 0)) || (yy % 400 == 0)) { sday.value = 29; eday.value = 29; } else { sday.value = 28; eday.value = 28; } } else { if(mm == 4 || mm == 6 || mm == 9 || mm == 11) { sday.value = 30; eday.value = 30; } else { sday.value = 31; eday.value = 31; } } } else { sday.value=today.getDate()-1; eday.value=today.getDate()-1; } } else if (a=="3") { //À̹ø´Þ sday.value=1; eday.value=today.getDate(); } else if (a=="4") { //Áö³­6°³¿ù°£ var temp_date = new Date(); temp_date.setMonth( today.getMonth()+1 -6 ); syear.value = temp_date.getYear(); smonth.value = temp_date.getMonth(); sday.value = 1; } else if (a=="5") { //¿ÃÇØ smonth.value = 1; emonth.value = 12; sday.value = 1; eday.value = 31; } else if (a=="6") { //Áö³­3³â°£ syear.value = syear.value - 3; } xDay = new Date() ; xDay.setYear(syear.value); xDay.setMonth(smonth.value-1); xDay.setDate(sday.value); sweek.value = vDayOfWeek[xDay.getDay()]; xDay.setYear(eyear.value); xDay.setMonth(emonth.value-1); xDay.setDate(eday.value); eweek.value = vDayOfWeek[xDay.getDay()]; } } } // ³¯Â¥¸¦ È®ÀÎÇÏ´Â ÇÔ¼ö function checkDateS(oForm) { var yy = oForm.syear[oForm.syear.selectedIndex].value; var mm = oForm.smonth[oForm.smonth.selectedIndex].value ; var dd = oForm.sday[oForm.sday.selectedIndex].value ; if ( yy != "" && mm != "" && dd != "" ) { with(oForm) { var yy = syear[syear.selectedIndex].value; var mm = smonth[smonth.selectedIndex].value ; var dd = sday[sday.selectedIndex].value ; if(mm == 2) { if(((yy % 4 == 0) && (yy % 100 != 0)) || (yy % 400 == 0)) { if(dd > 29) { alert(mm+"¿ùÀÇ ¸»ÀÏÀº 29ÀÏÀÔ´Ï´Ù."); sday.selectedIndex = 28 + 1; } } else if(dd > 28) { alert(mm+"¿ùÀÇ ¸»ÀÏÀº 28ÀÏÀÔ´Ï´Ù."); sday.selectedIndex = 27 + 1; } } else if((mm == 4 || mm == 6 || mm == 9 || mm == 11) && (dd > 30)) { alert(mm+"¿ùÀÇ ¸»ÀÏÀº 30ÀÏÀÔ´Ï´Ù."); sday.selectedIndex = 29 + 1; } var xDay = new Date() ; xDay.setYear(parseInt(syear[syear.selectedIndex].value)) ; xDay.setMonth(smonth.selectedIndex-1) ; //xDay.setMonth(smonth.selectedIndex) ; xDay.setDate(sday.selectedIndex) ; //xDay.setDate(sday.selectedIndex + 1) ; var cDayCnt = xDay.getDay(); sweek.value = vDayOfWeek[cDayCnt]; } } } function checkDateE(oForm) { var yy = oForm.eyear[oForm.eyear.selectedIndex].value; var mm = oForm.emonth[oForm.emonth.selectedIndex].value ; var dd = oForm.eday[oForm.eday.selectedIndex].value ; if ( yy != "" && mm != "" && dd != "" ) { with(oForm) { var yy = eyear[eyear.selectedIndex].value; var mm = emonth[emonth.selectedIndex].value ; var dd = eday[eday.selectedIndex].value ; if(mm == 2) { if(((yy % 4 == 0) && (yy % 100 != 0)) || (yy % 400 == 0)) { if(dd > 29) { alert(mm+"¿ùÀÇ ¸»ÀÏÀº 29ÀÏÀÔ´Ï´Ù."); eday.selectedIndex = 28 + 1; } } else if(dd > 28) { alert(mm+"¿ùÀÇ ¸»ÀÏÀº 28ÀÏÀÔ´Ï´Ù."); eday.selectedIndex = 27 + 1; } } else if((mm == 4 || mm == 6 || mm == 9 || mm == 11) && (dd > 30)) { alert(mm+"¿ùÀÇ ¸»ÀÏÀº 30ÀÏÀÔ´Ï´Ù."); eday.selectedIndex = 29 + 1; } var xDay = new Date() ; xDay.setYear(parseInt(eyear[eyear.selectedIndex].value)) ; xDay.setMonth(emonth.selectedIndex-1) ; //xDay.setMonth(emonth.selectedIndex) ; xDay.setDate(eday.selectedIndex) ; //xDay.setDate(eday.selectedIndex + 1) ; var cDayCnt = xDay.getDay() ; eweek.value = vDayOfWeek[cDayCnt]; } } } function setDayFunc(obj) { alert("ÀÏÀÚ¸¦ ¼±ÅÃÇÏ½Ã¸é ¿äÀÏÀº ÀÚµ¿À¸·Î ¼±Åõ˴ϴÙ."); obj.blur(); } //ÆûÀü¼Û½Ã ³¯Â¥Ã¼Å©ÇÏ´Â ÇÔ¼ö function submit_check(objForm){ if (( objForm.syear.value=="" && objForm.smonth.value=="" && objForm.sday.value=="" && objForm.eyear.value=="" && objForm.emonth.value=="" && objForm.eday.value=="" ) || ( objForm.syear.value!="" && objForm.smonth.value!="" && objForm.sday.value!="" && objForm.eyear.value!="" && objForm.emonth.value!="" && objForm.eday.value!="" )){ try{ objForm.orderCondition.value = ""; //±âº»°ªÀº name_kÀÔ´Ï´Ù^^ } catch(E){ } return true; } else { alert("±â°£À» ÀϺθ¸ ¼±ÅÃÇϼ̽À´Ï´Ù."); objForm.syear.focus(); return false; } } //³¯Â¥ ÀÚµ¿ÀÔ·Â °ü·Ã Script ³¡// Checkbox function ChkControl(oCheckbox) { var Checkbox = oCheckbox; var ParentCheckbox = null; this.setPreviousHiddenValue = function() { var bLoop = true; var obj = Checkbox.previousSibling; while (bLoop) { if (obj==null) break; if (typeof(obj)=='object') { if (obj.nodeType==1) { if (obj.nodeName=='INPUT' && obj.type=='hidden') { obj.value = Checkbox.checked; bLoop = false; break; } } obj = obj.previousSibling; } else { bLoop = false; break; } } } var ChildrenCheckbox = null; this.getChildrenChkbox = function(sName) { ChildrenCheckbox = document.getElementsByName(sName); } this.setOnClickEvent = function() { Checkbox.onclick = this._setChildChkAll; } this._setChildChkAll = function() { for (var i=0;i2) { if (checkMode=="selected") bChecked = false; else if (checkMode=="nonselected") bChecked = true; } else { if (checkMode=="selected") bChecked = false; else bChecked = true; } if (bChecked) checkMode = "selected"; else checkMode = "nonselected"; for (var i=0;i0) { for (var i=0;i-1;i--){ if (oSelect.options[i].selected){ //if (!((oSelect[i+1].selected == true) && (i+1== oSelect.length-1))){ tmpValue = oSelect[i+1].value; tmpText = oSelect[i+1].text; oSelect[i+1].value = oSelect[i].value; oSelect[i+1].text = oSelect[i].text; oSelect[i].value = tmpValue; oSelect[i].text = tmpText; oSelect[i+1].selected = true; oSelect[i].selected = false; //oSelect.selectedIndex = selectIndex+1; //} } } } } //depth¸¦ ³ôÀÓ.. this.leftItem = function(oSelect) { var selectIndex = oSelect.selectedIndex; if (selectIndex != -1) { if (oSelect[selectIndex].text.substring(0,1) == '-'){ //depth¸¦ -- var arrval = oSelect[selectIndex].value.split("|"); oSelect[selectIndex].value = arrval[0] + '|' + (--arrval[1]) + '|' + arrval[2] + '|' + arrval[3]; oSelect[selectIndex].text = oSelect[selectIndex].text.substring(1,oSelect[selectIndex].text.length); } } } //depth¸¦ ³»¸².. this. rightItem = function() { var selectIndex = oSelect.selectedIndex; if (selectIndex != -1) { var arrval = oSelect[selectIndex].value.split("|"); oSelect[selectIndex].value = arrval[0] + '|' + (++arrval[1]) + '|' + arrval[2] + '|' + arrval[3]; oSelect[selectIndex].text = '-'+oSelect[selectIndex].text; //alert(oSelect[selectIndex].value); } } } // ¸ÖƼ ÆûÀÏ ¶§ Æû¾ÈÀÇ ³»¿ëÀ» Ãß°¡Çϰųª »èÁ¦ÇÑ´Ù. function setFormLayout(intCnt, oFormArea, oAddFormBodySource){ var AddFormCount = 0; for (var i=oFormArea.childNodes.length-1;i>=0;i--) { if (oFormArea.childNodes[i].nodeType==1) AddFormCount++; else oFormArea.removeChild(oFormArea.childNodes[i]); } var i; var clonedNode; if (intCnt>AddFormCount) { for (i=1;i<=(intCnt-AddFormCount);i++){ clonedNode = oAddFormBodySource.cloneNode(true); oFormArea.insertBefore(clonedNode, null); } } if (intCntintCnt;i--){ oFormArea.removeChild(oFormArea.childNodes[i-1]); } } } function deleteFormLayout(idx, oFormArea){ for (var i=oFormArea.childNodes.length-1;i>=0;i--) { if (oFormArea.childNodes[i].nodeType!=1) oFormArea.removeChild(oFormArea.childNodes[i]); } for (i=0;i2) { if (typeof(oSource)=="object") { if (oSource.tagName=="IMG") { var oImgList = document.getElementsByName(oSource.name); for(var i=0;i1) { if (mode==true) { obj.style.display = 'block'; } else { obj.style.display = 'none'; } } else { if (obj.style.display == 'block') { obj.style.display = 'none'; } else { obj.style.display = 'block'; } } } function setDisplyById2(ItemID, mode) { var obj = document.getElementById(ItemID); if (obj==null) return; var arg = arguments; if (arg.length>1) { if (mode=="true") { obj.style.display = 'block'; } else { obj.style.display = 'none'; } } else { if (obj.style.display == 'block') { obj.style.display = 'none'; } else { obj.style.display = 'block'; } } }function ToolTipMessage() { var Messages = new Array(); var Requried = new Array(); this.add = function(name, value, required, objId) { Messages[name] = value; Requried[name] = required; } this.getMessage = function(name) { var returnMsg = ""; for(var Msg in Messages) { if (Msg==name) { returnMsg = Messages[Msg]; break; } } return returnMsg; } this.ChangeRequired = function(name, required) { for(var bReq in Requried) { if (bReq==name) { Requried[bReq] = required; break; } } } this.getRequired = function(name) { var bRequired = 0; for(var bReq in Requried) { if (bReq==name) { bRequired = Requried[bReq]; break; } } return bRequired; } this.setTitle = function(obj) { var oForm = null; if (typeof(obj)=="object") { oForm = obj; } else if (typeof(obj)=="string") { oForm = document.getElementById(obj); } else { return; } this._setTitle(oForm.getElementsByTagName('INPUT')); this._setTitle(oForm.getElementsByTagName('SELECT')); } this._setTitle = function(oElements) { for (var i=0;i1) ? a[1] : Alerter; this.value = _getValue(); this._getValue = function() { if (element==null) return 0; if (element.tagName=="INPUT") { return element.value; } else { return element.innerHTML; } } this._setValue = function(number) { if (element==null) return null; this.value = number; if (element.tagName=="INPUT") { element.value = this.value; } else { element.innerHTML = this.value; } } this.add = function(iAddValue){ var tempNum = this.value + iAddValue; var message; if (tempNum > this.maxNumber) { message = this.alerter["NumberRangeOver"]; message = message.replace('{0}', this.maxNumber); message = message.replace('{1}', this.minNumber); alert(message); return false; } else if (tempNum < this.minNumber) { message = this.alerter["NumberRangeBelow"]; message = message.replace('{0}', this.maxNumber); message = message.replace('{1}', this.minNumber); return false; } else { this.value = tempNum; } this._setValue(this.value); } } //³Ñ°Ü¿Â ÆäÀÌÁö¿Í ¸¸µé¾îÁø ½ºÆ®¸³Æ®¸¦ ºñ±³ÇÕ´Ï´Ù. function getCookieData(labelName){ var labelLen = labelName.length; var cookieData = document.cookie; var cLen = cookieData.length; var i = 0; var cEnd; while (i < cLen){ var j = i + labelLen; if(cookieData.substring(i,j) == labelName){ cEnd = cookieData.indexOf(";",j) if (cEnd == -1){ cEnd = cookieData.length; } return unescape(cookieData.substring(j+1,cEnd)) } i++; } return ""; } String.prototype.trim = function(){ return this.replace(/^\s+|\s+$|/g,"").replace(/\s{2,}/g," ") } ; String.prototype.formatNumber = function() { var reg = /(^[+-]?\d+)(\d{3})/; num = this; while (reg.test(num)) num = num.replace(reg, '$1' + ',' + '$2'); return num; } // ¼ýÀÚ·Î ÀÌ·ç¾îÁ³´ÂÁö È®ÀÎ String.prototype.isNumber = function() { var num_length = this.length; for(i=0; i=48 && num.charCodeAt(i)<=57) && num.charCodeAt(i)!=45){ return false; } } return true; } // ƯÀå ¹üÀ§ »çÀÌÀÇ ¼ýÀÚÀÎÀÚ È®ÀÎ String.prototype.isProperNumber = function(iStart, iEnd) { var intRate; if (this==""||isNaN(this)==true){ return false; } else { intRate = parseInt(this); if (intRateiEnd){ return false; } else { return true; } } } //ÀüÈ­¹øÈ£ üũ(Æѽº, ÇÚµåÆù ¹øÈ£ Æ÷ÇÔ) String.prototype.IsVaildPhoneNum = function(){ //Çã¿ëµÈ °ªµé ÀüÈ­¹øÈ£À̹ǷΠ¼ýÀÚ¿Í +,-, #Çã¿ë var allows = '0123456789+-#'; for(var i=0; ithis[j+1]) { tmpThis = this[j]; this[j]=this[j+1]; this[j+1]=tmpThis; } } } } } Array.prototype.appendByName = function (sName, oObj) { if ( !this.isContain(oObj) ) { this[sName] = oObj; } } Array.prototype.remove = function ( index ) { this.splice(index,1); } Array.prototype.removeItem = function ( oObj ) { var itemIndex = this.indexOf(oObj); if ( itemIndex >= 0 ) { this.remove(itemIndex); } } Array.prototype.indexOf = function ( oObj ) { for (var i=0;i=0) ? true : false; } Array.prototype.initialize = function () { this.length = 0; } Array.prototype.set = function ( index, oObj ) { if ( this[index] ) { this[index] = oObj; } } Array.prototype.insert = function (index, oObj ) { this.splice(index,0,oObj); } //Date.prototype.__defineGetter__("day", function() { return this.getDate(); }); //Date.prototype.__defineSetter__("day", function(y) { this.setDate(d); }); //Date.prototype.__defineGetter__("month", function() { return this.getMonth()+1; }); //Date.prototype.__defineSetter__("month", function(y) { this.setMonth(m-1); }); //Date.prototype.__defineGetter__("year", function() { return this.getFullYear(); }); //Date.prototype.__defineSetter__("year", function(y) { this.setFullYear(y); }); Date.prototype.addDays = function(d) {this.setDate(this.getDate()+d);} Date.prototype.addMonths = function(m) {this.setMonth(this.getMonth()+m);} Date.prototype.addYears = function(y) {this.setFullYear(this.getFullYear()+y);} Date.prototype.getLastDay = function() {var t = new Date(this.getFullYear(), this.getMonth(), 0); return t.getDate();} Date.prototype.getWeekOfDay = function () {return this.getDay();} function ClassByXML(oXmlNode) { var oNode = null; var nodeValue = ""; if (oXmlNode!=null) { for (var i=0;i0) { var attObj = new ClassByXML(); for(var t=0;t= sT && eT+eH+dH > document.body.clientHeight+sT) { this._win.style.top = eT-dH-eH; } else { this._win.style.top = eT+eH; } if (eL-dW >= sL && (eL+dW > document.body.clientWidth || eL+dW > this.MaxLeft)) { this._win.style.left = eL-dW+eW; } else { this._win.style.left = eL; } if (bShow==0) this.close(); else this.open(); } this.setPositionCenter = function(bShow) { var dH = parseInt(this._win.style.height); var dW = parseInt(this._win.style.width); this._win.style.top = document.body.clientHeight/2 - dH/2; this._win.style.left = document.body.clientWidth/2 - dW/2; if (bShow==0) this.close(); else this.open(); } this.setPositionByPixel = function(pX, pY, bShow) { this._win.style.top = pY; this._win.style.left = pX; if (bShow==0) this.close(); else this.open(); } this.changeContents = function(sourceObj, parentObj, targetObj) { var oNewNode; if (typeof(sourceObj)=="object") { oNewNode = sourceObj; } else if (typeof(sourceObj)=="string") { oNewNode = document.getElementById(sourceObj); } else { return; } var clonedNode = oNewNode.cloneNode(true); clonedNode.style.display = "block"; var oTargetNode; if (typeof(targetObj)=="object") { oTargetNode = targetObj; } else if (typeof(targetObj)=="string") { oTargetNode = document.getElementById(targetObj); } else { oTargetNode = this.body; } var oChildNodes = oTargetNode.childNodes; for(var i=0;i1){ thisPageParameter = thisPageArr[1]; } //°ü¸®ÀÚ ÀÔ·Â ³»¿ëÀ» °¡°øÇÕ´Ï´Ù. PopUpList_http_Host = ""; PopUpList_http = PopUpList[i][0].toLowerCase(); PopUpList_httpF = PopUpList_http; PopUpList_httpArr = PopUpList_httpF.split("/"); if(PopUpList_httpArr.length>2){ PopUpList_http_Host = PopUpList_httpArr[0] + "//" + PopUpList_httpArr[2]; // ¼³¸í : http://www.kics.or.kr => [0]//[2] [1]Àº ºÒÇÊ¿ä } PopUpList_http = PopUpList_http.replace(PopUpList_http_Host,""); //ÇöÀçÆäÀÌÁö ºñ±³±¸¹®À» ¿Ï¼ºÇÕ´Ï´Ù. 1Àº Àüüºñ±³ÀÔ´Ï´Ù. if(checktype=="1"){ thisPage = thisPagePathName+thisPageParameter; //ÆĶó¹ÌÅÍ Æ÷ÇÔ ÁÖ¼Ò } else{ thisPage = thisPagePathName; //ÆĶó¹ÌÅÍ Á¦¿Ü ÁÖ¼Ò } //if(location.pathname=="/home/kor/morgue/bulletin_list_test.aspx"){alert('thisPage.toLowerCase() : \n' + thisPage.toLowerCase() + '\n\nPopUpList_http.toLowerCase() : \n' + PopUpList_http.toLowerCase() );} //°¡°øµÈ µ¥ÀÌÅ͸¦ ºñ±³ÇÕ´Ï´Ù. if(thisPage.toLowerCase() == PopUpList_http.toLowerCase()){ bExist = true; } sSD = PopUpList[i][6]; sED = PopUpList[i][7]; aSD = sSD.split("-"); aED = sED.split("-"); oSDate = new Date(aSD[0],aSD[1]-1,aSD[2]).getTime(); oEDate = new Date(aED[0],aED[1]-1,aED[2]).getTime(); sDatePeorid = (Math.round( (bToday.getTime()-oSDate) / (1000*60*60*24))); //°°Àº ³¯Â¥Àΰæ¿ì 1ÀÌ ³ª¿Àµµ·Ï eDatePeorid = (Math.round( (oEDate-bToday.getTime()) / (1000*60*60*24)))+2; //°°Àº ³¯Â¥Àΰæ¿ì 1ÀÌ ³ª¿Àµµ·Ï if(bExist){ //³¯Â¥ && ÄíÅ° ºñ±³ if( sDatePeorid>0 && eDatePeorid >0 && !(getCookieData('popupcloseID'+PopUpList[i][1]) == "yes") ) { window.open('/home/kor/popup/popup.aspx?ID='+PopUpList[i][1],'PopUp_'+PopUpList[i][1],'width='+PopUpList[i][2]+',height='+PopUpList[i][3]+',left='+PopUpList[i][4]+',top='+PopUpList[i][5]+',channelmode=,directories=,fullscreen=,location=,menubar=,resizable=,scrollbars=,status=,titlebar=,toolbar=0'); } } } } var PopUpList = null; window.setTimeout("openPopUpWindow(PopUpList)", 1000); function getXMLHttp() { var requestClient = null; try { if(window.XMLHttpRequest) { requestClient = new XMLHttpRequest(); // readyState property ?€ onreadystate eventë¥?지???지 ??? ë¸???°ì?ë¥??????ì½?? ì¶?? if(requestClient.readyState == null) { requestClient.readyState = 1; requestClient.addEventListener("load", function() { requestClient.readyState = 4; if(typeof requestClient.onreadystatechange == "function") requestClient.onreadystatechange(); }, false); } } else if(window.ActiveXObject) { var progids = ["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]; for(var i=0; i< progids.length; i++) { try { requestClient = new ActiveXObject(progids[i]); break; } catch (e) {}; } } } catch (e) {} return requestClient; } var nSock = { _url:'', _query:'A=1', _mType:'GET', _isLoaded:false, _request:null, _getHttpObj : function () { if ( window.XMLHttpRequest ) return new XMLHttpRequest(); else return new ActiveXObject("Microsoft.XMLHTTP"); }, _init : function () { this._request=this._getHttpObj(); }, onLoad : function (oReq) {}, onLoadError : function (oReq) {}, request : function () { var oReq = this._request; oReq.open(this._mType, this._url, true); if (this._mType.toUpperCase()=="GET") { oReq.setRequestHeader('Content-Type', 'text/xml; charset=utf-8'); } else { oReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); //oReq.setRequestHeader('Content-length', this._query.length); //oReq.setRequestHeader('Connection', 'close'); } if (typeof oReq.onload != 'undefined') { oReq.onload = this._onReadyStateChange.bind(this); } else { oReq.onreadystatechange = this._onReadyStateChange.bind(this); } this._isLoaded=false; oReq.send(this._query); }, _onReadyStateChange : function() { if ( this._request.readyState == 4 && !this._isLoaded ) { this._isLoaded=true; if ( this._request.status == 200 ) { if ( this._request.responseXML != null ) { this.onLoad(this._request); } else { this.onLoadError(this._request); } } else { this.onLoadError(this._request); } } }, abort : function () { this._request.abort(); }, getData : function () { if ( this._request.readyState == 4 && !this._isLoaded ) return this._request.responseXML; else false; }, _setRequestHeader: function (headerName, value) { this._request.setRequestHeader(headerName, value); }, _setMimeType : function ( sType ) { this._request.overrideMimeType(sType); } }; var nSock1 = { _url:'', _query:'A=1', _mType:'GET', _isLoaded:false, _request:null, _getHttpObj : function () { if ( window.XMLHttpRequest ) return new XMLHttpRequest(); else return new ActiveXObject("Microsoft.XMLHTTP"); }, _init : function () { this._request=this._getHttpObj(); }, onLoad : function (oReq) {}, onLoadError : function (oReq) {}, request : function () { var oReq = this._request; oReq.open(this._mType, this._url, true); if (this._mType.toUpperCase()=="GET") { oReq.setRequestHeader('Content-Type', 'text/xml; charset=utf-8'); } else { oReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); //oReq.setRequestHeader('Content-length', this._query.length); //oReq.setRequestHeader('Connection', 'close'); } if (typeof oReq.onload != 'undefined') { oReq.onload = this._onReadyStateChange.bind(this); } else { oReq.onreadystatechange = this._onReadyStateChange.bind(this); } this._isLoaded=false; oReq.send(this._query); }, _onReadyStateChange : function() { if ( this._request.readyState == 4 && !this._isLoaded ) { this._isLoaded=true; if ( this._request.status == 200 ) { if ( this._request.responseXML != null ) { this.onLoad(this._request); } else { this.onLoadError(this._request); } } else { this.onLoadError(this._request); } } }, abort : function () { this._request.abort(); }, getData : function () { if ( this._request.readyState == 4 && !this._isLoaded ) return this._request.responseXML; else false; }, _setRequestHeader: function (headerName, value) { this._request.setRequestHeader(headerName, value); }, _setMimeType : function ( sType ) { this._request.overrideMimeType(sType); } }; var nSock2 = { _url:'', _query:'A=1', _mType:'GET', _isLoaded:false, _request:null, _getHttpObj : function () { if ( window.XMLHttpRequest ) return new XMLHttpRequest(); else return new ActiveXObject("Microsoft.XMLHTTP"); }, _init : function () { this._request=this._getHttpObj(); }, onLoad : function (oReq) {}, onLoadError : function (oReq) {}, request : function () { var oReq = this._request; oReq.open(this._mType, this._url, true); if (this._mType.toUpperCase()=="GET") { oReq.setRequestHeader('Content-Type', 'text/xml; charset=utf-8'); } else { oReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); //oReq.setRequestHeader('Content-length', this._query.length); //oReq.setRequestHeader('Connection', 'close'); } if (typeof oReq.onload != 'undefined') { oReq.onload = this._onReadyStateChange.bind(this); } else { oReq.onreadystatechange = this._onReadyStateChange.bind(this); } this._isLoaded=false; oReq.send(this._query); }, _onReadyStateChange : function() { if ( this._request.readyState == 4 && !this._isLoaded ) { this._isLoaded=true; if ( this._request.status == 200 ) { if ( this._request.responseXML != null ) { this.onLoad(this._request); } else { this.onLoadError(this._request); } } else { this.onLoadError(this._request); } } }, abort : function () { this._request.abort(); }, getData : function () { if ( this._request.readyState == 4 && !this._isLoaded ) return this._request.responseXML; else false; }, _setRequestHeader: function (headerName, value) { this._request.setRequestHeader(headerName, value); }, _setMimeType : function ( sType ) { this._request.overrideMimeType(sType); } }; var nSock3 = { _url:'', _query:'A=1', _mType:'GET', _isLoaded:false, _request:null, _getHttpObj : function () { if ( window.XMLHttpRequest ) return new XMLHttpRequest(); else return new ActiveXObject("Microsoft.XMLHTTP"); }, _init : function () { this._request=this._getHttpObj(); }, onLoad : function (oReq) {}, onLoadError : function (oReq) {}, request : function () { var oReq = this._request; oReq.open(this._mType, this._url, true); if (this._mType.toUpperCase()=="GET") { oReq.setRequestHeader('Content-Type', 'text/xml; charset=utf-8'); } else { oReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); //oReq.setRequestHeader('Content-length', this._query.length); //oReq.setRequestHeader('Connection', 'close'); } if (typeof oReq.onload != 'undefined') { oReq.onload = this._onReadyStateChange.bind(this); } else { oReq.onreadystatechange = this._onReadyStateChange.bind(this); } this._isLoaded=false; oReq.send(this._query); }, _onReadyStateChange : function() { if ( this._request.readyState == 4 && !this._isLoaded ) { this._isLoaded=true; if ( this._request.status == 200 ) { if ( this._request.responseXML != null ) { this.onLoad(this._request); } else { this.onLoadError(this._request); } } else { this.onLoadError(this._request); } } }, abort : function () { this._request.abort(); }, getData : function () { if ( this._request.readyState == 4 && !this._isLoaded ) return this._request.responseXML; else false; }, _setRequestHeader: function (headerName, value) { this._request.setRequestHeader(headerName, value); }, _setMimeType : function ( sType ) { this._request.overrideMimeType(sType); } }; function GetData (n, sMethod) { if (!n) n=''; var _url = ''; var _param = ''; var raisedError = false; var raisedErrorMsg = ''; this.init = function () { reisedError = false; raisedErrorMsg = ''; _url = ''; } var tSock = eval('nSock'+n); if (sMethod!=null) tSock._mType = sMethod; this.Request = function (sUrl, sParam) { tSock._init(); tSock._url = sUrl; tSock._query = sParam; tSock.onLoad = this.onLoad.bind(this); tSock.onLoadError = this.onLoadError.bind(this); tSock.request(); } this.onLoad = function (oObj) { //alert(oObj.responseText); myXmlDoc = oObj.responseXML; if (myXmlDoc.documentElement) { // first Node in XML DOCUMENT try { this.dataParse(myXmlDoc, null); } catch(E) { return false; } } else { return false; } } this.onLoadError = function (oObj) { if ( this._request != null && this._request.responseXML != null) { alert(oObj.responseXML.statusText); return; } else { alert("???"); return; } } this.RaiseError = function(sMessage) { raisedError=true; raisedErrorMsg=sMessage; } this.dataParse = function (oXml, nAct) { } this.datasource = new Array(); } var Alerter = Array(); Alerter["NumberRangeOver"] = "ÀÔ·ÂÇϽŠ¼ýÀÚ°¡ ¹üÀ§¸¦ ÃÊ°úÇÏ¿´½À´Ï´Ù.\n¼ýÀÚ´Â {0}¿¡¼­ {1}»çÀÌ¿©¾ß ÇÕ´Ï´Ù."; Alerter["NumberRangeBelow"] = "ÀÔ·ÂÇϽŠ¼ýÀÚ°¡ ¹üÀ§¸¦ ÇÏȸÇÏ¿´½À´Ï´Ù.\n¼ýÀÚ´Â {0}¿¡¼­ {1}»çÀÌ¿©¾ß ÇÕ´Ï´Ù."; PopUpList = [ [ 'http://www.kics.or.kr/home/kor/', '69', '400', '530', '0', '0', '2008-09-06', '2008-10-09','1'], [ 'http://www.kics.or.kr/home/kor/article/default.aspx', '70', '430', '330', '0', '0', '2008-09-06', '2008-10-16','0'], [ 'http://www.kics.or.kr/home/kor/', '71', '500', '384', '0', '0', '2008-09-24', '2008-11-30','0'], [ 'http://www.kics.or.kr/home/kor/', '72', '400', '530', '0', '0', '2008-10-10', '2008-10-16','0'], [ 'http://www.kics.or.kr/home/kor/', '73', '500', '607', '1', '1', '2008-12-31', '2009-01-05','0'], [ 'http://www.kics.or.kr/home/kor/', '78', '400', '530', '0', '0', '2009-03-12', '2009-05-08','0'], [ 'http://www.kics.or.kr/home/kor/', '79', '400', '530', '0', '0', '2009-06-01', '2009-06-14','0'], [ 'http://www.kics.or.kr/home/kor/', '80', '400', '530', '0', '0', '2009-06-16', '2009-06-23','0'] ];