var public_description = new init(); var curObj; var curObj2; var ctime =""; //get current date.. var now_date = new Date(); var s_year = now_date.getYear(); if( s_year<1900) s_year=s_year+1900; var s_month = return0(now_date.getMonth()+1); var s_month_next = return0(now_date.getMonth()+2); var s_month_prev = return0(now_date.getMonth()); //alert(s_month_next); var s_day = return0(now_date.getDate()); var dtype = "YYYY/MM/DD"; var strLang = ""; //var month_name=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); var month_name = new Array('01','02','03','04','05','06','07','08','09','10','11','12'); //var day_name = new Array('Su','Mo','Tu','We','Th','Fr','Sa'); var day_name = new Array('일','월','화','수','목','금','토'); var isSelect = 0; var calWidth = 170; var menuPopup; function init() { this.put_datetype = put_datetype; this.put_curDate = put_curDate; this.put_month_name = put_month_name; this.put_day_name = put_day_name; this.put_select = put_select; this.put_calWidth = put_calWidth; } function hover(on, el) { //var el = window.event.srcElement; //var el = menuPopup.event.srcElement; if (el && el.nodeName == "TD") { if (el.title == '') return; if (on) { el.style.border = '1px solid #646aff'; // el.style.background = '#dffffd'; } else { el.style.border = '1px solid #FFFFFF'; // el.style.background = '#eff7ff'; } } } function choose(y,m, el) { //alert(m); //var el = window.event.srcElement; if (el && el.nodeName == "TD") { if (el.title == '') return; // alert(y) // alert(now_date.getYear()) // alert(m) // alert(now_date.getMonth()+1) // alert(el.title) // alert(now_date.getDate()) if ( (y <= now_date.getYear() && m < now_date.getMonth()+1) || (y <= now_date.getYear() && m == now_date.getMonth()+1 && el.title < now_date.getDate()) ) { alert("오늘 이후 날짜를 선택하세요!"); } else { return_date(y,m,el.title); } } } function put_datetype(str) { dtype = str; } function put_month_name(str) { month_name = str; } function put_day_name(str) { day_name = str; } function put_select(str) { isSelect = str; } function put_calWidth(str) { calWidth = str; } function put_curDate(str) { var y=0,m=0,d=0; ctime = ""; if (str.length == 0 ) { y = s_year; m = s_month; d = s_day; } else { y = parseInt(str.substring(0,4),10); m = parseInt(str.substring(4,6),10); d = parseInt(str.substring(6,8),10); if (str.length >= 14) ctime = str.substring(8,14); } show_current(y,m,d); return(false); } function setLang( lang ) { if( lang != null || lang != "" ) strLang = lang; else strLang = "E"; } function return0(str) { str=""+str; if (str.length==1) str="0"+str; return str; } function dreplace( str , old_char , new_char ) { if( str == null || str == "" ) return; else { var fromindex = 0; var temp = ""; for(var i=0 ; i12) { m_next = m_next - 12; y_next = y + 1; s_year_next = s_year + 1; } //alert(s_year_next); ////////////////////////////// var content=""; if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5) { isIe = 1; } else { isIe = 0; } if(isIe) { var day_num=new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); if (m == 0) { y = y - 1; m = 12; } else if (m == 13) { y = y + 1; m = 1; } if(((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) day_num[1]=29; var first = new Date(y,m-1, 1); firstday = first.getDay()+1 DaysInMonth = day_num[m-1] var first_next = new Date(y,m, 1); firstday_next = first_next.getDay()+1 DaysInMonth_next = day_num[m_next-1] //alert(m +"-"+ m_next + "-" + (m+1)); if ((m-2) == -1) DaysInBefMonth = day_num[11] else DaysInBefMonth = day_num[m-2] if (d > DaysInMonth) day = DaysInMonth else day = d /*
*/ content=content + "\n"; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// 두번째 달 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //s_month = s_month_next //alert(m); ///content=content + "\n"; content=content + "\n"; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// content=content +"\n" content=content + "
\n"; content=content + "
\n"; content=content + "
\n"; /// content=content + "
\n"; //content=content + "\n" //content=content + "
\n" if (isSelect) { content=content + " \n" content=content + "\n" } else { content=content + ""; /// content=content + " " + y; /// content=content + "  "; /// content=content + "  " + m; /// content=content + "  "; content=content + y + " . " + m ; content=content + " "; } /// content=content + "Today"; content=content + "
\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" var column = 0 for (i=1 ; i <= (firstday-1);i++) { //content=content + "\n" content=content + "\n" column =column + 1 } // if (d > 20) content=content + " onclick='parent.choose(" + y + "," + m + ", window.event.srcElement)'> " // alert(s_year+s_month+s_day) for( i=1 ; i<= DaysInMonth;i++) { // if(y <= s_year && m < s_month) content=content+"\n" if(column == 7 && i < DaysInMonth) { content = content + "\n" column = 0 } } if((column > 0) && (column < 7)) { for (i=1 ;i <= (7-column) ; i++) content=content+"\n" //content=content+"\n" } //content=content + "
" + day_name[0] + "" + day_name[1] + "" + day_name[2] + "" + day_name[3] + "" + day_name[4] + "" + day_name[5] + "" + day_name[6] + "
"+ (DaysInBefMonth-(firstday-1)+i) +"" + i; //content=content + "" + i + "" column = column + 1 content = content + "
"+i+"
\n" // content = content + "x"; content=content + "
\n"; content=content + "
 \n"; /// content=content + "
 
