PageSourceSearch

https://www.hondacars-gunmanishi.co.jp/common-js/mut.calendar.class.js

js hondacars-gunmanishi.co.jp collected 2026-10-09 00:47:28 UTC 35,557 bytes, 775 lines download raw bytes

1// Cal3.4.0 / 2012-10-22
2// SYNCK GRAPHICA
3// charset shift_jis
4
5var jsCalendar = function(target) {
6    this. targetClass      = (target) ? target : 'cal';
7    this. daysClass        = [];
8    this. week             = [];
9    this. month            = [];
10    this. xDays            = [];
11    this. xDaysLater       = [];
12    this. calObj           = new Array();
13    this. calObj[0]        = {
14        defaultMonth   : 0,
15        daysClass      : {},
16        xDays          : {},
17        week           : {},
18        xDaysLater     : {},
19        month          : {},
20        backward       : 'backward',
21        priority       : [ 'month', 'week', 'xDay', 'xDaysLater', 'day', 'backward' ]
22    };
23    this.wEnName           = ["sun","mon","tue","wed","thu","fri","sat"];
24
25    this.preload           = function()
26    {
27        this.calLength        = ( typeof calLength          !== 'undefined' && !isNaN( calLength ) && calLength > 0 ) ? calLength : 12;
28        this.yearMonthInTable = ( typeof yearMonthInTable   !== 'undefined' ) ? yearMonthInTable  : false;
29        this.calCellSpacing   = ( typeof calCellSpacing     !== 'undefined' ) ? calCellSpacing    : 0;
30        this.calShowPrevMonth = ( typeof calShowPrevMonth   !== 'undefined' ) ? calShowPrevMonth  : false;
31        this.calShowNextMonth = ( typeof calShowNextMonth   !== 'undefined' ) ? calShowNextMonth  : false;
32        this.calWeekLine      = ( typeof calWeekLine        !== 'undefined' ) ? calWeekLine       : null;
33        this.minYear          = ( typeof calMinYear         !== 'undefined' ) ? calMinYear        : 0;
34        this.maxYear          = ( typeof calMaxYear         !== 'undefined' ) ? calMaxYear        : 0;
35        this.minMonth         = ( typeof calMinMonth        !== 'undefined' ) ? calMinMonth       : 1;
36        this.maxMonth         = ( typeof calMaxMonth        !== 'undefined' ) ? calMaxMonth       : 1;
37        this.weekImgDirectory = ( typeof weekImgDirectory   !== 'undefined' ) ? weekImgDirectory  : '/site/img/';
38        this.useYearImage     = ( typeof useYearImage       !== 'undefined' ) ? !!useYearImage    : true;
39        this.yImgEx           = ( typeof yImgEx             !== 'undefined' ) ? yImgEx            : '.gif';
40        this.useMonthImage    = ( typeof useMonthImage      !== 'undefined' ) ? !!useMonthImage   : false;
41        this.mImgEx           = ( typeof mImgEx             !== 'undefined' ) ? mImgEx            : '.gif';
42        this.yearLabel        = ( typeof yearLabel          !== 'undefined' ) ? yearLabel         : '”N';
43        this.notationOfMonth  = ( typeof notationOfMonth    !== 'undefined' ) ? notationOfMonth   : ['','1ŒŽ','2ŒŽ','3ŒŽ','4ŒŽ','5ŒŽ','6ŒŽ','7ŒŽ','8ŒŽ','9ŒŽ','10ŒŽ','11ŒŽ','12ŒŽ'];
44        this.notationOfWeek   = ( typeof notationOfWeek     !== 'undefined' ) ? notationOfWeek    : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
45        this.useWeekImage     = ( typeof useWeekImage       !== 'undefined' ) ? useWeekImage      : false;
46        this.wImgEx           = ( typeof wImgEx             !== 'undefined' ) ? wImgEx            : '.gif';
47        this.weekLabel        = ( typeof weekLabel          !== 'undefined' ) ? weekLabel         : '';
48////////// daysClass‚ɑ΂µ‚ďî•ñ‚̒ljÁˆ—
49        if ( typeof ____daysClass !== 'undefined' )                             // list.js‚©‚ç‚̌Ăяo‚µƒf[ƒ^
50            for ( i=0; i<____daysClass.length; i++ )
51                this.daysClass.push( ____daysClass[i] );
52        if ( typeof calDaysClass !== 'undefined' )                                 // ‹’“_–ˆ‚̌Ăяo‚µƒf[ƒ^
53            for ( i=0; i<calDaysClass.length; i++ )
54                this.daysClass.push( calDaysClass[i] );
55////////// week‚ɑ΂µ‚ďî•ñ‚̒ljÁˆ—
56        if ( typeof ____week !== 'undefined' )                             // list.js‚©‚ç‚̌Ăяo‚µƒf[ƒ^
57            for ( i=0; i<____week.length; i++ )
58                this.week.push( ____week[i] );
59        if ( typeof calWeeksClass !== 'undefined' )                                 // ‹’“_–ˆ‚̌Ăяo‚µƒf[ƒ^
60            for ( i=0; i<calWeeksClass.length; i++ ){
61                this.week[ calWeeksClass[i][0] ][1] = this.week[ calWeeksClass[i][0] ][1] + " " + calWeeksClass[i][1];
62            }
63////////// month‚ɑ΂µ‚ďî•ñ‚̒ljÁˆ—
64        if ( typeof ____month !== 'undefined' )                                  // list.js‚©‚ç‚̌Ăяo‚µƒf[ƒ^
65            for ( i=0; i<____month.length; i++ )
66                this.month.push( ____month[i] );
67        if ( typeof calMonthsClass !== 'undefined' )                                      // ‹’“_–ˆ‚̌Ăяo‚µƒf[ƒ^
68            for ( i=0; i<calMonthsClass.length; i++ )
69                this.month.push( calMonthsClass[i] );
70////////// xDays‚ɑ΂µ‚ďî•ñ‚̒ljÁˆ—
71        if ( typeof ____xDays !== 'undefined' )                                  // list.js‚©‚ç‚̌Ăяo‚µƒf[ƒ^
72            for ( i=0; i<____xDays.length; i++ )
73                this.xDays.push( ____xDays[i] );
74        if ( typeof calXDaysClass !== 'undefined' )                                      // ‹’“_–ˆ‚̌Ăяo‚µƒf[ƒ^
75            for ( i=0; i<calXDaysClass.length; i++ )
76                this.xDays.push( calXDaysClass[i] );
77////////// xDaysLater‚ɑ΂µ‚ďî•ñ‚̒ljÁˆ—
78        if ( typeof ____xDaysLater !== 'undefined' )                                  // list.js‚©‚ç‚̌Ăяo‚µƒf[ƒ^
79            for ( i=0; i<____xDaysLater.length; i++ )
80                this.xDaysLater.push( ____xDaysLater[i] );
81        if ( typeof calXDaysLaterClass !== 'undefined' )                                      // ‹’“_–ˆ‚̌Ăяo‚µƒf[ƒ^
82            for ( i=0; i<calXDaysLaterClass.length; i++ )
83                this.xDaysLater.push( calXDaysLaterClass[i] );
84////////// notationOfWeek‚ɑ΂µ‚Ă̏î•ñ‚̏㏑‚«ˆ—
85        if ( typeof notationOfWeek !== 'undefined' && notationOfWeek.length == 7 )                                      // ‹’“_–ˆ‚̌Ăяo‚µƒf[ƒ^
86            for ( i=0; i<notationOfWeek.length; i++ )
87                this.notationOfWeek[i] = notationOfWeek[i];
88    }
89
90    // “ú•t‚ɑ΂µ‚Đݒ肳‚ê‚Ä‚¢‚éclass‚ð”z—ñŒ`Ž®‚Å‘S‚Ä•À‚ׂé
91    this.init             = function()
92    {
93        dChk = {};
94        for ( i=0; i<this.daysClass.length; i++ )            // daysClass‚̐”‚¾‚¯ˆ—
95        {
96            if ( typeof this.daysClass[i] !== 'undefined' ){ // daysClass‚Ì“ú•t•”•ª‚ª˜A‘z”z—ñ’†‚Ɋ܂܂ê‚Ä‚¢‚È‚¯‚ê‚Î
97                if ( ! ( this.daysClass[i][0] in dChk ) )    // ƒvƒƒpƒeƒB‚Å‘¶Ý‚µ‚È‚¢‚©ƒ`ƒFƒbƒN
98                {
99                    dChk[ this.daysClass[i][0] ] = [];
100                    /* daysClass‚ɐݒ肳‚ꂽ“ú•t‚ðkey‚ÉŽ‚Á‚½˜A‘z”z—ñ‚ªo—ˆ‚Ä‚¢‚­
101                    dChk = {
102                        '2013/5/13' = [],
103                        '2013/5/14' = [],
104                        '2013/6/2'  = [],
105                        '2013/8/15' = []
106                    };
107                    */
108                }
109            // ã‚ō쐬‚µ‚½[]‚Ì’†‚ɁAdaysClass‚Őݒ肳‚ꂽclass–¼‚ð”z—ñ‚Æ‚µ‚Äpush’ljÁ‚µ‚Ä‚¢‚­
110                dChk[ this.daysClass[i][0] ].push( this.daysClass[i][1] );
111            }
112        }
113
114        // “ú•t‚ɑ΂µ‚Đݒ肳‚ê‚Ä‚¢‚éclass‚ð”z—ñŒ`Ž®‚Å‘S‚Ä•À‚ׂé
115        for ( key in dChk )
116        {
117            names = {};
118            for ( var i=0; i<dChk[key].length; i++ )
119            {   // dChk‚Ìkey‚²‚Æ‚Éclass‚ð‚»‚ê‚¼‚êˆê’PˆÊ‚Ì”z—ñ‰»‚µ‚Ä‚¢‚­
120                dChk_sp = dChk[key][i].split(' ');
121                /*
122                    '2013/5/13' = [class1, class1 class2, class3, class1],
123                    « ã‹L‚̏ꍇ
124                    dChk_sp = [class1], [class1 class2], [class3, class1]
125                */
126
127                // d•¡‚µ‚Ä‚¢‚éclass‚ð‚܂Ƃ߂āAclass–¼‚ðkey‚ÉŽ‚˜A‘z”z—ñ‚ðì¬
128                for ( var j=0; j<dChk_sp.length; j++ )
129                {   // Ý’肳‚ꂽclass–¼‚ª "" ‚łȂ¢‚©Šm”F
130                    if(dChk_sp[j] != "")
131                    {   // class–¼‚ðkey‚ɁAvalue‚Í""‚̘A‘z”z—ñ‚ðì¬‚µ‚Ä‚¢‚­i“¯‚¶class–¼‚͏㏑‚«‚³‚ê‚é‚̂ŏd•¡class‚ªã‘‚«‚³‚ê‚Ä‚¢‚­j
132                        names[dChk_sp[j]] = '';    //names['close'] = ''; names['red'] = ''; names['wtf'] = '';
133                    }
134                }
135            }
136            // class‚𔼊pƒXƒy[ƒX‹æØ‚è‚Ì•¶Žš—ñ‚ÅcalObj[0].daysClass‚É‘ã“ü
137            printDaysClass       = [];
138
139            // Ý’è‚·‚éclass–¼‚ðkey‚ÉŽ‚”z—ñinamesj‚Ì—v‘f‚̐”‚¾‚¯ˆ—‚ðŽÀs
140            for ( n in names )
141            {   // ”z—ñprintDaysClass‚ɁAÝ’è‚·‚éclass–¼id•¡íœÏ‚݁j‚ð‡‚É’Ç‰Á‚µ‚Ä‚¢‚­
142                printDaysClass.push(n);
143            }
144            // calObj[0].daysClass[ daysClass‚Őݒ肳‚ꂽ“ú•t ] = ”¼ŠpƒXƒy[ƒX‹æØ‚è‚̐ݒ肷‚éclass–¼ + ––”ö‚É";"
145            this.calObj[0].daysClass[ key ] = printDaysClass.join(' ') + ';';
146        }
147
148        for ( i=0; i<this.week.length; i++ )
149            this.calObj[0].week[ this.week[i][0] ]   = this.week[i][1];
150        for ( i=0; i<this.month.length; i++ )
151            this.calObj[0].month[ this.month[i][0] ] = this.month[i][1];
152        for ( i=0; i<this.xDays.length; i++ )
153            this.calObj[0].xDays[ this.xDays[i][0] ] = this.xDays[i][1];
154        for ( i=0; i<this.xDaysLater.length; i++ )
155            this.calObj[0].xDaysLater[ this.xDaysLater[i][0] ] = this.xDaysLater[i][1];
156
157/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
158/* ‚±‚±‚܂ŋx“úŽw’è */
159
160        // ƒJƒŒƒ“ƒ_[•¡»
161        for ( cloneRepeat=1; cloneRepeat<this.calLength+1; cloneRepeat++ )
162        {
163            this.calObj[cloneRepeat] = this.cal_clone( this.calObj[0] );
164            this.calObj[cloneRepeat].defaultMonth = cloneRepeat;                // ‰Šú•\ަ‚ð—‚ŒŽ‚ÉŽw’肵‚½—á
165        }
166
167        // calObj‚Ì’†‚É calendars ‚Ì”z—ñ‚ðì¬
168        this.calObj.calendars = [];
169        /////////////////////// ŒŽÝ’è ///////////////////////
170        // notationOfMonth‚Å’è‹`‚³‚ꂽŒŽ–¼‚ðcalObj.monthName‚ɐݒè
171        this.calObj.monthName   = this.notationOfMonth;
172
173        // ŒŽ––“ú‚Ì”z—ñ’è‹`
174        this.calObj.days        = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
175        // ŒŽ‰‚É‘OŒŽ‚Ì“ú•t‚ð•\ަ
176        this.calObj.calShowPrevMonth = this.calShowPrevMonth;
177        // ŒŽ––‚É—‚ŒŽ‚Ì“ú•t‚ð•\ަ
178        this.calObj.calShowNextMonth = this.calShowNextMonth;
179
180        // “ú•t‚̍s”ŒÅ’è‚̏ꍇ‚Ì•\ަ”
181        this.calObj.calWeekLine = this.calWeekLine;
182        //////////////////////////////////////////////////////
183        ////////////////////// —j“úÝ’è //////////////////////
184
185        // —j“ú–¼‚ð’è‹`
186        this.calObj.weekName    = this.notationOfWeek;
187
188        // —j“ú‰æ‘œ‚Ì”z—ñ’è‹`
189        this.calObj.wImg = new Array();
190        // —j“ú‰æ‘œsrc‚ð”z—ñ‚É‘ã“ü ex)***/site/img/cal_week_sun.gif
191        for(i=0; i<this.calObj.weekName.length; i++ ){
192            this.calObj.wImg[i] = this.weekImgDirectory + 'week_' + this.wEnName[i] + this.wImgEx;
193        }
194        //////////////////////////////////////////////////////
195        ////////////////////// Œ»Ý“úŽž //////////////////////
196        this.calObj.date        = typeof defaultYmd === 'undefined' ? new Date() : defaultYmd;
197        this.calObj.date        = new Date(
198            this.calObj.date.getFullYear() + "/" +
199          ( this.calObj.date.getMonth() + 1) + "/" +
200            this.calObj.date.getDate() + " 00:00:00");
201        this.calObj.day         = this.calObj.date.getDate();
202        this.calObj.month       = this.calObj.date.getMonth() + 1;
203        this.calObj.year        = this.calObj.date.getFullYear();
204
205        // ƒ`ƒFƒbƒN—pƒNƒGƒŠŽQÆ
206        if(location.search){
207            var calChk = (location.search.substring(1).split('&'));
208            for(var i=0; i<calChk.length; i++){
209                if(calChk[i].indexOf('calChk') !== -1){
210                    calChk = ( ( calChk[i].split('=') )[1] ).split('/');
211                    this.calObj.day   = Number(calChk[2]);
212                    this.calObj.month = Number(calChk[1]);
213                    this.calObj.year  = Number(calChk[0]);
214                }
215            }
216        }
217
218        //////////////////////////////////////////////////////
219        ////////////////// ŒŽ‘—‚è•\ަ‰Â”\” //////////////////
220        // Å‘å”NAÅ¬”N
221        this.minY = ( this.calObj.year ) - ( this.minYear );
222        this.maxY = ( this.calObj.year ) + ( this.maxYear );
223
224        // Å¬ŒŽ
225        this.minM = ( this.calObj.month ) - ( this.minMonth );
226        if ( 0 < this.minM ){
227            this.minM = this.minM;
228        }else{
229            this.minM = this.minM + 12;
230            this.minY = this.minY - 1;
231        }
232        // Å‘匎
233        this.maxM = ( this.calObj.month ) + ( this.maxMonth );
234        if( this.maxM < 13 ){
235            this.maxM = this.maxM;
236        }else{
237            this.maxM = this.maxM - 12;
238            this.maxY = this.maxY + 1;
239        }
240    }
241
242    // 1Œ…‚̐”Žš‚ð0–„‚ß‚Å2Œ…‚É‚·‚éŠÖ”‚ð—pˆÓ
243    this.toDoubleDigits = function ( num )
244    {
245        num += "";
246        if( num.length === 1 )
247            num = "0" + num;
248        return num;
249    }
250
251    // ”z—ñ‚©‚çd•¡‚·‚é‚à‚Ì‚ðíœ
252    this.unique = function ( array ) {
253      var storage = {};
254      var uniqueArray = [];
255      var i,value;
256      for ( i=0; i<array.length; i++) {
257         value = array[i];
258          if (!(value in storage)) {
259            storage[value] = true;
260             uniqueArray.push(value);
261           }
262       }
263       return uniqueArray;
264    }
265
266    this.cal_init       = function()
267    {
268        var d        = window.document;
269        var tagObj   = d.getElementsByTagName("div");                       // divƒ^ƒO‚ð’T‚·
270        for ( i=0; i<tagObj.length; i++)                                        // divƒ^ƒO‚»‚ꂼ‚ê‚ÉŽÀs
271            if ( tagObj[i].className == this.targetClass + 'Wrap' )
272            {   
273                // class = calWrap ‚¾‚Á‚½‚çdiv.calWrap‚Ìid‚ð’²‚×‚Ä "cal"ˆÈ~‚Ì•¶Žš‚ðŽæ“¾‚µ‚Ä calObj.calendars ‚É”z—ñ”ԍ†‚Æ‚µ‚Ä‘ã“ü
274                var calId = Number(tagObj[i].id.substring(3,tagObj[i].id.length));
275                this.calObj.calendars.push( calId );
276
277                // Œ»Ý‚ÌŒŽ‚Æ‰ÁŽZ‚·‚錎‚̍‡Œv’l
278                var totalMonth = this.calObj.month + this.calObj[ calId ].defaultMonth;
279
280                // ‰½”N‚Ü‚½‚®‚©i‰ÁŽZ‚·‚é”N”j‚ðŒvŽZ
281                var addYear = Math.floor((totalMonth - 1) / 12);
282
283                // •\ަ‚·‚錎‚ðŒvŽZ
284                var tmpMonth = totalMonth % 12;
285                if ( tmpMonth === 0 ) {
286                    // —]‚肪0‚̏ꍇ‚Í12ŒŽ‚ɕ␳
287                    tmpMonth = 12;
288                }
289
290                // ŒvŽZ‚Å‹‚ß‚½‰ÁŽZ”N”iaddYearj‚ðŽg‚Á‚Ä“úŽž‚ðÝ’肵‚Ü‚·
291                this.calObj[ calId ].currentMonth = new Date(
292                    ( this.calObj.year + addYear ) + "/" + tmpMonth + "/" + "1 00:00:00" 
293                );
294
295                this.cal_create( calId );
296            }
297    }
298
299    // ‚±‚±‚©‚çƒJƒŒƒ“ƒ_[¶¬iƒ{ƒ^ƒ“‘—‚è‚ÌÛ‚à–ˆ‰ñŽÀs‚³‚ê‚é
300    this. cal_create = function( calId )
301    {
302        var d     = window.document;
303        // ”N,ŒŽ,“ú,—j“ú‚ð‚»‚ê‚¼‚êcurrentMonth‚ɉž‚¶‚Ä’è‹`
304        var year  = this.calObj[ calId ].currentMonth.getFullYear();
305        var month = this.calObj[ calId ].currentMonth.getMonth() + 1;
306        var day   = this.calObj[ calId ].currentMonth.getDate();
307        var week  = this.calObj[ calId ].currentMonth.getDay();
308        var MonthDays   = this.calObj.days[ month ];                              // ŒŽ––“ú‚̐ݒè
309        var bisDay      = 0;
310        var bisAfter    = 0;
311        if ( month == 2 || month == 3 ){
312            if ( year % 100 == 0 || year % 4 != 0 )
313                if ( year % 400 != 0 )
314                    bisDay = 0;
315                else{
316                    if(month == 2){ bisDay = 1; }
317                    else{ bisAfter = 1; }
318                }
319            else if ( year % 4 == 0 ){
320                if(month == 2){ bisDay = 1; }
321                else{ bisAfter = 1; }
322            }
323            else{
324                bisDay = 0;
325            }
326            MonthDays += bisDay;
327        }
328        // ƒJƒŒƒ“ƒ_[tableŠJŽnƒ^ƒO
329        var calHTML = "<table border='0' cellspacing='"+ this.calCellSpacing +"' cellpadding='0' class='cal" + " year" + year + " month" + month + "'>";
330        /* calHTML‚É "calHTML += *****;"‚ð’ljÁ‚µ‚Ä‚¢‚­‚±‚Æ‚Åtable‚Ì’†‚ÌhtmlƒRƒ“ƒeƒ“ƒc‚ð’ljÁ‚µ‚āAÅŒã‚É"('cal'+calId).innerHTML = calHTML;"‚ÅŽÀs‚·‚é  */
331        if ( this.yearMonthInTable )
332        {   // ”NŒŽ‚ðtable‚É“ü‚ê‚éê‡
333            calHTML += '<tr class="yearMonthText"><th colspan="7"><div>';
334            calHTML += "<span class='cal_year'>" + year + this.yearLabel + "</span>";
335            calHTML += "<span class='cal_month'>" + this.calObj.monthName[month] + "</span>";
336            calHTML += "</div></th></tr>";
337        }else
338        {   //”NŒŽ‚ðtable‚ÌŠO‚ÉŽ©—R‚ɃŒƒCƒAƒEƒg‚·‚éê‡
339            yObj = jQuery('.cal_year').eq( calId );
340            mObj = jQuery('.cal_month').eq( calId );
341
342            if( jQuery('.cal_year').length > 0 ){
343                if ( this.useYearImage )
344                {   // ”N‰æ‘œ
345                    // ƒJƒŒƒ“ƒ_[‚̏‡”Ô‚Æ“¯‚¶index”ԍ†‚Ì”N‰æ‘œ‚Ìsrc‚ðŽæ“¾
346                    var yObj  = jQuery('.cal_year').eq(calId).find('img');
347                    // ‰æ‘œ‚Ìsrc‚©‚çƒtƒ@ƒCƒ‹–¼‚Ì‚Ý‚ðŽæ‚èo‚·
348                    var ySrc  = yObj.attr('src');
349                        ySrc  = ySrc.split('/');
350                    var yFile = ySrc[ySrc.length - 1];
351
352                    // ”N ‰æ‘œ‚̃tƒ@ƒCƒ‹–¼‚ðƒJƒŒƒ“ƒ_[‚²‚Ƃ̐ݒè‚Ì”N‚ɍ‡‚킹‚é
353                        yFile = yFile.replace( /\d\d\d\d/, (year) );  // ”N”Žš’uŠ·
354                        yFile = yFile.replace( /\..*/, this.yImgEx ); // Šg’£Žq’uŠ·
355                        ySrc[ySrc.length - 1] = yFile;
356                        ySrc      = ySrc.join('/');
357
358                    yObj.attr({
359                        alt: (year)+'”N',
360                        src: (ySrc)
361                    });
362                }else
363                    yObj.html( year + this.yearLabel );
364            }
365            if( jQuery('.cal_month').length > 0 ){
366                if ( this.useMonthImage )
367                {
368                    // ŒŽ‚ð0–„‚ß‚Ì2Œ…‚ɕϊ·
369                    var month2dig = this.toDoubleDigits(month);
370                    // ƒJƒŒƒ“ƒ_[‚̏‡”Ô‚Æ“¯‚¶index”ԍ†‚Ì”N‰æ‘œ‚Ìsrc‚ðŽæ“¾
371                    var mObj  = jQuery('.cal_month').eq(calId).find('img');
372                    // ŒŽ ‰æ‘œ‚©‚çƒtƒ@ƒCƒ‹–¼‚Ì‚Ý‚ðŽæ‚èo‚·
373                    var mSrc  = mObj.attr('src');
374                        mSrc  = mSrc.split('/');
375                    var mFile = mSrc[mSrc.length - 1];
376
377                    // ŒŽ‰æ‘œ‚Ìsrc‚ðƒJƒŒƒ“ƒ_[‚²‚Ƃ̐ݒè‚ÌŒŽ‚É‡‚킹‚é
378                        mFile = mFile.replace( /\d\d/, (month2dig) ); // ŒŽ”Žš’uŠ·
379                        mFile = mFile.replace( /\..*/, this.mImgEx ); // Šg’£Žq’uŠ·
380                        mSrc[mSrc.length - 1] = mFile;
381                        mSrc      = mSrc.join('/');
382
383                    mObj.attr({
384                        alt: (month)+'ŒŽ',
385                        src: (mSrc)
386                    });
387                }else
388                    mObj.html( this.calObj.monthName[month] );
389            }
390        }
391        // —j“ú¶¬
392        calHTML += "<tr class='cal_headline'>";
393            if ( this.useWeekImage )                                            // ‰æ‘œ‚̏ꍇ
394                for ( i=0; i<7; i++ )
395                    calHTML += "<th><img src='" + this.calObj.wImg[i] + "' alt='" + this.calObj.weekName[i] + this.weekLabel + "' /></th>";
396            else                                                                // ƒeƒLƒXƒg‚̏ꍇ
397                for ( var i=0;i<7;i++ )
398                    calHTML += "<th><div class='" + this.calObj[calId].week[i] + "'>" + this.calObj.weekName[i] + "</div></th>";
399        calHTML += "</tr>";
400
401        // Œ»Ý‚̍si<tr></tr>j‚̐”
402        var currentCalWeekLine = 1;
403
404        // ŒŽ‰‚ߋ󔒃Zƒ‹ = week
405        // ŒŽI‚í‚è‹ó”’ƒZƒ‹” =
406        var endBlankLength = ( 7 - ( (this.calObj.days[month]+bisDay+week) % 7) );
407
408        /* 1“ú‚܂ł̋ótd¶¬
409        ////////////////////////////////////////////////////////*/
410        calHTML += "<tr>";
411
412        if(this.calObj.calShowPrevMonth){ // ‹ó‚Ìtd‚É‘OŒŽ‚Ì––“ú‚𐶐¬
413                var temp_month = (month - 1 == 0) ? 12 : month - 1;
414                var prevEnd = ( this.calObj.days[temp_month]+bisAfter ) - (week - 1);
415            for ( i=0; i<week; i++ ){
416                calHTML += "<td><div class='cal_PrevMonthDay cal_adjoin'>" + (prevEnd + i) + "</div></td>";
417            }
418        }else{ // calShowPrevMonth ‚ª‚È‚¯‚ê‚Ηj“ú‚̐”‚¾‚¯‹ó‚Ìtd‚𐶐¬
419            for ( i=0; i<week; i++ )
420                calHTML += "<td><div class='cal_blank cal_pre_blank'>&nbsp;</div></td>";
421        }
422
423        //Œ»Ý‚Ì—j“úƒJƒEƒ“ƒg—p”z—ñ’è‹`@¦“y—j‚ɂȂÁ‚½‚ç‰üsitr‚𑝂₷j‚·‚é
424        var WeekCnt = new Array();
425
426        /* “ú•t‚ð‚Ç‚±‚܂ŕ\ަ‚·‚é‚©
427        ////////////////////////////////////////////////////////*/
428
429        // ŒŽ––“ú‚Ü‚Å
430        var dayCntLimit = this.calObj.days[month]+bisDay;
431
432        if(this.calObj.calShowNextMonth){@// —‚ŒŽ‚Ì“ú•t‚ð•\ަ
433            if(this.calWeekLine){ // s”ŒÅ’è + —‚ŒŽ‚Ì“ú•t‚ð•\ަ
434                var dayCntLimit = (this.calObj.calWeekLine * 7 - week <= dayCntLimit+endBlankLength) ? dayCntLimit+endBlankLength : this.calObj.calWeekLine * 7 - week
435            } else{ // ŒŽ––“ú‚©‚ç“y—j‚܂łɗ‚ŒŽ‚Ì“ú•t‚ð•\ަ
436                var dayCntLimit = dayCntLimit+endBlankLength;
437            }
438        }
439
440        // td‚ЂƂ‚ЂƂ‚̐ݒèiŒŽ––“úi + Ý’莟‘æ‚Å—‚ŒŽ‰‚߂̓ú•tj‚܂ňȉº‚Ìscript‚ðŒJ‚è•Ô‚µŽÀsj
441        for ( dayCnt=1; dayCnt<= dayCntLimit; dayCnt++ )
442        {
443            var insertYear = year;
444            var insertMonth = month;
445            var insertDay   = dayCnt;
446
447            if( dayCnt > ( this.calObj.days[month] + bisDay ) ){
448                var insertYear  = (month + 1 > 12) ? year + 1 : year;
449                var insertMonth = (month + 1 > 12) ? 1 : month + 1;
450                var insertDay   = dayCnt - (this.calObj.days[month] + bisDay);
451            }
452
453            if ( WeekCnt[week] == undefined )
454                WeekCnt[week] = 0;
455            WeekCnt[week]++;
456
457
458
459            // Ý’è‚Ƀ}ƒbƒ`‚µ‚½class‚ð dayClass ‚Ì’†‚É“ü‚ê‚Ä‚¢‚­
460            var dayClass = new Object();
461
462
463            // ì¬’†td‚Ì“ú•t
464            var currentDayDate = new Date( insertYear + "/" + insertMonth + "/" + insertDay + " 00:00:00" );
465            // Œ»Ý‚Ì“ú•t‚æ‚èŒã‚Ì“ú•t(‘O“ú‚ª-1AŒ»Ý‚Ì“ú•t‚ª0A—‚“ú‚ª+1)
466            var laterDay = Math.floor(
467                ( currentDayDate.getTime() - this.calObj.date.getTime() ) / 1000 / (60 * 60 * 24) );
468            // Šetd‚ɐU‚éID td_ƒJƒŒƒ“ƒ_[ID_yyyy_mm_dd
469            var tdId = "td_"+calId+"_"+insertYear+"_"+insertMonth+"_"+insertDay;
470
471            /* backward */
472            if ( this.calObj[calId].backward != null && currentDayDate.getTime() < this.calObj.date.getTime())
473                dayClass["backward"] = this.calObj[calId].backward;
474            /* week */
475            //calObj[0].week[3] == "string" && calObj[0].week[3][undefined]
476            if ( typeof( this.calObj[calId].week[week] ) == "object" &&
477                         this.calObj[calId].week[week][WeekCnt[week]] != undefined )
478            {
479                dayClass["week"] = this.calObj[calId].week[week][WeekCnt[week]];
480            }
481            //calObj[0].week[3] == "wed close" && //calObj[0].week[3]
482            else if ( this.calObj[calId].week[week] != undefined &&
483                typeof ( this.calObj[calId].week[week] ) != "object" )
484            {
485                dayClass["week"] = this.calObj[calId].week[week];
486            }
487            /* month i›ŒŽ-~—j“ú-‘恢TA~—j“ú-‘恢Tj‚̐ݒè */
488            // Œ»Ý‚ª‘扽T‚©‚ðŽQÆ‚µ‚ā›ŒŽ-~—j“ú-‘恢T‚Ì’è‹`
489            var monStr = insertMonth + '-' + week + '-' + WeekCnt[ week ];
490            // Œ»Ý‚ª‘扽T‚©‚ðŽQÆ‚µ‚ā~—j“ú-‘恢T‚Ì’è‹`
491            var weekStr = week + '-' + WeekCnt[week];
492            // ˜A‘z”z—ñˆê’v‚Å monStr(›ŒŽ-~—j“ú-‘恢T)‚Ɉê’v‚µ‚½ê‡
493            if ( this.calObj[calId].month[monStr] != undefined )
494                dayClass["month"]      = this.calObj[calId].month[monStr];
495            // ˜A‘z”z—ñˆê’v‚Å weekStr(~—j“ú-‘恢T)‚Ɉê’v‚µ‚½ê‡
496            else if ( this.calObj[calId].month[weekStr] != undefined )
497                dayClass["month"]      = this.calObj[calId].month[weekStr];
498            /* xDay */
499            if ( this.calObj[calId].xDays[insertDay] != undefined )
500                dayClass["xDay"]       = this.calObj[calId].xDays[ insertDay ];
501            /* xDaysLater */
502            if ( this.calObj[calId].xDaysLater[laterDay] != undefined )
503                dayClass["xDaysLater"] = this.calObj[calId].xDaysLater[laterDay];
504            /* day “ú•t‚²‚Æ */
505            // ƒXƒ‰ƒbƒVƒ…‹æØ‚è‚Ł@yyyy/m/dd
506            var dayStr = insertYear + "/" + insertMonth + "/" + insertDay;
507            // ƒXƒ‰ƒbƒVƒ…‹æØ‚è‚Ł@m/dd
508            var dayStrN = insertMonth + "/" + insertDay;
509            // ì¬’†ƒZƒ‹‚Ì”NŒŽ“ú‚ªdayÝ’è‚Ɋ܂܂ê‚Ä‚¢‚ê‚Î
510            var dayJoin = new Array();
511            if ( this.calObj[calId].daysClass[dayStr] != undefined )
512                dayJoin.push( this.calObj[calId].daysClass[dayStr] );
513            // ì¬’†ƒZƒ‹‚ÌŒŽ“ú‚ªdayÝ’è‚Ɋ܂܂ê‚Ä‚¢‚ê‚΁i¦”N‚ðÈ‚¢‚½–ˆ”N“K—pÝ’èj
514            if ( this.calObj[calId].daysClass[dayStrN] != undefined )
515                dayJoin.push( this.calObj[calId].daysClass[dayStrN] );
516            if(dayJoin.length != 0){
517                dayClass["day"] = dayJoin.join(' ');
518                dayClass["day"] = dayClass["day"].replace(';', '');
519            }
520            var tdClassArr   = new Array();
521            var tdTextArr    = new Array();
522            var tdLinkArr    = new Array();
523            var tdClassPre   = new Array();
524            var tdClassStr   = "";
525            var tdClassNames = new Object();
526            /* priority‚̏‡‚Å”z—ñ‚ðì¬ */
527            //priority”z—ñ‚Ìclass‚̐”‚¾‚¯ŒJ‚è•Ô‚µ
528            for ( ci=0; ci<this.calObj[calId].priority.length; ci++ )
529            {   //dayclass(Ý’è‚Æƒ}ƒbƒ`‚µ‚½class)‚É priority‚ÅŽw’肵‚½class‚ª‚ ‚é‚©Šm”F
530                //(—á: calObj[0].priority = new Array('month','week','xDay','xDaysLater','day','backward');)
531                // dayclass‚ª‚ ‚Á‚½ê‡
532                if ( dayClass[ this.calObj[calId].priority[ci] ] != undefined)
533                {   // dayclass‚ð splitArr ‚É‘ã“ü
534                    var splitArr = new Array();
535                    // dayAmonthAweekAxDay‚Ȃǂ̃L[ƒ[ƒh‚²‚Æ‚É;‚Å‹æØ‚Á‚½”z—ñ‚ðì‚é
536                    splitArr = dayClass[ this.calObj[calId].priority[ci] ].split(';');
537                    // splitArr‚ðtdClassArr‚É‘ã“ü
538                    tdClassArr.push(splitArr[0]);
539                    // tdClassNames[Ý’è‚Æƒ}ƒbƒ`‚µ‚½class] = true;
540                    tdClassNames[splitArr[0]] = true;
541                }
542            }
543            if( dayCnt > ( this.calObj.days[month] + bisDay ) )
544                    tdClassArr.push('cal_nextMonthDay cal_adjoin');
545
546            if(tdClassArr.length > 0){
547                var deleteClose = false;
548                var tc = tdClassArr.join(' ').split(' ');
549                // d•¡class‚ðíœ
550                tc = this.unique(tc);
551
552                for( var i=0; i<tc.length; i++ ){
553                    if( tc[i].indexOf('cal_noClose') != -1 ) // cal_noClose‚ª‚ ‚Á‚½‚ç
554                        deleteClose = true;
555                }
556                for( var i=0; i<tc.length; i++ ){
557                    if( deleteClose ){
558                        if( tc[i].indexOf("close") == -1) // close‚Æ‚¢‚¤class–¼‚Ì•t‚­‚à‚Ì‚ðœŠOi”z—ñ‚ɒljÁ‚µ‚È‚¢j
559                            tdClassPre.push( tc[i] );
560                    } else{
561                        tdClassPre.push( tc[i] ); // noClose‚ª‚È‚¯‚ê‚Îtc‚ð‚»‚Ì‚Ü‚ÜtdClassPre‚ɒljÁ
562                    }
563                }
564                tdClassStr = " class='" + tdClassPre.join(' ') + "'";  // dayClass‚𔼊pƒXƒy[ƒX‹æØ‚è‚Å class="" ‚Ì’†‚É“ü‚éŒ`‚Å tdClassStr‚É‘ã“ü
565            }
566
567            /* “ú•t‚Ìtd‚Éclass‚Ì•t‚¢‚½div‚ðì¬ */
568            // td’¼‰º‚Édiv‚ðì¬‚µ‚ÄdayClass‚ð‚‚¯‚ăeƒLƒXƒg‚ÅŠe“ú•t‚ð“ü—Í
569            calHTML += "<td id='"+tdId+"_td'><div"+tdClassStr+">" + insertDay + "</div></td>";
570
571
572            /* T’PˆÊ‚̉üs”»’f */
573            // “y—j“ú‚¾‚Á‚½‚ç</tr>
574            if ( week == 6 )
575            {
576                calHTML += "</tr>";
577                currentCalWeekLine++;
578                if ( insertDay < this.calObj.days[month] )
579                {   // “y—j“ú‚ŁA‚Ü‚¾ŒŽ––“ú‚ɂȂÁ‚Ä‚¢‚È‚©‚Á‚½‚炳‚ç‚É<tr>A—j“ú‚ð“ú—j‚É‚·‚é
580                    calHTML += "<tr>";
581                }
582                week = 0;
583            }else
584            {   // “y—jˆÈŠO‚È‚ç—j“ú‚ði‚߂čŏ‰‚É–ß‚é
585                week++;
586            }
587        }
588        /* ŒŽ––“ú‚̐”‚܂œú•t <td> ¶¬@ŒJ‚è•Ô‚µˆ—I—¹ */
589        ///////////////////////////////////////////////////////
590        /* ŒŽ––“ú‚ð‰ß‚¬‚Ä“y—j“ú‚܂ł̋ó”’td */
591        while(week <= 6 && week != 0){
592            calHTML += "<td><div class='cal_blank cal_end_blank'>&nbsp;</div></td>";
593            if(week == 6){
594                calHTML += "</tr>";
595                currentCalWeekLine++;
596            }
597            week++;
598        }
599        //@“ú•t‚̍s”ŒÅ’è‚̏ꍇ‚̏ˆ—
600        if ( this.calWeekLine && !this.calShowNextMonth )
601            while ( currentCalWeekLine <= this.calObj.calWeekLine && currentCalWeekLine != 0 )
602            {   var week = 0;
603                while ( week <= 6 )
604                {   calHTML += "<td><div class='cal_blank cal_end_blank'>&nbsp;</div></td>";
605                    if(week == 6){
606                        calHTML += "</tr>";
607                    }
608                    week++;
609                }
610                currentCalWeekLine++;
611            }
612        calHTML += "</table>";
613        d.getElementById(this.targetClass+calId).innerHTML = calHTML;
614    }
615
616    this.cal_clone = function( obj ){
617        var dest;
618        if ( typeof obj == 'object' )
619            if ( obj instanceof Array )
620            {
621                dest   = [];
622                for ( i=0; i<obj.length; i++ )
623                    dest[ i ] = this.cal_clone( obj[i] );
624            }else
625            {
626                dest   = {};
627                for ( prop in obj )
628                    dest[ prop ] = this.cal_clone( obj[ prop ] );
629            }
630        else
631            dest = obj;
632        return dest;
633    }
634
635    /*
636      1. ƒJƒŒƒ“ƒ_[‚ЂƂ‚¸‚‚ð cal_check‚É’Ê‚·
637      2. true or false@‚ª•Ô‚Á‚Ä‚­‚é
638      3. ‚ЂƂ‚łà false@‚ª•Ô‚Á‚Ä‚«‚½‚ç chk(ƒJƒŒƒ“ƒ_[‘S‘̂̋““®‚ɑ΂·‚éƒtƒ‰ƒO)‚ðfalse‚ɐݒ肷‚é
639      4. chk‚ªtrue‚È‚ç cal_move ‚ÍŽÀsB chk‚ªfalse‚È‚ç cal_move ‚ÍŽÀs‚µ‚È‚¢
640     */
641    this.cal_check = function( calId, m )
642    {
643        var day   = this.calObj[ calId ].currentMonth.getDate();
644        var month = this.calObj[ calId ].currentMonth.getMonth() + 1;
645        var year  = this.calObj[ calId ].currentMonth.getFullYear();
646        // «@Å¬”N@or@Å‘å”N@ˆÈŠO‚̃JƒŒƒ“ƒ_[‚Í true‚Å cal_check‚𔲂¯‚é
647        if ( this.minY != year && year != this.maxY )
648            return true;
649        else if ( this.minY == year && this.maxY == year ){
650            if ( ( month + m ) < this.minM )
651               return false;
652            else if ( ( month + m ) > this.maxM )
653                return false;
654        }
655        else{
656            if ( this.minY == year ){
657                if ( ( month + m ) < this.minM )
658                    return false;
659            }
660            else if ( ( this.maxY == year ) ){
661                if ( ( month + m ) > this.maxM )
662                    return false;
663            }
664        }
665        return true;
666    }
667
668    this.cal_move = function( calId, m )
669    {
670        var day   = this.calObj[calId].currentMonth.getDate();
671        var month = this.calObj[calId].currentMonth.getMonth() + 1;
672        var year  = this.calObj[calId].currentMonth.getFullYear();
673        if ( 0 < month + m && month + m < 13 )
674            this.calObj[calId].currentMonth = new Date( year+"/"+( month + m )+"/"+"1 00:00:00");
675        else if( ( month + m ) < 1 ){// ”N‚ªŒ¸‚éi1ŒŽ‚Åprevƒ{ƒ^ƒ“‚ªƒNƒŠƒbƒN‚³‚ꂽj‚Æ‚«
676            if ( year > this.minY )
677            {
678                year--;
679                month = 12;
680                this.calObj[calId].currentMonth = new Date( year + "/" + ( month ) + "/" + "1 00:00:00" );
681            }
682        }
683        else{// ”N‚ªi12ŒŽ‚Ånextƒ{ƒ^ƒ“‚ªƒNƒŠƒbƒN‚³‚ꂽj‘‚¦‚邯‚«
684            if( year <= ( this.maxY - 1) ){
685                year++;
686                month = 1;
687                this.calObj[calId].currentMonth = new Date(year+"/"+(month)+"/"+"1 00:00:00");
688            }
689        }
690        this.cal_create(calId);
691    }
692
693    // cal_moveˆêЇŽw’è—pwrap function
694    this.cal_prev = function()
695    {
696        start = 0;
697        chk   = true;
698        for ( i=start; i<this.calLength; i++ ){
699            if ( ! this.cal_check( i, -1 ) )           // ƒJƒŒƒ“ƒ_[‘S‘Ì‚ÅminYearˆÈ‘O‚É“®‚¢‚Ä‚µ‚Ü‚¤‚à‚Ì‚ª‚È‚¢‚©ƒ`ƒFƒbƒN‚·‚邽‚ß cal_check ‚ð’Ê‚·
700                chk = false;                           // cal_check ‚̕Ԃè’l‚ªtrue‚ł͂Ȃ©‚Á‚½‚çprevƒ{ƒ^ƒ“‚ɑ΂·‚éƒtƒ‰ƒO chk@‚Éfalse‚ð•Ô‚·
701        }
702        if ( chk )                                     // chk‚ª@truei‘S‚ẴJƒŒƒ“ƒ_[‚ªfalseðŒ‚É“–‚Ă͂܂ç‚È‚¢ê‡j‚Ì‚Ý
703            for ( i=start; i<this.calLength; i++ )     // ŠeƒJƒŒƒ“ƒ_[‚Écal_move‚ðŽÀs
704                this.cal_move(i, -1);
705    }
706
707    this.cal_next = function()
708    {
709        start = 0;
710        chk = true;
711        for ( i=start; i<this.calLength; i++ ){        //@ƒJƒŒƒ“ƒ_[‘S‘Ì‚ÅmaxYearˆÈ~‚É“®‚¢‚Ä‚µ‚Ü‚¤‚à‚Ì‚ª‚È‚¢‚©ƒ`ƒFƒbƒN‚·‚邽‚ß cal_check ‚ð’Ê‚·
712            if ( ! this.cal_check( i, 1 ) )            // cal_check ‚̕Ԃè’l‚ªtrue‚ł͂Ȃ©‚Á‚½‚ç
713                chk = false;                           // nextƒ{ƒ^ƒ“‚ɑ΂·‚éƒtƒ‰ƒO chk@‚Éfalse‚ð•Ô‚·
714        }
715        if ( chk )                                     // chk‚ª@truei‘S‚ẴJƒŒƒ“ƒ_[‚ªfalseðŒ‚É“–‚Ă͂܂ç‚È‚¢ê‡j‚̂݁A
716            for ( i=start; i<this.calLength; i++ )     // ŠeƒJƒŒƒ“ƒ_[‚Écal_move‚ðŽÀs
717                this.cal_move(i,1);
718    }
719}
720
721// ”̎Жˆ‚̏î•ñ‚ƍ‘–¯‹x“ú’è‹`ƒtƒ@ƒCƒ‹‚̏î•ñ‚ðƒ}[ƒW‚·‚é‚Ü‚Å‚Ìì‹Æ‚ðƒ‰ƒbƒsƒ“ƒO‚µ‚½‚à‚Ì
722function cal_preload()
723{   if( typeof ____daysClass == 'object' && ! ( ____instance instanceof jsCalendar ) )
724    {   ____instance = new jsCalendar();
725        ____instance.preload();
726        ____instance.init();
727        ____instance.cal_init();
728    }else if ( typeof ____instance != 'undefined' )
729    {   ____instance.init();
730        ____instance.cal_init();
731    }
732}
733
734////////////////////////////////////////////////////////////////////////////////
735var ____instance;
736var ____script;
737
738// Wrapper Section
739// jsCalendar().cal_prev()
740function cal_prev(){
741    ____instance.cal_prev();
742}
743
744// jsCalendar().cal_next()
745function cal_next(){
746    ____instance.cal_next();
747}
748function cal_init(fn)
749{   if( typeof ____script == 'undefined' )
750    {   ____script   = document.createElement('script');
751        ____script.setAttribute('type', 'text/javascript');
752        ____script.setAttribute('src', '/common-js/mut.calendar.list.js?'+(new Date()).getTime());
753//        document.getElementsByTagName('head')[0].appendChild( ____script );
754        document.body.appendChild( ____script );
755        ____script.onreadystatechange = function()
756        {   // IE6‘Ήž
757            cal_preload();
758            if( fn ){
759                try{
760                    fn();
761                } catch(e){}
762            } else{}
763        }
764        ____script.onload = function()
765        {
766            cal_preload();
767            if( fn ){
768                try{
769                    fn();
770                } catch(e){}
771            } else{}
772        }
773    }else
774       cal_preload();
775}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.