|
|
Ŭ¶ó¿ìµåű×
Javascript PHP ASP CSS html mysql jquery image API Mobile ¸Þ´º slide °Ô½ÃÆÇ
|
|
|
ÇöÀçÁ¢¼ÓÀÚ ¸í |
|
|
|
|
|
|
|
½º¸¶Æ®ÇÑ Ä«·»´Ù |
|
|
|
|
¼Ò½ººÐ·ù |
½Ã°£,³¯Â¥ |
|
|
´Ù¿î·Îµå Ƚ¼ö |
894 ȸ |
|
|
|
°£´Ü¼³¸í |
À¥ Ä«·»´ÙÀÔ´Ï´Ù. |
|
|
|
|
|
<script type="text/javascript" language="JavaScript"> <br />
var NS4 = (document.layers) ? 1 : 0;<br />
var IE4 = (document.all) ? 1 : 0;<br />
var ver4 = (NS4 || IE4) ? 1 : 0;<br />
</script>
<script language="JavaScript"><br />
window.onerror=null<br />
<br />
// SMART BUSINESS HOURS CALENDAR<br />
//<br />
// This script will produce a perpetual SMART BUSINESS HOURS CALENDAR. It will generate a <br />
// calendar for the current month on the fly. It incorporates the ability to adjust<br />
// for dayling savings time or standard time notations (the USA version). It also <br />
// automatically generates U.S. national holidays (plus Easter).<br />
//<br />
// The script allows you to program business hours for each day. It also allows you <br />
// to override the automatically generated schedule with whatever you like - vacation <br />
// days, for example - and you can add information/links to your schedule for a given day (i.e for <br />
// sales and promotions).<br />
//<br />
// Copyright?000 by John Hinshaw. All rights reserved. You may use<br />
// or modify this script for any use as long as this notice stays with it. <br />
// If you use it, I would I appreciate an e-mail so I can steal any <br />
// new ideas from you. Thanks.<br />
// hinshaw@webpundits.com<br />
<br />
//********************************************************************************************<br />
//<br />
// SMART BUSINESS CALENDAR Setup<br />
//<br />
// setup the user variables<br />
<br />
var bgcolor = "black" //set this color to match the ``body`` background color above<br />
var headercolor = "#55ff55" // month and days of week color<br />
var typecolor = "#55ff55" // the default color for the calendar days font<br />
var wkdaybgcolor = "black" // weekday background color<br />
var wkendbgcolor = "#002A00" // weekend background color<br />
var todaybordercolor = "gold" // border color for current day<br />
var defmsgcolor = "#55ff55" // font color for the default business hours<br />
var replmsgcolor = "cyan" // font color for messages that override the default business hours<br />
var captioncolor = "cyan" // font color for captions<br />
var holicolor = "gold" // font color for holiday notations<br />
var dailymsgcolor = "white" // font color for recurring daily message (if used)<br />
<br />
// You may use the following to setup default business hours or messages. If you decide<br />
// to display messages other than business hours, turn off the Time Notations in the section<br />
// below this one. If you don``t want to use any messages, then make the message two pair of <br />
// quotes with nothing between them (i.e. ""). Note, however, that if there is no default message, <br />
// there can be no replacement message or additional caption. Holidays will still show. To get<br />
// around this, instead of having nothing between the quotes, put a space between them. (i.e. " ")<br />
// This won``t work if you have ``useTimeNotations`` set to ``true`` because you would have a Time Notation<br />
// without any time before it.<br />
// <br />
var dymsg = new Array(7)<br />
dymsg[0] = "" // Default message for Sunday<br />
dymsg[1] = "9am to 5pm" // Default message for Monday<br />
dymsg[2] = "9am to 5pm" // Default message for Tuesday<br />
dymsg[3] = "9am to 5pm" // Default message for Wednesday<br />
dymsg[4] = "9am to 5pm" // Default message for Thursday<br />
dymsg[5] = "9am to 5pm" // Default message for Friday<br />
dymsg[6] = "" // Default message for Saturday<br />
<br />
// You may also choose to use alternating day messages instead of weekly messages.<br />
// To do so, change the line ``var useAlternating = false`` to ``var useAlternating = true``<br />
// and then list the alternating messages.<br />
<br />
var useAlternating = false<br />
<br />
var day1Msg = "5pm - 6pm"<br />
var day2Msg = "9pm - 10pm"<br />
<br />
// You may also have a daily message (appears everyday) whether you have a default message<br />
// for the day or not.<br />
<br />
var useDailyMsg = true<br />
var dailyMsg = "on call 24/7"<br />
<br />
// --- Standard Time/Daylight Savings Time notations ---<br />
// Use the ``myStandardTime`` and ``myDaylightTime`` variables to name your locales notation<br />
// (i.e. cst = Central Standard Time and cdt = Central Daylight Time)<br />
// If you don``t want to use Time notations, set the ``useTimeNotations`` variable to ``false``<br />
<br />
var useTimeNotations = true<br />
<br />
var myStandardTime = "cst"<br />
var myDaylightTime = "cdt"<br />
<br />
// Option to show the local time. You must know your GMT offset for this option.<br />
<br />
var showLocalTime = true<br />
var localTimeOffset = 6 // 6 is the Offset for Central Standard Time<br />
<br />
// Option to show Previous and Next Month links<br />
<br />
var showPrevNext = true<br />
<br />
// OK, now, pay attention. We are going to list the U.S. holidays that this program<br />
// understands. Next to each, indicate whether or not to display the default message. In<br />
// other words, if you``ll be open for business as usual that day, assign "yes" to the variable.<br />
// The program will then display the default hours. Answer "no" if you do not want to<br />
// display the default hours. We will assign replacement messages in the next segment.<br />
<br />
var NewYear = "no" // Show default hours on New Year``s Day?<br />
var MLKing = "no" // Show default hours on Martin Luther King, Jr. Day?<br />
var President = "yes" // Show default hours on President``s Day?<br />
var Easter = "no" // Show default hours on Easter Sunday?<br />
var Memorial = "no" // Show default hours on Memorial Day?<br />
var Independence = "no" // Show default hours on Independence Day?<br />
var Labor = "no" // Show default hours on Labor Day?<br />
var Columbus = "no" // Show default hours on Columbus Day?<br />
var Veteran = "yes" // Show default hours on Veteran``s Day?<br />
var Thanksgiving = "no" // Show default hours on Thanksgiving Day?<br />
var Christmas = "no" // Show default hours on Christmas Day?<br />
<br />
// Now assign replacement messages for those holidays where you assigned "no" to the variable.<br />
// Just enter the message you want displayed (i.e. "Closed"). If you want to display different <br />
// hours as opposed to a text message, start the message with a ``+`` sign.<br />
//<br />
// If you place a message for a holiday where you have already<br />
// told the program to display the default hours (in the section above), the default hours<br />
// will still be displayed. <br />
<br />
var msgNewYear = "Closed" // Replacement message for New Year``s Day<br />
var msgMLKing = "Closed" // Replacement message for Martin Luther King, Jr. Day<br />
var msgPresident = "" // Replacement message for President``s Day<br />
var msgEaster = "Closed" // Replacement message for Easter Sunday<br />
var msgMemorial = "Closed" // Replacement message for Memorial Day<br />
var msgIndependence = "Closed" // Replacement message for Independence Day<br />
var msgLabor = "Closed" // Replacement message for Labor Day<br />
var msgColumbus = "+10am - 2pm" // Replacement message for Columbus Day<br />
var msgVeteran = "" // Replacement message for Veteran``s Day<br />
var msgThanksgiving = "Closed" // Replacement message for Thanksgiving Day<br />
var msgChristmas = "Closed" // Replacement message for Christmas Day<br />
<br />
// CREATE SPECIAL CAPTIONS <br />
//<br />
// Begin by adding another ``tDay[x] =`` (where x is the next number.)<br />
// Then - in quotes - enter the exact day of your message followed by the vertical bar ("|"),<br />
// and immediately follow that with your message. (see the example that is next)<br />
//<br />
// tDay[2] = "December 12, 1998|Start Christmas Vacation" <br />
//<br />
// This will replace your default message with whatever you want.<br />
//<br />
// If you want to add captions/links to your schedule for special days (info or promotions)<br />
// and not replace your schedule, simply place a "+" in front of the caption/link like:<br />
// <br />
// tDay[5]="November 14, 1998|+Mens`` Suits<br>Special Sale"<br />
//<br />
// or if you want it to be a link to another page<br />
// tDay[3] = "November 17, 1999|+<a href=``http://www.bridge-software.com/``>Facility Booking Software</a>"<br />
// <br />
// These captions will then be placed on the line below your default message in the ``caption`` color.<br />
//<br />
// MESSAGES THAT SUPERCEDE ALL OTHER MESSAGES<br />
// If you want to supercede all business hours and holiday replacement messages, (i.e. for vacation days)<br />
// place an "@" in front of the caption like:<br />
// <br />
// tDay[5]="April 12, 1999|@On Vacation"<br />
//<br />
// The following is a way to set a day to show every year (i.e. a birthday or anniversary)<br />
// tDay[6] = "March 20, " + year +"|+Ed``s Birthday"<br />
//<br />
// The dates do not have to be in any specific order, but you may want to replace old info with<br />
// new on a regular basis. The list may also be as long as you like, but, remember, the longer<br />
// the list is, the longer it will take it to load.<br />
//<br />
// Programming this information starts 10 lines down from here.<br />
//********************************************************************************************<br />
<br />
<br />
function getMsg(dayNumber) {<br />
<br />
//********************************************************************************************<br />
//<br />
// Start programming captions for individual days here<br />
<br />
var tDay = new Array()<br />
tDay[0] = "May 28, 2000|@On Vacation"<br />
tDay[1] = "June 29, 2000|@On Vacation"<br />
tDay[2] = "July 30, 2000|@On Vacation"<br />
tDay[3] = "October 31, 2000|@On Vacation"<br />
tDay[4] = "November 5, 2000|+<a href=``http://www.bridge-software.com/`` target=``_blank``>Facility Booking Software</a>"<br />
tDay[5] = "March 20, 2000|+<a href=``http://www.bridge-software.com/``>Facility Booking Software</a>"<br />
<br />
// End of programming captions for individual days<br />
//<br />
//********************************************************************************************<br />
var msgDate = (nMonth + " " + dayNumber + ", " + year)<br />
var lenCaption = 0<br />
var ii = tDay.length<br />
var i<br />
var totalMsg<br />
var replDate<br />
var stopNum<br />
<br />
for (var i = 0; i < ii; i++) {<br />
totalMsg = tDay[i]<br />
if (totalMsg > "") {<br />
stopNum = totalMsg.indexOf("|")<br />
replDate = totalMsg.substr(0, stopNum) <br />
if (replDate == msgDate) {<br />
replMsg = totalMsg.substr(stopNum + 1, totalMsg.length - (stopNum + 1)) <br />
}<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
if (replMsg > "" && replMsg.charAt(0) == "@") {<br />
lenCaption = replMsg.length - 1<br />
superCap = replMsg.substr(1, lenCaption)<br />
} else if (replMsg > "" && replMsg.charAt(0) == "+") {<br />
addTo = true<br />
lenCaption = replMsg.length - 1<br />
replMsg = "<br>" + replMsg.substr(1, lenCaption)<br />
} <br />
<br />
showDST = ""<br />
<br />
<br />
var nDate = new Date(nMonth + dayNumber + ", " + year)<br />
<br />
// start check for daylight savings time<br />
var fDayMonth = new Date(year, 3, 1) <br />
var dayFirst = fDayMonth.getDay()<br />
fDayMonth = null<br />
<br />
// find the first Sunday in April<br />
var startDST = (7 - dayFirst) + 1<br />
if (startDST > 7) startDST = startDST - 7<br />
var sDST = "April " + startDST + ", " + year<br />
<br />
// find the last Sunday in October<br />
var lDayMonth = new Date(year, 9, 31)<br />
var lastDay = lDayMonth.getDay()<br />
lDayMonth = null <br />
var endDST = 31 - lastDay<br />
<br />
// do the comparison<br />
var eDST = "October " + endDST + ", " + year<br />
if (useTimeNotations == true) {<br />
<br />
if (Date.parse(nDate) >= Date.parse(sDST) && Date.parse(nDate) < Date.parse(eDST)) { <br />
showDST = " " + myDaylightTime<br />
} else { <br />
showDST = " " + myStandardTime <br />
} <br />
}<br />
<br />
// Schedule for individual days of the week<br />
//<br />
if (useAlternating != true) {<br />
var dyWk = nDate.getDay()<br />
if (dymsg[dyWk] > "") {<br />
isDyMsg = true<br />
if (addTo == true && replMsg > "") {<br />
return "<font size=``-3`` color=" + defmsgcolor + ">" + dymsg[dyWk] + showDST + "</font><br><font size=``-3`` color=" + captioncolor + ">" + replMsg + "</font>"<br />
} else if (addTo != true && replMsg > ""){<br />
return "<font size=``-3`` color=" + replmsgcolor + ">" + replMsg + "</font>"<br />
} else {<br />
return "<font size=``-3`` color=" + defmsgcolor + ">" + dymsg[dyWk] + showDST + "</font>"<br />
}<br />
} else {<br />
superCap = ""<br />
return ""<br />
}<br />
}<br />
<br />
<br />
// Schedule for alternating day messages<br />
//<br />
if (useAlternating == true) {<br />
// calculate odd or even days since Jan 2, 1998<br />
isDyMsg = true<br />
var baseDate = new Date("January 1, 1998")<br />
var left = nDate.getTime() - baseDate.getTime()<br />
var days = Math.round(left / (1000 * 60 * 60 * 24))<br />
var sMod = (days % 2)<br />
if (sMod == 0) {<br />
if (addTo == true && replMsg > "") {<br />
return "<font size=``-3`` color=" + defmsgcolor + ">" + day1Msg + showDST + "</font><br><font size=``-3`` color=" + captioncolor + ">" + replMsg + "</font>"<br />
} else if (addTo != true && replMsg > ""){<br />
return "<font size=``-3`` color=" + replmsgcolor + ">" + replMsg + "</font>"<br />
} else {<br />
return "<font size=``-3`` color=" + defmsgcolor + ">" + day1Msg + showDST + "</font>"<br />
}<br />
} else if (sMod == 1) {<br />
if (addTo == true && replMsg > "") {<br />
return "<font size=``-3`` color=" + defmsgcolor + ">" + day2Msg + showDST + "</font><br><font size=``-3`` color=" + captioncolor + ">" + replMsg + "</font>"<br />
} else if (addTo != true && replMsg > ""){<br />
return "<font size=``-3`` color=" + replmsgcolor + ">" + replMsg + "</font>"<br />
} else {<br />
return "<font size=``-3`` color=" + defmsgcolor + ">" + day2Msg + showDST + "</font>"<br />
}<br />
} else {<br />
superCap = ""<br />
return ""<br />
}<br />
}<br />
<br />
}<br />
<br />
<br />
// setup the date variables <br />
<br />
var now<br />
var tDay<br />
var year<br />
var month<br />
var date<br />
var nMonth<br />
var today<br />
<br />
var nxtMonth<br />
var nextMonthName<br />
var nxtYear<br />
var nxtBtn<br />
var nxtStat<br />
<br />
var prvMonth<br />
var prevMonthName<br />
var prvYear<br />
var prvBtn<br />
var prvStat<br />
<br />
var showDST<br />
var localTimeStr = ""<br />
<br />
now = new Date()<br />
tDay = now.getDate()<br />
year = now.getFullYear()<br />
month = now.getMonth()<br />
nMonth = getnMonth(month)<br />
today = new Date(nMonth + " " + tDay + ", " + year)<br />
<br />
function chgMonth(offset) {<br />
onError=null<br />
<br />
if (offset == 1) {<br />
month = month + 1<br />
if (month == 12) {<br />
year = year + 1<br />
month = 0<br />
}<br />
offset = null<br />
nMonth = getnMonth(month)<br />
smartCalendar()<br />
}<br />
<br />
if (offset == 0) {<br />
month = month - 1 <br />
if (month == -1) {<br />
year = year - 1<br />
month = 11<br />
}<br />
offset = null<br />
nMonth = getnMonth(month)<br />
smartCalendar()<br />
<br />
} <br />
}<br />
<br />
<br />
// other global variables<br />
<br />
var holiDate = false<br />
var holiMsg = ""<br />
var showDST = ""<br />
var addTo = false<br />
var superCap = ""<br />
var replMsg = ""<br />
var isDyMsg = false<br />
<br />
function getDayName(day) {<br />
var wkDay = new Array(7)<br />
wkDay[0] = "Sunday"<br />
wkDay[1] = "Monday"<br />
wkDay[2] = "Tuesday"<br />
wkDay[3] = "Wednesday"<br />
wkDay[4] = "Thursday"<br />
wkDay[5] = "Friday"<br />
wkDay[6] = "Saturday"<br />
<br />
return wkDay[day]<br />
}<br />
<br />
<br />
// Get the local time here<br />
<br />
function localDigitalTime() {<br />
<br />
if (showLocalTime) {<br />
var clockEl<br />
var localTimeStr = ""<br />
var now = new Date()<br />
var tmpTime = now.getTime()<br />
var gmtOffset = now.getTimezoneOffset() * 60 * 1000<br />
var dtGMT = new Date(tmpTime + gmtOffset)<br />
var year = dtGMT.getFullYear()<br />
<br />
// check for daylight savings time<br />
var fDayMonth = new Date(year, 3, 1) <br />
var firstDay = fDayMonth.getDay()<br />
fDayMonth = null<br />
<br />
// find the first Sunday in April<br />
var startDST = (7 - firstDay) + 1<br />
if (startDST > 7) startDST = startDST - 7<br />
var sDST = "April " + startDST + ", " + year<br />
<br />
// find the last Sunday in October<br />
var lDayMonth = new Date(year, 9, 31)<br />
var lastDay = lDayMonth.getDay()<br />
lDayMonth = null <br />
var endDST = 31 - lastDay<br />
<br />
var eDST = "October " + endDST + ", " + year <br />
if (Date.parse(dtGMT) >= Date.parse(sDST) && Date.parse(dtGMT) < Date.parse(eDST)) { <br />
<br />
//*****************************************************************************************<br />
// Set the time zone offset below. The first single digit is for daylight savings time<br />
// and the second single digit is for standard time.<br />
<br />
now = new Date(dtGMT - ((localTimeOffset - 1) * 3600000))<br />
} else {<br />
now = new Date(dtGMT - (localTimeOffset * 3600000))<br />
}<br />
<br />
//*****************************************************************************************<br />
// alert (now.getMonth())<br />
<br />
var monthS = now.getMonth()<br />
var monthName = getnMonth(monthS)<br />
var day = now.getDay()<br />
var dayName = getDayName(day)<br />
var date = now.getDate()<br />
var hour = now.getHours()<br />
var min = now.getMinutes()<br />
var sec = now.getSeconds()<br />
<br />
//getnMonth(month)<br />
<br />
getDayName(day)<br />
localTimeStr = "<CENTER><font size=``-3`` color=" + defmsgcolor + " size=``-1`` face=``sans-serif, verdana, helvetica, arial``>"<br />
localTimeStr += "The local Date/Time is: "<br />
localTimeStr += (dayName + ", " + monthName + " " + date + ", " + year + " ")<br />
<br />
<br />
if (min < 10) {<br />
min = "0" + min<br />
}<br />
<br />
if (sec < 10) {<br />
sec = "0" + sec<br />
}<br />
<br />
if (hour > 12) {<br />
localTimeStr += ((hour - 12) + ":" + min + ":" + sec)<br />
}else if (hour == 0) {<br />
localTimeStr += ("12:" + min + ":" + sec)<br />
}else{<br />
localTimeStr += (hour + ":" + min + ":" + sec)<br />
}<br />
<br />
if (hour <= 11) {<br />
localTimeStr += (" AM")<br />
}else{<br />
localTimeStr += (" PM")<br />
}<br />
localTimeStr += "</FONT></CENTER>"<br />
<br />
if (NS4) {<br />
clockEl = document.layers.Clock.document;<br />
clockEl.open();<br />
clockEl.write(localTimeStr);<br />
clockEl.close();<br />
setTimeout("localDigitalTime()",1000)<br />
} else if (IE4) {<br />
Clock.innerHTML = localTimeStr;<br />
setTimeout("localDigitalTime()",1000)<br />
}<br />
}<br />
}<br />
<br />
// Calculate and display U.S. National Holidays (plus Easter)<br />
<br />
function getHolidates(dayNumber) {<br />
<br />
if (month == 0) {<br />
<br />
// Show New Year``s Day<br />
<br />
if (dayNumber == 1) {<br />
if (NewYear == "no") {<br />
holiDate = true<br />
holiMsg = msgNewYear<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>New Year``s Day</font>``<br />
} <br />
<br />
<br />
<br />
// Calculate Martin Luther King, Jr. Day<br />
<br />
var n3 = new Date("January 1, " + year)<br />
var n4 = 2<br />
var n6 = n3.getDay() + 1<br />
n6 = 7 - n6<br />
var n8 = (14 + n4) + n6 + 1<br />
if (n4 + n6 >= 7) {<br />
n8 = n8 - 7<br />
}<br />
if (n8 == dayNumber) {<br />
if (MLKing == "no") {<br />
holiDate = true<br />
holiMsg = msgMLKing<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>M. L. King, Jr. Day</font>``<br />
} <br />
}<br />
<br />
// End Martin Luther King, Jr. Day<br />
<br />
<br />
if (month == 1) {<br />
<br />
// Calculate President``s Day<br />
<br />
var n3 = new Date("February 1, " + year)<br />
var n4 = 2<br />
var n6 = n3.getDay() + 1<br />
n6 = 7 - n6<br />
var n8 = (14 + n4) + n6 + 1<br />
if (n4 + n6 >= 7) {<br />
n8 = n8 - 7<br />
}<br />
if (n8 == dayNumber) {<br />
if (President == "no") {<br />
holiDate = true<br />
holiMsg = msgPresident<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>President``s Day</font>``<br />
} <br />
<br />
// End President``s Day<br />
}<br />
<br />
<br />
<br />
<br />
if (month == 2 || month == 3) {<br />
<br />
// Calculate Easter<br />
// Thanks to Marcos Montes for posting the Carter algorithm<br />
// (http://www.smart.net/~mmontes/carter.html)<br />
<br />
var b = 225 - 11 * (year % 19)<br />
var d = ((b-21) % 30) + 21<br />
if (d > 48) {<br />
d = d - 1<br />
}<br />
var e = Math.floor((year + (year/4) + d + 1) % 7)<br />
var q = d + 7 - e<br />
if (q > 31) {<br />
q = q - 31<br />
var m = 3<br />
} else {<br />
var m = 2<br />
}<br />
if (m == month && q == dayNumber) {<br />
if (Easter == "no") {<br />
holiDate = true<br />
holiMsg = msgEaster<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>Easter</font>``<br />
}<br />
<br />
// End Easter<br />
}<br />
<br />
<br />
if (month == 4) {<br />
<br />
// Calculate Memorial Day<br />
<br />
var mWeek = new Date("May 31, " + year)<br />
var lDay = mWeek.getDay()<br />
if (lDay == 0) {<br />
lDay = 6<br />
}else{<br />
lDay = lDay - 1<br />
}<br />
var mDay = 31 - lDay<br />
if (mDay == dayNumber) {<br />
if (Memorial == "no") {<br />
holiDate = true<br />
holiMsg = msgMemorial<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>Memorial Day</font>``<br />
}<br />
}<br />
<br />
// End Memorial Day<br />
<br />
if (month == 6) {<br />
<br />
// Show Independence Day<br />
<br />
if (dayNumber == 4) {<br />
if (Memorial == "no") {<br />
holiDate = true<br />
holiMsg = msgIndependence<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>Independence Day</font>``<br />
}<br />
}<br />
<br />
if (month == 8) {<br />
<br />
// Calculate Labor Day<br />
<br />
var n3 = new Date("September 1, " + year)<br />
var n4 = 2<br />
var n6 = n3.getDay() + 1<br />
n6 = 7 - n6<br />
var n8 = n4 + n6 + 1<br />
if (n4 + n6 >= 7) {<br />
n8 = n8 - 7<br />
}<br />
if (n8 == dayNumber) {<br />
if (Labor == "no") {<br />
holiDate = true<br />
holiMsg = msgLabor<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>Labor Day</font>``<br />
}<br />
<br />
// End Labor Day<br />
}<br />
<br />
if (month == 9) {<br />
<br />
// Calculate Columbus Day<br />
<br />
var n3 = new Date("October 1, " + year)<br />
var n4 = 2<br />
var n6 = n3.getDay() + 1<br />
n6 = 7 - n6<br />
var n8 = (7 + n4) + n6 + 1<br />
if (n4 + n6 >= 7) {<br />
n8 = n8 - 7<br />
}<br />
if (n8 == dayNumber) {<br />
if (Columbus == "no") {<br />
holiDate = true<br />
holiMsg = msgColumbus<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>Columbus Day</font>``<br />
}<br />
<br />
// End Columbus Day<br />
}<br />
<br />
if (month == 10) {<br />
<br />
// Show Veteran``s Day<br />
<br />
if (dayNumber == 11) {<br />
if (Veteran == "no") {<br />
holiDate = true<br />
holiMsg = msgVeteran<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>Veteran``s Day</font>``<br />
}<br />
<br />
<br />
<br />
// Calculate Thanksgiving Day<br />
<br />
var n3 = new Date("November 1, " + year)<br />
var n4 = 5<br />
var n6 = n3.getDay() + 1<br />
n6 = 7 - n6<br />
var n8 = (21 + n4) + n6 + 1<br />
if (n4 + n6 >= 7) {<br />
n8 = n8 - 7<br />
}<br />
if (n8 == dayNumber) {<br />
if (Thanksgiving == "no") {<br />
holiDate = true<br />
holiMsg = msgThanksgiving<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>Thanksgiving Day</font>``<br />
}<br />
<br />
// End Thanksgiving Day<br />
}<br />
<br />
if (month == 11) {<br />
<br />
// Show Christmas Day<br />
<br />
if (dayNumber == 25) {<br />
if (Christmas == "no") {<br />
holiDate = true<br />
holiMsg = msgChristmas<br />
}<br />
return ``<font size="-3" color=`` + holicolor + ``>Christmas Day</font>``<br />
}<br />
}<br />
<br />
return ""<br />
}<br />
<br />
function leapYear(year) {<br />
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))<br />
return true <br />
return false <br />
}<br />
<br />
function getDays(month, year) {<br />
var mDays = new Array(12)<br />
mDays[0] = 31 // January<br />
mDays[1] = (leapYear(year)) ? 29 : 28 // February<br />
mDays[2] = 31 // March<br />
mDays[3] = 30 // April<br />
mDays[4] = 31 // May<br />
mDays[5] = 30 // June<br />
mDays[6] = 31 // July<br />
mDays[7] = 31 // August<br />
mDays[8] = 30 // September<br />
mDays[9] = 31 // October<br />
mDays[10] = 30 // November<br />
mDays[11] = 31 // December<br />
return mDays[month]<br />
}<br />
<br />
function getnMonth(month) {<br />
var mon = new Array(12)<br />
mon[0] = "January"<br />
mon[1] = "February"<br />
mon[2] = "March"<br />
mon[3] = "April"<br />
mon[4] = "May"<br />
mon[5] = "June"<br />
mon[6] = "July"<br />
mon[7] = "August"<br />
mon[8] = "September"<br />
mon[9] = "October"<br />
mon[10] = "November"<br />
mon[11] = "December"<br />
return mon[month]<br />
}<br />
<br />
function getNextMonth(nxtMonth) {<br />
var nxmon = new Array(12)<br />
nxmon[0] = "Jan"<br />
nxmon[1] = "Feb"<br />
nxmon[2] = "Mar"<br />
nxmon[3] = "Apr"<br />
nxmon[4] = "May"<br />
nxmon[5] = "Jun"<br />
nxmon[6] = "Jul"<br />
nxmon[7] = "Aug"<br />
nxmon[8] = "Sep"<br />
nxmon[9] = "Oct"<br />
nxmon[10] = "Nov"<br />
nxmon[11] = "Dec"<br />
return nxmon[nxtMonth]<br />
}<br />
<br />
function getPrevMonth(prvMonth) {<br />
var pvmon = new Array(12)<br />
pvmon[0] = "Jan"<br />
pvmon[1] = "Feb"<br />
pvmon[2] = "Mar"<br />
pvmon[3] = "Apr"<br />
pvmon[4] = "May"<br />
pvmon[5] = "Jun"<br />
pvmon[6] = "Jul"<br />
pvmon[7] = "Aug"<br />
pvmon[8] = "Sep"<br />
pvmon[9] = "Oct"<br />
pvmon[10] = "Nov"<br />
pvmon[11] = "Dec"<br />
return pvmon[prvMonth]<br />
}<br />
<br />
function smartCalendar() {<br />
<br />
nxtYear = year<br />
nxtMonth = month + 1<br />
if (nxtMonth == 12) {<br />
nxtYear = nxtYear + 1<br />
nxtMonth = 0<br />
}<br />
nextMonthName = getNextMonth(nxtMonth)<br />
nxtBtn = nextMonthName + " " + nxtYear + " >>>"<br />
nxtStat = getnMonth(nxtMonth) + " " + nxtYear<br />
nxtBtn = "<b><font size=-1 face=``sans-serif, verdana, helvetica, arial``><input type=``button`` value=``" + nxtBtn + "`` width=``20`` onclick=``javascript: chgMonth(1)`` onMouseOver=``self.status=nxtStat;return true`` onMouseOut=``self.status="";return true``></font></b>"<br />
<br />
prvYear = year<br />
prvMonth = month - 1<br />
if (prvMonth == -1) {<br />
prvYear = prvYear - 1<br />
prvMonth = 11<br />
}<br />
prevMonthName = getPrevMonth(prvMonth)<br />
prvBtn = "<<< " + prevMonthName + " " + prvYear<br />
prvStat = getnMonth(prvMonth) + " " + prvYear<br />
prvBtn = "<b><font size=-1 face=``sans-serif, verdana, helvetica, arial``><input type=``button`` value=``" + prvBtn + "`` width=``20`` onclick=``javascript: chgMonth(0)`` onMouseOver=``self.status=prvStat;return true`` onMouseOut=``self.status="";return true``></font></b>"<br />
<br />
<br />
// find out what day of the week is the first day of the month<br />
var fDayMonth = new Date(year, month, 1)<br />
var dayFirst = fDayMonth.getDay()<br />
fDayMonth = null<br />
<br />
// number of days in current month<br />
var days = getDays(month, year)<br />
<br />
// draw the calendar<br />
createCalendar(dayFirst + 1, days, date, nMonth, year)<br />
}<br />
<br />
<br />
<br />
<br />
// The following code is somewhat derived from an original by <br />
// Tomer and Yehuda Shiran (http://www.geocities.com/SiliconValley/9000/)<br />
<br />
function createCalendar(dayFirst, dayLast, date, nMonth, year) {<br />
<br />
if (ver4 && showPrevNext) {<br />
showPrevNext = true<br />
}else{<br />
showPrevNext = false<br />
}<br />
<br />
<br />
<br />
var text = "" <br />
<br />
text += ``<center><form>``<br />
text += ``<table width="98%" cellspacing=4>`` // table settings<br />
<br />
text += ``<tr>``<br />
text += ``<td colspan="2" align="left">``<br />
if (showPrevNext == true) {<br />
text += prvBtn<br />
}<br />
text += ``</td>``<br />
text += ``<td colspan="3" align="center">``<br />
text += ``<font size="4" font color=`` + headercolor + `` face="sans-serif, verdana, helvetica, arial">`` // set font for table header<br />
text += nMonth + `` `` + year<br />
text += ``</font></td>``<br />
text += ``<td colspan="2" align="right">``<br />
if (showPrevNext == true) {<br />
text += nxtBtn<br />
}<br />
text += ``</td>``<br />
text += ``</tr>``<br />
text += ``</form>`` <br />
<br />
var weekDay = new Array(7)<br />
weekDay[0] = "Sunday"<br />
weekDay[1] = "Monday"<br />
weekDay[2] = "Tuesday"<br />
weekDay[3] = "Wednesday"<br />
weekDay[4] = "Thursday"<br />
weekDay[5] = "Friday"<br />
weekDay[6] = "Saturday"<br />
<br />
// setup the column headers<br />
text += ``<tr align="center" valign="center"><font face="sans-serif, verdana, helvetica, arial" color=`` + wkdaybgcolor + ``>``<br />
for (var dayNum = 0; dayNum < 7; ++dayNum) {<br />
<br />
text += ``<td width="14%" height="2%" align="center" valign="middle">``<br />
text += ``<font size="2" face="sans-serif, verdana, helvetica, arial" color=`` + headercolor + ``><b>``<br />
text += weekDay[dayNum]<br />
text += ``</b></font></td>``<br />
}<br />
text += ``</font></tr></table>``<br />
text += ``<table width="98%" height="80%" border="2" bordercolor=`` + bgcolor + `` cellspacing=4>``<br />
var dayNumber = 1<br />
var thisDate = 1<br />
<br />
for (var row = 1; row <= Math.ceil((dayLast + dayFirst - 1) / 7); ++row) {<br />
text += ``<tr align="left" valign="top">``<br />
for (var col = 1; col <= 7; ++col) {<br />
if (dayNumber > dayLast)<br />
break<br />
if (thisDate < dayFirst) {<br />
text += ``<td></td>``;<br />
thisDate++<br />
} else {<br />
var interim = getMsg(dayNumber)<br />
var currDate = new Date(nMonth + " " + dayNumber + ", " + year)<br />
<br />
if (currDate.toString() == today.toString()) {<br />
<br />
if (col == 1 || col == 7) {<br />
text += ``<td width="14%" height="15%" bgcolor=`` + wkendbgcolor + `` bordercolor=`` + todaybordercolor + ``>``<br />
} else {<br />
text += ``<td width="14%" height="15%" bgcolor=`` + wkdaybgcolor + `` bordercolor=`` + todaybordercolor + ``>``<br />
}<br />
} else {<br />
if (col == 1 || col == 7) {<br />
text += ``<td width="14%" height="15%" bgcolor=`` + wkendbgcolor + `` bordercolor=`` + typecolor + ``>``<br />
} else {<br />
text += ``<td width="14%" height="15%" bgcolor=`` + wkdaybgcolor + `` bordercolor=`` + typecolor + ``>``<br />
}<br />
}<br />
<br />
text += ``<font size=1 face="sans-serif, verdana, helvetica, arial">`` <br />
if (currDate.toString() == today.toString()) {<br />
text += ``<font size="-3" color=`` + todaybordercolor + ``>`` <br />
} else { <br />
text += ``<font size="-3" color=`` + typecolor + ``>`` <br />
}<br />
<br />
text += dayNumber <br />
text += ``</font><br>``<br />
text += ``<font size=1 Face="ms sans serif, sans-serif, verdana, helvetica, arial">``<br />
var isHolidates = getHolidates(dayNumber)<br />
<br />
if (isHolidates != null) {<br />
text += ``<center>`` + isHolidates + ``<br>``<br />
} else {<br />
text += ``<center><br>``<br />
}<br />
<br />
if (useDailyMsg) {<br />
text += ``<center><font size="-3" color=`` + dailymsgcolor + ``>`` + dailyMsg + ``</font><br>``<br />
}<br />
<br />
if (superCap > "") {<br />
text += ``<font size="-3" color=`` + replmsgcolor + ``>`` + superCap + ``</font>`` <br />
} else if (holiMsg > "" && holiDate == true && isDyMsg == true) {<br />
if (holiMsg > "" && holiMsg.charAt(0) == "+") {<br />
lenCaption = holiMsg.length - 1<br />
holiMsg = holiMsg.substr(1, lenCaption)<br />
holiMsg = holiMsg + showDST<br />
} <br />
text += ``<font size="-3" color=`` + defmsgcolor + ``>`` + holiMsg + ``</font>`` <br />
} else { <br />
text += interim<br />
}<br />
<br />
text += ``</center></font>``<br />
text += ``</td>``<br />
holiDate = false<br />
addTo = false<br />
superCap = ""<br />
replMsg = ""<br />
isDyMsg = false<br />
dayNumber++<br />
}<br />
}<br />
text += ``</tr>``<br />
} <br />
<br />
text += ``</table>``<br />
text += ``</center></form>``<br />
<br />
var whichEl<br />
<br />
<br />
if (NS4) {<br />
whichEl = document.layers.Cal.document;<br />
whichEl.open();<br />
whichEl.write(text);<br />
whichEl.close();<br />
localDigitalTime() <br />
} else if (IE4) {<br />
whichEl = document.all.Cal<br />
whichEl.innerHTML = text;<br />
localDigitalTime()<br />
} else {<br />
document.write(text)<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
</script>
|
|
³×ƼÁð ÀÇ°ß ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.) |
|