\n"; content=content + "\n" //content=content + "
\n" if (isSelect) { content=content + " \n" content=content + "\n" } else { content=content + ""; /// content=content + " " + y_next; /// content=content + "  "; /// content=content + "  " + m_next; /// content=content + "  "; content=content + y_next + " . " + m_next ; content=content + " "; } /// content=content + "Today"; content=content + "
\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" content=content + "\n" var column = 0 //alert(DaysInMonth_next); for (i=1 ; i <= (firstday_next-1);i++) { //content=content + "\n" content=content + "\n" column =column + 1 } // if (d > 20) content=content + " onclick='parent.choose(" + y + "," + m + ", window.event.srcElement)'> " // alert(s_year+s_month+s_day) for( i=1 ; i<= DaysInMonth_next;i++) { // if(y <= s_year && m < s_month) content=content+"\n" if(column == 7 && i < DaysInMonth_next) { content = content + "\n" column = 0 } } if((column > 0) && (column < 7)) { for (i=1 ;i <= (7-column) ; i++) content=content+"\n" //content=content+"\n" } content=content + "
" + day_name[0] + "" + day_name[1] + "" + day_name[2] + "" + day_name[3] + "" + day_name[4] + "" + day_name[5] + "" + day_name[6] + "
"+ (DaysInBefMonth-(firstday-1)+i) +"" + i; //content=content + "" + i + "" column = column + 1 content = content + "
"+i+"
\n"; content=content + "
\n"; content=content + "\n"; content=content + "
   \n"; content=content + "   \n"; content=content + "\n"; content=content + "
\n"; //content=content + "
\n"; content=content + "\n"; //document.body.innerHTML = content; menuPopup = window.createPopup(); menuPopup.document.body.innerHTML = content; } } function lostFocus() { menuPopup.document.calendar.years.focus(); //menuPopup.document.calendar.all['tempFocus'].focus(); //menuPopup.document.calendar.tempFocus.focus(); menuPopup.document.calendar.years.blur(); } function closePopup() { if(menuPopup != null) { //alert("d"); menuPopup.hide(); } } menuDelay = 50; //delay before menu appears menuSpeed = 5; //speed which menu appears (lower=faster) menuOffset = 2; //offset of menu from mouse pointer menuWidth = 370; menuHeight = 229; //menu height var scriptId; var scriptType; var menuXPos = 0; var menuYPos = 0; function callCalPop(scriptId, scriptType) { if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5) { } else { return alert("Version of Internet Explorer must higher than 5.5"); } this.scriptId = scriptId; this.scriptType = scriptType; this.dtype = scriptType; menuXPos = parseInt(event.clientX); menuYPos = parseInt(event.clientY); get_date(); //showCalendarPopup(s_year,s_month,s_day); } function showCalendarPopup(sYear,sMonth,sDay) { make_calendar(sYear,sMonth,sDay); menuXIncrement = menuWidth / menuSpeed; menuYIncrement = menuHeight / menuSpeed; menuTimer = setTimeout("openMenu(0,0)", menuDelay); return false; } function openMenu(height, width) { iHeight = height; iWidth = width; if(iHeight < menuHeight) { menuTimer = setTimeout("openMenu(iHeight + menuYIncrement, iWidth + menuXIncrement)", 1); } else { menuPopup.show(menuXPos, menuYPos, iWidth, iHeight, document.body); clearTimeout(menuTimer); } } //----------------------- function ChgcheckInDate(){ ValofcheckOutDate(); } function ChgNight(){ objform=document.hotel01; if(objform.checkInDate.value != ""){ ValofcheckOutDate(); }else{ alert("체크인 날짜를 먼저 입력하세요!"); } } function ChgcheckOutDate(){ ValofNight(); } function ValofNight(){ objform=document.hotel01; nightselectedIndex=chkDateDiff(); if(nightselectedIndex > 0){ if(nightselectedIndex <= 30){ objform.Night.options[nightselectedIndex].selected=true; }else{ alert("체크아웃 날짜가 너무 많습니다."); } }else{ alert("체크아웃 날짜가 작습니다."); } } function ValofcheckOutDate(){ objform=document.hotel01; chkInDateVal=objform.checkInDate.value; objform.checkOutDate.value=addDays(chkInDateVal,objform.Night.selectedIndex); } function addDate(objDate, intDay) { var objDateMilsec = objDate.getTime(); var intDaytoMilsec = intDay * 24 * 60 * 60 * 1000; var theDate = new Date(objDateMilsec + intDaytoMilsec); return theDate; } function cvtISOToDate(isoDate) { var atomDate= isoDate.split('-'); var aDate=new Date(parseInt(atomDate[0],10),parseInt(atomDate[1],10)-1,parseInt(atomDate[2],10),6,0,0); return aDate; } function addDays(isoDate, noOfDays) { var aDate=cvtISOToDate(isoDate); if (!aDate) return ""; var millis=86400000 * noOfDays; aDate=new Date(aDate.getTime()+millis); with (aDate) { var mm=getMonth()+1; if (mm<10) {mm='0'+mm;} var dd=getDate(); if (dd<10) {dd='0'+dd;} return (getFullYear() + '-' + mm + '-' + dd); } }