PageSourceSearch

https://katayama-kikai.jp/js/public/ua_log.js?1556098076

js katayama-kikai.jp collected 2026-09-24 13:03:52 UTC 39,616 bytes, 958 lines download raw bytes

1!function ($) {
2	$(function () {
3
4        
5
6        var created = '';
7        var dlFlg = false;
8
9        //analisys.jsよりまるっとコピー
10        var $window      = $(window),
11            width        = $window.width(),
12            height       = $window.height(),
13            $centerArea  = $('#middle-area > div.center-area');
14
15        var $params      = $('#params');
16        var siteType     = ($params.data('device') == 'smart')? 'SP' : 'PC';
17        var $sectionType = $('section.section .block-area');
18
19        var $bg          = $('#bg');
20        var page_id      = $bg.data('page-id');
21        var $section     = $bg.find('section.section');
22
23        var moviePlayFlg = false;
24        var moveAutoPauseFlg = false;
25
26        var YTPlayFlg = false;
27        var YTAutoPauseFlg = false;
28
29        //$.cookie.json = true;
30        //$.cookie.raw = true;
31
32        var $cookie = $.cookie('__ds_uuid');
33
34        //二重送信防止
35        var sendFlg = false;
36
37        var uniquePageId = public_uuid + $.now();
38        var ua  = window.navigator.userAgent;
39        var winSize = width + ',' + height;
40        var scroll_y         = $window.scrollTop();
41        var scroll_x         = $window.scrollLeft();
42
43        var another_tab_flg = false;
44
45        //二重クリック防止
46        //var clickFlg = false;
47
48
49
50        public_uuid = $cookie;
51
52        //var UserActionObject = {};
53
54        $(document).ready(function(){
55
56            //get_uuid.tplに移植
57            // if($cookie == undefined){
58            //     $.ajax({
59            //         type: 'GET',
60            //         url : 'https://9e2xkh9f1e.execute-api.ap-northeast-1.amazonaws.com/v1/getUniqueUserId',
61            //         crossDomain:true,
62            //         xhrFields: {
63            //             withCredentials: true
64            //         },
65            //         success: function(data) {
66            //             var uuid = JSON.stringify(data['body']['uuid']);
67            //             var rep_uuid = uuid.replace(/\"/g,'');
68
69            //             $.cookie("__ds_uuid",rep_uuid,{
70            //                 expires:730,
71            //                 //path: '/',
72            //                 path : BaseUrl
73            //             });
74
75            //             $cookie = $.cookie('__ds_uuid');
76            //             public_uuid = $cookie;
77            //         },
78            //         error:function(data){
79            //             //console.log('er');
80            //             //console.log(data);
81            //         }
82            //     });
83            // }
84
85            $.getUa();
86        });
87
88        //クリックログ取得
89        //$(document).on('click tap',function(e){
90        //IE,firefoxでバブリングがうまく行かず、要素に対するクリックイベントが発火しないため、要素自体にイベントつける
91        //divに関してはfirstEventAddで
92        // $('a,button,input').on('click',function(e){
93        //     //
94        //     //onclick属性がついている場合は、すでにイベントを割り込ませてあるので(firstEventAdd)クリックイベントでは発動させない
95        //     if($(this).attr('onclick') == undefined){
96        //         $.getClick(e);
97        //     }
98        // });
99        //動的に追加したものにイベントがつけられない場合があるため
100        $(document).on('click tap','a,button,input', function(e) {
101        //onclick属性がついている場合は、すでにイベントを割り込ませてあるので(firstEventAdd)クリックイベントでは発動させない
102            if($(this).attr('onclick') == undefined){
103                $.getClick(e);
104            }
105        });
106
107        $("video").on({
108            "play":function(e){
109
110                var $_this = $(this);
111
112                var id1   = $_this.parents('.block').data('block-id');
113                var id2   = $_this.parents('.record').data('record-id');
114
115                var attrs = $(this).get(0).attributes;
116                var attrsStr = '<video '; 
117
118                for (var i = 0; i < attrs.length; i++) {
119                    attrsStr += attrs[i]['name'];
120                    if(attrs[i]['value'] != ''){
121                        attrsStr += "='" + attrs[i]['value'] + "'";
122                    }
123                    attrsStr += " ";
124                }
125
126                attrsStr += '>';
127
128                if($(this).attr('autoplay') == undefined || moviePlayFlg){
129                    var data = {
130                        'event'   :'play',
131                        'page_id' :page_id,
132                        'id1'     :id1,
133                        'id2'     :id2,
134                        'element' :attrsStr,
135                    };
136                    $.insertUAObj('video',data);
137                }
138                moviePlayFlg = true;
139            },
140            "ended":function(e){
141                moveAutoPauseFlg = true;
142            },
143            "pause":function(e){
144
145                var $_this = $(this);
146
147                var id1   = $_this.parents('.block').data('block-id');
148                var id2   = $_this.parents('.record').data('record-id');
149
150                var attrs = $(this).get(0).attributes;
151                var attrsStr = '<video '; 
152
153                for (var i = 0; i < attrs.length; i++) {
154                    attrsStr += attrs[i]['name'];
155                    if(attrs[i]['value'] != ''){
156                        attrsStr += "='" + attrs[i]['value'] + "'";
157                    }
158                    attrsStr += " ";
159                }
160
161                attrsStr += '>';
162
163                setTimeout(function(){
164                    var media_id = 0;
165                    if(!moveAutoPauseFlg){
166                        var data = {
167                            'event'   :'pause',
168                            'page_id' :page_id,
169                            'id1'     :id1,
170                            'id2'     :id2,
171                            'element' :attrsStr,
172                        };
173
174                        $.insertUAObj('video',data);
175                    }
176                    moveAutoPauseFlg = false;
177                }, 100);
178            },
179        });
180
181       
182        $('form').on('submit',function(e){
183            var $_thisForm = $(this);
184            //非公開ユーザーログイン
185            if($_thisForm.attr('id') == 'CloseUserIndexForm'){
186                
187                var data = {'close_user_name':$('#inp-username').val()};
188                $.insertUAObj('close_user_login',data);
189            //検索ログ取得
190            }else if($_thisForm.attr('id') == 'searchIndexForm'){
191                var data = {'search_cond':$('#inp-search_word').val()};
192                $.insertUAObj('search',data);
193            //不動産(地図含む)、自動車検索
194            }else if($_thisForm.hasClass('automobile-form') || $_thisForm.hasClass('estate-form') || $_thisForm.hasClass('gmap-box')){
195
196                var search_serialize = $_thisForm.serializeArray();
197                var search_cond = {};
198
199                for(var item in search_serialize){
200
201                    var name = search_serialize[item]['name'];
202                    var val  = search_serialize[item]['value'];
203
204                    search_cond[name] = val;
205                }
206
207                var id1   = $_thisForm.parents('.block').data('block-id');
208                var id2   = $_thisForm.parents('.record').data('record-id');
209
210                var data = {
211                    'page_id' :page_id,
212                    'id1'     :id1,
213                    'id2'     :id2,
214                    'search_cond':search_cond
215                };
216                $.insertUAObj('record_search',data);
217            //お問い合わせ(入力フォーム)
218            }else if($_thisForm.hasClass('type019-form')){
219                var fid = $('#FID').val();
220                var contact_serialize = $_thisForm.serializeArray();
221                var contact_form = {};
222                var item_list = {};
223
224                for(var item in contact_serialize){
225
226                    var name = contact_serialize[item]['name'];
227                    var val  = contact_serialize[item]['value'];
228                    //項目:値
229                    var item_name = $("[name='"+name+"']").closest('.form-item-box').find('.cell1').text();
230                    if(item_name != ''){
231                        item_name = item_name.replace(' ※必須','');
232                        item_list[item_name] = val;
233                    }
234
235                    contact_form[name] = val;
236                }
237
238                var data = {
239                    'page_id'    :page_id,
240                    'id1'        :id1,
241                    'id2'         :id2,
242                    'step'        :'confirm',
243                    'fid'         :fid,
244                    'item_list'   :item_list, 
245                    'contact_form':contact_form
246                };
247                $.insertUAObj('contact',data);
248            }
249
250            //二重送信防止
251            if(!sendFlg){
252                e.preventDefault();
253                $.sendDataCheck($_thisForm);
254            }
255
256        });
257
258        //ページを離れるときにsubmit
259        $window.on('beforeunload pagehide unload',function(){
260            $.sendDataCheck();
261        });
262
263        // $('.media-load-iframe').on('load',function(){
264        //     //console.log('load');
265        //     //console.log($(this));
266        //     $(this).contents().find("body").on("click", function(e){
267        //         //console.log('body');
268        //     });
269        // });
270
271        $.extend({
272            getClick:function(e,flg){
273
274                //発火元取得
275                if(flg){
276                    var $_this = e;
277                }else{
278                    var $current = $(e.currentTarget);
279                    if($current.context !== undefined && $current.context.activeElement !== undefined){
280                        var $_this = $($current.context.activeElement);
281                    }else{
282                        var $_this = $current;
283                    }
284
285                }
286
287                var pageId     = $params.data('page-id');
288                if ($sectionType.length) {
289                    pageId = $bg.data('page-id');
290                }else if($('#GlForm').length){
291                    pageId = $('body').data('page-id');
292                }
293                var contents   = 'common';
294                var id1        = 0;
295                var id2        = 0;
296                var position   = $.getPosition(e);
297
298                if($_this.attr('href') !== undefined){
299                    var myHref     = $_this.attr('href');
300                }else{
301                    var myHref     = '';
302                }
303
304                //タグ
305                var tagName  = $_this.prop("tagName").toLowerCase(); 
306
307                //bodyの中で何番目の要素か(index0から始まる)
308                var index = $('body ' + tagName).index($_this);
309
310                //bodyのクリックイベントなどは通さない
311                if(index >= 0){
312                    //eqも0から始まる
313                    var selector = 'body '+tagName +':eq(' +index+ ')';
314
315                    //atributesの取得
316                    var attrs = $(selector).get(0).attributes;
317                    var attrsStr = '<'+tagName+' '; 
318
319                    for (var i = 0; i < attrs.length; i++) {
320                        //attrsStr[attrs[i]['name']] = attrs[i]['value'];
321                        attrsStr += attrs[i]['name'] + "='" + attrs[i]['value'] + "' ";
322                    }
323
324                    attrsStr += '>';
325
326                    //レコード
327                    if($_this.parents('.record').length){
328
329                        contents = 'record';
330
331                        id1    = $_this.parents('.block').data('block-id');
332                        id2   = $_this.parents('.record').data('record-id');
333
334                        //ファイルダウンロード
335                        if(myHref !== undefined && myHref.match(/\?file\=/)){
336                            //ファイルダウンロードでbeforeunloadが走るので処理を通さないように
337                            dlFlg = true;
338
339                            setTimeout(function() {
340                                dlFlg   = false;
341                                sendFlg = false;
342                            },1000);
343                        }
344                    //パーツ
345                    }else if($_this.parents('.parts').length){
346
347                        var $parts = $_this.parents('.parts');
348
349                        contents = 'parts';
350
351                        if($parts.attr('data-parts-id') !== undefined){
352                            id1   = $parts.data('parts-id');
353                            //selector  += ".parts[data-parts-id='"+id1+"'] ";
354                        //SPヘッダーフッター
355                        }else if($parts.attr('id') !== undefined){
356                            id1   = $parts.data('id');
357                            //selector  += "#" + $parts.attr('id') + "[data-id='"+id1+"'] ";
358
359                        }
360
361                        //レコードがある場合(リンクや地図)
362                        if($_this.parents('.parts-record').length){
363                            id2        = $_this.parents('.parts-record').data('record-id');
364                            //selector   += ".parts-record[data-record-id='"+id2+"']";
365                        }
366                    }
367
368                    data = { 
369                        'contents':contents,
370                        'element' :attrsStr,
371                        'x'       :position['x'],
372                        'y'       :position['y'],
373                        'page_id'  :pageId,
374                        'id1'     :id1,
375                        'id2'     :id2,
376                        'selector':selector,
377                    };
378
379                    var notClickFlg = false;
380
381                    //console.log($_this.attr('onclick').length);
382                    //お問い合わせ(確認フォーム)
383                    if($_this.attr('onclick') !== undefined){
384
385                        
386                        
387                        if( $_this.attr('onclick').match(/type019\_forms/)){
388                            notClickFlg = true;
389
390                            var fid = $_this.attr('onclick').match(/fid\=([a-z0-9]{32})\//);
391                            if($_this.attr('onclick').match(/step\=form/)){
392                                var data = {
393                                    'page_id'    :page_id,
394                                    'id1'        :id1,
395                                    'id2'        :id2,
396                                    'step'       :'return',
397                                    'fid'        :fid[1]
398                                };
399                            }else if($_this.attr('onclick').match(/step\=confirm/)){
400                                var data = {
401                                    'page_id'    :page_id,
402                                    'id1'        :id1,
403                                    'id2'        :id2,
404                                    'step'       :'complete',
405                                    'fid'        :fid[1]
406                                };
407                            }
408                            $.insertUAObj('contact',data);
409                        // $.sendDataCheck($_this);
410                        }
411                    }
412
413                    //非公開ユーザーログアウト
414                    if($_this.hasClass('logout')){
415                        notClickFlg = true;
416                        var data = {'close_user_name':closeUserName};
417                        $.insertUAObj('close_user_logout',data);
418                    }
419
420                    if(!notClickFlg){
421                        $.insertUAObj('click',data);
422                        //外部リンクたたかれたときの対応
423                        if(myHref != '' && tagName == 'a' && $_this.attr('target') != undefined && $_this.attr('target') == '_blank'){
424                            another_tab_flg = true;
425                            $.sendDataCheck($_this);
426                        }
427                    }
428                }
429            },
430            //onclick属性発動の前にクリックイベントをつけたいため
431            firstEventAdd:function() {
432
433                //無駄にイベントをつけないよう、イベントがついているdivだけにクリックイベントをつける
434                $('div').each(function(index){
435                    var events = $._data($(this).get(0), "events");
436                    if(events !== undefined){
437                        if(events.click !== undefined){
438                            if($(this).attr('id') == undefined || ($(this).attr('id') !== undefined && $(this).attr('id') != 'bg')){
439                                $(this).on('click tap',function(e){
440                                    $.getClick(e);
441                                });
442                            }
443                        }
444                    }
445
446                });
447
448                //onclick発動前に、クリックデータを取得するために、クリックデータ取得処理を割り込ませる
449                $('a[onClick],button[onClick]').each(function(){
450                    var $target = $(this);
451                    var onclick = $target.attr('onclick');
452                    var addOnclick = '$.getClick($(this),true); ' + onclick; 
453                    $target.attr('onclick',addOnclick);
454                });
455            },
456            sendDataCheck:function($elem){
457                //二重送信防止
458                if(!sendFlg){
459
460                    sendFlg = true;
461
462                    if(dlFlg === false){
463
464                        if(Object.keys(UserActionObject).length){
465                            $.sendData($elem);
466                        }
467
468                    }
469                } 
470            },
471            getDate: function() {
472                var date2 = new Date();
473                var YY2 = date2.getFullYear();
474                var MM2 = ('0' + (date2.getMonth() + 1)).slice(-2);
475                var DD2 = ('0' + date2.getDate()).slice(-2);
476                var H2 = ('0' + (date2.getHours())).slice(-2);
477                var i2 = ('0' + (date2.getMinutes())).slice(-2);
478                var s2 = ('0' + (date2.getSeconds())).slice(-2);
479
480                return YY2 +'/'+ MM2+'/'+ DD2 + ' ' + H2 + ':' + i2 + ':' + s2;
481            },
482            insertUAObj:function(type,data){
483
484                var time = $.getDate();
485
486                var key = Object.keys(UserActionObject).length;
487
488                data['type']    = type;
489                data['created'] = time;
490
491                //既存処理でクリックイベントが2回走るところがあったã
491®ã§ã€åŒæ™‚刻(秒)に同じタイプの処理がはいれば、2回目以降はとらない
492                var noInsert = false;
493                //divとaがかぶるなどして、イベントが同時に走ることがあるので、一旦すべてのログを取得します
494                // if(type == 'click'){
495                //     for (var i = 0; i < key; i++) {
496                //         if(UserActionObject[i]['type'] == type && UserActionObject[i]['created'] == time){
497                //             noInsert = true;
498                //         }
499                //     }
500                // }
501                
502                if(!noInsert){
503                    UserActionObject[key] = data;
504                }
505        
506                
507            },
508            sendData:function($elem){
509
510                modified = $.getDate();
511
512                var sendObj = {};
513                var url     = location.href;
514
515                if(typeof public_uuid == 'undefined'){
516                    var uuid = "";
517                }else{
518                    var uuid = public_uuid;
519                }
520
521                var cookie_name = "ds";
522                var host = $(location).attr('host');
523                var system_dir = BaseUrl.replace(host,'');
524                if(system_dir != "/"){
525                    cookie_name += '_' + system_dir.replace(/\//g,'');
526                }
527                cookie_name += '_access[0]';
528
529                
530                if(typeof $.cookie(cookie_name) == 'undefined'){
531                    var session_key = "";
532                }else{
533                    var session_key = $.cookie(cookie_name);
534                }
535
536                sendObj['queryParameters'] = {
537                        serialno   :Serial,
538                        uuid       :uuid,
539                        url        : url,
540                        data       :JSON.stringify(UserActionObject),
541                        session_key:session_key,
542                        created    :created,
543                        modified   :modified,
544                        ip         :remoteIp
545                }
546
547                $.ajax({
548                    type	: "POST",
549                    cache	: false,
550                    data	: JSON.stringify(sendObj),
551                    async	: false,
552                    url     : 'https://9e2xkh9f1e.execute-api.ap-northeast-1.amazonaws.com/v1/putActionData',
553                    contentType:'application/json',
554                    dataType:'json',
555                    success	: function(data) {
556                        if(typeof data.statusCode == 'undefined'){
557                            $.ajaxError(sendObj,data);
558                        }
559
560                    },error : function(data){
561                        $.ajaxError(sendObj,data);
562                    },complete:function(data){
563                        //console.log('complete');
564                        if($elem && $elem.length){
565                            //タグ
566                            var tagName  = $elem.prop("tagName").toLowerCase(); 
567                            if(tagName == 'form'){
568                                $elem.submit();
569                            }
570                        }
571                    }
572                });
573                
574                UserActionObject = {};
575
576                //別タブで開いた時の対応
577                if(another_tab_flg == true){
578                    $.getUa();
579                    another_tab_flg = false;
580                    sendFlg = false;
581                }
582
583            },
584            ajaxError:function(sendObj,data){
585
586                var errObj = {};
587
588                errObj['sendObj'] = sendObj;
589                errObj['res']     = data;
590
591                $.ajax({
592                    type:'POST',
593                    cache	: false,
594                    data	: errObj,
595                    async	: false,
596                    url     : BaseUrl+"publics/ua_log_error",
597                    //dataType:'json',
598                    success	: function(data) {
599                        
600                    },error : function(data){
601                        
602                    }
603                })
604
605
606            },
607            getPosition:function(e){
608                //analysis.jsよりまるっとコピー
609
610                //#4766 window 識別
611                if(!window.name){
612                    var rum = Math.ceil(Math.random() * 100);
613                    var now = Date.now() /1000;
614                    var win_name = Math.ceil(now * rum);
615                    window.name = win_name;
616                }
617
618                //#2297 シングルページ 対応
619                if ($sectionType.length) {
620                    $params  = $bg;
621                    siteType = ($params.data('device') == 'smart')? 'SP' : 'PC';
622                }
623
624                var offset = 0,
625                    x, y, pageID, data;
626
627                //#2297 シングルページ 対応
628                var sp_flg      = false;
629                var sp_full_flg = false;
630                var scroll      = 0;
631
632
633                if ($sectionType.length) {
634                    var centerW  = $sectionType.eq(0).width();
635                    var sectionh = $section.eq(0).height();
636                    var centerh  = $sectionType.eq(0).height();
637                    scroll       = $window.scrollTop();
638                    width        = $bg.width();
639                    sp_flg       = true;
640                    pos2_header  = 0;
641                    pos2_footer  = 0;
642                    pos2_other	 = 0;
643
644                    page_bottom =0;
645
646                    if ($bg.data('sp-type') == 1 && siteType == 'PC') {
647
648                        //フッター、固定バナー、固定メニューの場合は高さ微調整(固定のときキャプチャー位置は下に)
649                        var st_index = ($('section.section').filter('.active').length)? $('section.section').index($('section.section').filter('.active')) : 0;
650
651                        scroll = sectionh * st_index;
652                        
653                        //フッター、固定バナー、固定メニュー対応用
654                        page_bottom = sectionh * parseInt($('section.section').length);
655                        if($('#bg').find("#header").length && !$('#bg').find("#header.pos2").length){
656                            page_bottom += parseInt($('#bg').find("#header").height());
657                        }
658                        
659                    }else{
660                        //パララックス以外は、最後のセクションの位置から計算
661                        var lt_index = $('section.section').length - 1;
662                        var $_lt_sction = $('section.section').eq(lt_index);
663                        
664                        page_bottom = parseInt($_lt_sction.position().top) + parseInt($_lt_sction.height());
665
666                        if($('#bg').find("#header").length && !$('#bg').find("#header.pos2").length){
667                            page_bottom += parseInt($('#bg').find("#header").height());
668                        }
669                    }
670
671                    //matu ヘッダー固定時対応
672                    if($(e.target).closest("#header").length && !($('#bg').find("#header.pos2").length && !$('#bg').find("#header").hasClass("normal-header"))){
673                        //pos2_header = $('#bg').find("#header.pos2").height();
674                    }
675
676                    pageID = $bg.data('page-id');
677                } else {
678                    var centerW = $centerArea.width();
679                }
680
681                //111.5
682                if (siteType == 'PC') {
683                    offset = (width - centerW) / 2;
684                }
685
686                // クリック位置の座標(コンテンツ領域のみで算出)
687                if (sp_flg) {
688                    if (siteType == 'PC') {
689                        offset = (width >= centerW && !($(e.target).closest("#header").length || $(e.target).closest("#footer").length || $(e.target).closest("#fixedbanner").length)) ? (width - centerW) / 2 : 0;
690                    }
691                    x = e.clientX - offset;
692                    y = e.clientY + scroll + pos2_header;
693
694
695                    //#2297 シングルページ 対応
696                    if ($bg.data('sp-type') == 1 && siteType == 'PC') {
697                        //パララックスタイプ
698                        //1020:573.75 = 16:9 (1020はキャプチャサイズ)
699                        y = (y - (((sectionh - centerh) / 2) * st_index)) + pos2_header;
700                        if($(e.target).closest("#header").length || $(e.target).closest("#footer").length || $(e.target).closest("#fixedbanner").length){
701                            x = Math.round(x * (1020 / width));
702                        }else{
703                            x = Math.round(x * (1020 / centerW));
704                        }
705                        y = Math.round(y * (573.75 / sectionh));
706                    }else if(!$bg.data('sp-type') && siteType == 'PC'){
707                        //シングルページ
708                        //ヘッダー、フッター、固定バナーは可変でうごくので調整
709                        if(($(e.target).closest("#header").length &&!$(e.target).closest("#header").hasClass("normal-header")) || $(e.target).closest("#footer").length || $(e.target).closest("#fixedbanner").length){
710                            //現在ヒートマップキャプチャーの1100なので
711                            //x = Math.round(x * (1100 / centerW));
712                            x = Math.round(x * (1100 / width));
713                        }
714                    }
715                    
716                    if($(e.target).closest("#header").length && (($('#bg').find("#header.pos2").length && !$('#bg').find("#header").hasClass("normal-header")) || $('#bg').find("#header.a-logo-fixed").length && siteType != 'PC')){
717                        //y = e.clientY - parseInt($(e.target).closest("#header.pos2").position().top);
718                        y = e.clientY;
719                    }
720
721                    //フッター、固定バナー、固定メニューの場合は高さ微調整(固定のときキャプチャー位置は下に)
722                    if($(e.target).closest("#footer.pos2").length){
723                    // || $(e.target).closest("#fixedbanner.pos2").length) {
724                        pos2_footer = $(e.target).closest("#footer.pos2").height();
725                        y = page_bottom - pos2_footer + (e.clientY - parseInt($(e.target).closest("#footer.pos2").position().top));
726                    }
727
728                    if($(e.target).closest("#fixedbanner.pos2").length) {
729                        //フッターの下にくるので
730                        if($('#bg').find("#footer").length && !$('#bg').find("#footer").hasClass("pos2")){
731                            page_bottom += $('#bg').find("#footer").height();
732                        }
733                        y = page_bottom + (e.clientY - parseInt($(e.target).closest("#fixedbanner.pos2").position().top));
734
735                    }
736                    
737                } else {
738                    x = e.clientX - offset;
739                    y = e.clientY + $window.scrollTop();
740                }
741
742                return {'x':x,'y':y};
743
744            },
745            getScroll:function(){
746                //analysis.jsよりまるっとコピー
747
748                var scrolltimer      = false;
749                var visittimer       = false;
750                var scPageID         = $params.data('page-id');
751                var sc_data          = {};
752                var scroll_y         = $window.scrollTop();
753                var scroll_x         = $window.scrollLeft();
754                
755                // 
756                visittimer = setInterval(function() {
757                    // 送信データ
758                    sc_data = {
759                        x			: scroll_x,
760                        y			: scroll_y,
761                        page_id		: scPageID,
762                        site_type	: siteType,
763                        url			: location.href,
764                        'window'	: width + ',' + height,
765                        'height'	: height,
766                        'width'		: width,
767                        'page_size'	: $('#bg').width() + ',' + $('#bg').height(),
768                    };
769
770                    // 終了時にタイマーを切る
771                    clearTimeout(visittimer);
772                }, 2);
773                
774                // スクロール
775                $(window).scroll(function() {
776                    if (visittimer !== false) {
777                        clearTimeout(visittimer);
778                    }
779                    if (scrolltimer !== false) {
780                        clearTimeout(scrolltimer);
781                    }
782                    
783                    scrolltimer = setTimeout(function() {
784                        scroll_y = $window.scrollTop();
785                        scroll_x = $window.scrollLeft();
786                        
787                        // 送信データ
788                        sc_data = {
789                            x			: scroll_x,
790                            y			: scroll_y,
791                            page_id		: scPageID,
792                            site_type	: siteType,
793                      //      url			: location.href,
794                            'window'	: width + ',' + height,
795                            'height'	: height,
796                            'width'		: width,
797                            'page_size'	: $('#bg').width() + ',' + $('#bg').height(),
798                        };
799
800                        $.insertUAObj('scroll',sc_data);
801                        
802                    }, 2000);
803                });
804
805            }
806            ,getResize:function(){
807
808                //analysis.jsよりまるっとコピー
809
810                var resizetimer      = false;
811                var visittimer       = false;
812                var scPageID         = $params.data('page-id');
813                var re_data          = {};
814                var width            = $window.width();
815                var height           = $window.height();
816                
817                // 
818                visittimer = setInterval(function() {
819                    // 送信データ
820                    sc_data = {
821                        page_id		: scPageID,
822                        site_type	: siteType,
823                     //   url			: location.href,
824                        'window'	: width + ',' + height,
825                        'height'	: height,
826                        'width'		: width,
827                        'page_size'	: $('#bg').width() + ',' + $('#bg').height(),
828                    };
829
830                    // 終了時にタイマーを切る
831                    clearTimeout(visittimer);
832                }, 2);
833                
834                // スクロール
835                $(window).resize(function() {
836                    if (visittimer !== false) {
837                        clearTimeout(visittimer);
838                    }
839                    if (resizetimer !== false) {
840                        clearTimeout(resizetimer);
841                    }
842                    
843                    resizetimer = setTimeout(function() {
844                    var width            = $window.width();
845                    var height           = $window.height();
846                        // 送信データ
847                        re_data = {
848                            page_id		: scPageID,
849                            site_type	: siteType,
850                           // url			: location.href,
851                            'window'	: width + ',' + height,
852                            'height'	: height,
853                            'width'		: width,
854                            'page_size'	: $('#bg').width() + ',' + $('#bg').height(),
855                        };
856
857                        $.insertUAObj('resize',re_data);
858                        
859                    }, 2000);
860                });
861            },getYTplayer:function(status,id){
862
863                var $_this = $('#'+id);
864                var src    = $_this.attr('src');
865
866                if($_this.length){
867                    if(status == 1){
868            
869                        var id1   = $_this.parents('.block').data('block-id');
870                        var id2   = $_this.parents('.record').data('record-id');
871            
872                        var attrs = $_this.get(0).attributes;
873                        var attrsStr = '<iframe '; 
874            
875                        for (var i = 0; i < attrs.length; i++) {
876                            attrsStr += attrs[i]['name'];
877                            if(attrs[i]['value'] != ''){
878                                attrsStr += "='" + attrs[i]['value'] + "'";
879                            }
880                            attrsStr += " ";
881                        }
882            
883                        attrsStr += '>';
884
885                        if(src.match(/autoplay\=0/) || YTPlayFlg){
886                            var data = {
887                                'event'   :'play',
888                                'page_id' :page_id,
889                                'id1'     :id1,
890                                'id2'     :id2,
891                                'element' :attrsStr,
892                            };
893                            $.insertUAObj('youtube',data);
894                        }
895                        YTPlayFlg = true;
896                    }else if(status == 3){
897                        YTAutoPauseFlg = true;
898                    }else if(status == 2){
899            
900                        var id1   = $_this.parents('.block').data('block-id');
901                        var id2   = $_this.parents('.record').data('record-id');
902            
903                        var attrs = $_this.get(0).attributes;
904                        var attrsStr = '<iframe '; 
905            
906                        for (var i = 0; i < attrs.length; i++) {
907                            attrsStr += attrs[i]['name'];
908                            if(attrs[i]['value'] != ''){
909                                attrsStr += "='" + attrs[i]['value'] + "'";
910                            }
911                            attrsStr += " ";
912                        }
913            
914                        attrsStr += '>';
915            
916                        setTimeout(function(){
917                            if(!YTAutoPauseFlg){
918                                var data = {
919                                    'event'   :'pause',
920                                    'page_id' :page_id,
921                                    'id1'     :id1,
922                                    'id2'     :id2,
923                                    'element' :attrsStr,
924                                };
925            
926                                $.insertUAObj('youtube',data);
927                            }
928                            YTAutoPauseFlg = false;
929                        }, 100);
930                    }
931
932                }
933            },getUa:function(){
934
935                created = $.getDate();
936
937                var data = {
938                    ua:ua,
939                    window:winSize,
940                    x:scroll_x,
941                    y:scroll_y,
942                    close_user_name:closeUserName,
943                    close_user_id:closeUserId,
944                    unique_page_id:uniquePageId
945                };
946
947                $.insertUAObj('user_agent',data);
948
949                $.getScroll();
950                $.getResize();
951
952                $.firstEventAdd();
953
954            }
955        });
956
957	});
958}($);

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.