var i = 0; var access_log_id = 0; var is_vtr_page = false; var is_cookie_enabled = false; var is_browser_close = 2; var clearSessionTimer = 0; var totalStayTimer = 0; var csMouseX = 0; var csMouseY = 0; var csScrollX = 0; var csScrollY = 0; var csClientX = 0; var csClientY = 0; var requestObj = new Array(); var cookieObj = new Array(); var mode; var windowX; var windowY; var clientX; var clientY; var colorDepth; var mouseX = 1; var mouseY = 1; var scrollX; var scrollY; var vtrLogTimer; var vtrLogNo; var vtrData = new Array(); var vtrDataCount = 0; var graphData = new Array(); init(); // --------------------------------------------------------------------------------- // 初期化 // --------------------------------------------------------------------------------- function init() { // リクエストの取得 requestObj = getRequest(); // クッキーの有効・無効を判定 is_cookie_enabled = isCookieEnabled(); // クッキーの取得 cookieObj = getCookie(); // モードの設定 mode = selectMode( requestObj['mode'] ); if ( mode == 'analyze' ) { // ブラウザ確認用Cookieがなかったら発行 if ( !cookieObj['cb_br'] ) { is_browser_close = 1; cookieObj['cb_br'] = setBrowserCookie(); } // ユーザ識別用Cookieがなかったら発行 if ( !cookieObj['cid'] ) { cookieObj['cid'] = setUserCookie(); } else { // ユーザ識別用Cookieの更新 updateUserCookie(); } // セッション識別用Cookieがなかったら発行 if ( !cookieObj['sid'] ) { cookieObj['sid'] = setSessionCookie(); } else { // セッション識別用Cookieの更新 updateSessionCookie(); } // クッキーが有効の場合ログを書き込み if ( is_cookie_enabled ) { // 通常ログの書き込み writeNormalLog(); } } else if ( mode == 'view' ) { // Viewモードの設定の初期化 initViewModeSetting(); } else if ( mode == 'graph' ) { // Graphモードの設定の初期化 initGraphModeSetting(); } } // -------------------------------------------------------------------------------- // モード判定関数 // -------------------------------------------------------------------------------- function selectMode( m ) { // viewモードの場合 if ( m == 'view' ) { return 'view'; // graphモードの場合 } else if ( m == 'graph' ) { return 'graph'; // analyzeモードの場合 } else { return 'analyze'; } } // -------------------------------------------------------------------------------- // リクエスト取得関数 // -------------------------------------------------------------------------------- function getRequest(){ if( location.search.length > 1 ) { var obj = new Object(); var ret = location.search.substr(1).split("&"); for(var i = 0; i < ret.length; i++) { var data = ret[i].split("="); obj[data[0]] = data[1]; } return obj; } else { return false; } } //////////////////////////////////////////////////////////////////////////////////// // Cookieの制御 - ここから - //////////////////////////////////////////////////////////////////////////////////// // -------------------------------------------------------------------------------- // クッキーの有効・無効の判定 // -------------------------------------------------------------------------------- function isCookieEnabled() { var cookieFlg = false; if ( navigator.cookieEnabled ){ cookieFlg = true; } else { cookieFlg = false; } return cookieFlg; } // -------------------------------------------------------------------------------- // クッキーの取得 // -------------------------------------------------------------------------------- function getCookie() { var data = new Array(); if (document.cookie) { var cookies = document.cookie.split("; "); for (var i = 0; i < cookies.length; i++) { var str = cookies[i].split("="); data[str[0]] = unescape(str[1]); } } else { return false; } return data; } // -------------------------------------------------------------------------------- // クッキーを保存 // -------------------------------------------------------------------------------- function setCookie( name, value, day ) { expires = new Date(); expires.setTime( expires.getTime() + day*24*60*60*1000 ); if( day == 0 ) { document.cookie = name + "=" + value + "; path=/;"; } else { document.cookie = name + "=" + value + "; path=/; expires=" + expires.toGMTString(); } } // -------------------------------------------------------------------------------- // ブラウザ確認用Cookieを設定 // -------------------------------------------------------------------------------- function setBrowserCookie() { var cb_br = '1f9fc6beced511b00b5cd8578065f6df1361b9bf'; setCookie( 'cb_br', cb_br, 0 ); return cb_br; } // -------------------------------------------------------------------------------- // ユーザ識別用Cookieを設定 // -------------------------------------------------------------------------------- function setUserCookie() { var cid = '1f9fc6beced511b00b5cd8578065f6df1361b9bf'; setCookie( 'cid', cid, 365 ); return cid; } // -------------------------------------------------------------------------------- // ユーザ識別用Cookieを更新 // -------------------------------------------------------------------------------- function updateUserCookie() { // クッキーの値を再取得 cookieObj = getCookie(); var cid = cookieObj['cid']; setCookie( 'cid', cid, 365 ); } // -------------------------------------------------------------------------------- // セッション識別用Cookieを設定 // -------------------------------------------------------------------------------- function setSessionCookie() { var sid = '177c108c2721f75dd3be14fb8d640326'; // セッション識別用クッキーの有効期限を10分に設定 expires = new Date(); //expires.setTime( expires.getTime() + 600 * 1000 ); //expires.setTime( expires.getTime() + 5400*1000 ); expires.setTime( expires.getTime() + 1800*1000 ); document.cookie = "sid=" + sid + "; path=/; expires=" + expires.toGMTString(); return sid; } // -------------------------------------------------------------------------------- // セッション識別用Cookieを更新 // -------------------------------------------------------------------------------- function updateSessionCookie() { // クッキーの値を再取得 cookieObj = getCookie(); var sid = cookieObj['sid']; // セッション識別用クッキーの有効期限を10分に設定 expires = new Date(); //expires.setTime( expires.getTime() + 600 * 1000 ); //expires.setTime( expires.getTime() + 5400*1000 ); expires.setTime( expires.getTime() + 1800*1000 ); document.cookie = "sid=" + sid + "; path=/; expires=" + expires.toGMTString(); } //////////////////////////////////////////////////////////////////////////////////// // Cookieの制御 - ここまで - //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // analyzeモード - ここから - //////////////////////////////////////////////////////////////////////////////////// // --------------------------------------------------------------------------------- // 通常ログの書き込み // --------------------------------------------------------------------------------- function writeNormalLog() { // ディスプレイの解像度、使用カラー数(bitカラー)を設定 setWindowArea(); // コンテンツ領域の最大値を取得 setClientArea(); // ブラウザ確認用クッキーの値がない場合再読み込み if ( !cookieObj['cb_br'] ) { is_browser_close = 1; cookieObj = getCookie(); } // cb_brがある場合ログ取得 if ( cookieObj['cb_br'] ) { var titleStr = ""; try { titleStr = document.getElementsByTagName('title'); titleStr = titleStr[0].text; } catch(e) { titleStr = ""; } document.onmousemove = setMousePosition; var srcStr = "https://www.nr-sc8.com/?m=log&a=normal"; srcStr += "&tag_id=7usIoyvfU9"; srcStr += "&user_cookie="+cookieObj['cid']; srcStr += "&user_session="+cookieObj['sid']; srcStr += "&self_url="+escape(document.location.href); srcStr += "&referer="+escape(document.referrer); srcStr += "&windowX="+windowX; srcStr += "&windowY="+windowY; srcStr += "&clientX="+clientX; srcStr += "&clientY="+clientY; srcStr += "&colorDepth="+colorDepth; srcStr += "&p_title="+encodeURIComponent(titleStr); srcStr += "&p_modified="+document.lastModified; srcStr += "&cv_id="; srcStr += "&is_br="+is_browser_close; document.write('
'); } } function addEvent ( elem, event, func ){ if ( elem.addEventListener ) { elem.addEventListener( event, func, false ); } else { elem.attachEvent( 'on'+event, func ); } } // --------------------------------------------------------------------------------- // 通常ログの書き込み完了ハンドラ // --------------------------------------------------------------------------------- function writeNormalLogHandler(data){ var data = data.obj; access_log_id = data['access_log_id']; is_vtr_page = data['is_vtr_page']; // VTR取得ページかどうかの判定 if ( is_vtr_page == "true" ) { // VTRログタイマーの開始 startVTRLogTimer(); } else { //alert('VTRログは取りません。'); } } // --------------------------------------------------------------------------------- // ディスプレイの解像度、使用カラー数(bitカラー)を設定 // --------------------------------------------------------------------------------- function setWindowArea() { // ディスプレイの解像度を取得 windowX = screen.width; windowY = screen.height; // 使用カラー数(bitカラー)を取得 colorDepth = screen.colorDepth; } // --------------------------------------------------------------------------------- // コンテンツ領域の最大値を取得 // --------------------------------------------------------------------------------- function setClientArea() { // IE以外のブラウザ if ((!document.all || window.opera) && document.getElementById) { clientX = window.innerWidth; clientY = window.innerHeight; // Windows IE6 ・ 標準モード } else if (document.getElementById && (document.compatMode=='CSS1Compat')) { clientX = document.documentElement.clientWidth; clientY = document.documentElement.clientHeight; // その他のIE } else if (document.all) { clientX = document.body.clientWidth; clientY = document.body.clientHeight; // その他(非対応ブラウザ) } else { clientX = 0; clientY = 0; } } // --------------------------------------------------------------------------------- // VTRログタイマーの開始 // --------------------------------------------------------------------------------- // ログの仮保存用配列 var tmpLogArray = new Array(); // 仮保存用カウンタ var tmpLogCount = 9; function startVTRLogTimer() { //vtrLogTimer = setInterval('vtrLogTimerHandler()',1000); vtrLogNo = 0; // ページ遷移時 window.onunload = vtrLogPageMove; vtrLogTimer = setInterval('vtrLogTimerHandler()',500); } // --------------------------------------------------------------------------------- // VTRログタイマーハンドラー // --------------------------------------------------------------------------------- function vtrLogTimerHandler(e) { // スクリーンのサイズ setWindowArea(); // コンテンツ領域の最大値 setClientArea(); // スクロールバーの位置 scrollX = (document.body.scrollLeft || document.documentElement.scrollLeft); scrollY = (document.body.scrollTop || document.documentElement.scrollTop); // VTRログの書き込み writeVTRLog(); i++; } // --------------------------------------------------------------------------------- // VTRログの書き込み // --------------------------------------------------------------------------------- function writeVTRLog() { // クッキーの値を再取得 cookieObj = getCookie(); vtrLogNo++; if ( access_log_id ) { var move_flg = false; // 前回の位置から移動しているかどうかの判定 if ( csMouseX != mouseX || csMouseY != mouseY || csScrollX != scrollX || csScrollY != scrollY || csClientX != clientX || csClientY != clientY ) { move_flg = true; csMouseX = mouseX; csMouseY = mouseY; csScrollX = scrollX; csScrollY = scrollY; csClientX = clientX; csClientY = clientY; clearSessionTimer = 0; // セッションを継続させる //updateSessionCookie(); } else { clearSessionTimer++ } totalStayTimer++; // 3分以上動作がなかったら、トータルで10分以上滞在、セッション識別用クッキーがなかったらタイマーを終了 if ( clearSessionTimer <= 360 && totalStayTimer <= 1200 && cookieObj['sid'] != undefined ) { var htmlTag = document.createElement('script'); var srcStr = ""; srcStr += "https://www.nr-sc8.com/?m=log&a=vtr"; srcStr += "&access_log_id="+access_log_id; srcStr += "&tag_id=7usIoyvfU9"; srcStr += "&mouseX="+mouseX; srcStr += "&mouseY="+mouseY; srcStr += "&scrollX="+scrollX; srcStr += "&scrollY="+scrollY; srcStr += "&clientX="+clientX; srcStr += "&clientY="+clientY; srcStr += "&vln="+vtrLogNo; htmlTag.src=srcStr; htmlTag.id='conv_tag'; var bodyObj = document.getElementById('conbird'); bodyObj.appendChild(htmlTag); } else { // ログ用タイマーをクリア clearInterval(vtrLogTimer); // セッションを消去 //setCookie( 'sid', '', 0 ); } } else { // ログ用タイマーをクリア clearInterval(vtrLogTimer); // セッションを消去 //setCookie( 'sid', '', 0 ); } } // --------------------------------------------------------------------------------- // ページ遷移時、送信してないログを送信 // --------------------------------------------------------------------------------- function vtrLogPageMove() { // ログ用タイマーをクリア clearInterval(vtrLogTimer); var showStr = ""; for( var i=0; i < tmpLogArray.length; i++ ) { showStr += i + ": " + tmpLogArray[i]['mouseX'] + "\n"; } tmpLogArray = new Array(); } // --------------------------------------------------------------------------------- // マウス位置取得用関数 // --------------------------------------------------------------------------------- function setMousePosition(e){ mouseX = getMousePosition(e).x; mouseY = getMousePosition(e).y; } function getMousePosition(e) { var obj = new Object(); if(e){ obj.x = e.pageX - scrollX; obj.y = e.pageY - scrollY; } else { obj.x = event.clientX; obj.y = event.clientY; } // 画面の有効領域内かどうかチェック if ( obj.x < 0 ) { obj.x = 2; } else if ( obj.x > clientX ) { obj.x = clientX; } if ( obj.y < 0 ) { obj.y = 2; } else if ( obj.y > clientY ) { obj.y = clientY; } return obj; } //////////////////////////////////////////////////////////////////////////////////// // analyzeモード - ここまで - //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // viewモード - ここから - //////////////////////////////////////////////////////////////////////////////////// var moveFlg = 0; // ターゲット画像用 var target_img // 移動後のX座標 var nowX = 0; // 現在のX座標 var nowY = 0; // 移動後のX座標 var endX = 0; // 移動後のY座標 var endY = 0; // move_target用カウンタ var mt_count = 1; // 1つ前のスクロール位置 var preScrollY; // --------------------------------------------------------------------------------- // Viewモードの設定の初期化 // --------------------------------------------------------------------------------- function initViewModeSetting() { // マウストラッキング出力用DIVタグ document.write('
';
// 座標の初期化
nowX = vtrData['log1']['mouseX'];
nowY = vtrData['log1']['mouseY'];
// データが1つしかない場合(再生秒数が1秒の場合)
if ( vtrData['log2'] in window ) {
vtrData['log2'] = new Array();
vtrData['log2']['mouseX'] = vtrData['log1']['mouseX'];
vtrData['log2']['mouseY'] = vtrData['log1']['mouseY'];
vtrData['log2']['scrollX'] = vtrData['log1']['scrollX'];
vtrData['log2']['scrollY'] = vtrData['log1']['scrollY'];
endX = vtrData['log1']['mouseX'];
endY = vtrData['log1']['mouseY'];
} else {
endX = vtrData['log2']['mouseX'];
endY = vtrData['log2']['mouseY'];
}
document.documentElement.scrollLeft = 0;
document.body.scrollLeft = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
preScrollY = 0;
vtrDataCount = 2;
// 移動フラグ
moveFlg = 0;
// タイマーの開始
timer = setInterval('move_target()', 62);
}
function move_target() {
// 移動開始時
if ( mt_count == 1 ) {
// スクロール位置の設定
document.documentElement.scrollLeft = 0;
document.body.scrollLeft = 0;
document.documentElement.scrollTop = vtrData['log' + vtrDataCount]['scrollY'];
document.body.scrollTop = vtrData['log' + vtrDataCount]['scrollY'];
// 前のY座標との比較
var afterImgY = vtrData['log' + vtrDataCount]['scrollY'] - preScrollY;
preScrollY = vtrData['log' + vtrDataCount]['scrollY'];
// 画像の位置を設定
var nowImgY = document.getElementById('target_img').style.top;
document.getElementById('target_img').style.top = ((parseInt(nowImgY.replace('px', '')) + afterImgY) + 'px');
}
// 再生終了時
if ( mt_count == 8 ) {
// 最後のデータだった場合タイマーをクリア
if ( getVTRDataCount(vtrData) == vtrDataCount ) {
clearInterval(timer);
alert('再生が終了しました。');
} else {
mt_count = 1;
vtrDataCount ++;
// nowXを再設定
nowX = vtrData['log' + (vtrDataCount-1)]['mouseX'];
nowY = vtrData['log' + (vtrDataCount-1)]['mouseY'];
endX = vtrData['log' + vtrDataCount]['mouseX'];
endY = vtrData['log' + vtrDataCount]['mouseY'];
//alert( "nowX:" + nowX + " nowY:" + nowY + "\nendX:" + endX + " endY:" + endY );
}
// 通常移動時
} else {
// 座標の移動量を取得
var moveX = ( endX - nowX ) / 8;
var moveY = ( endY - nowY ) / 8;
// 移動後の座標を代入
var nowImgX2 = document.getElementById('target_img').style.left;
document.getElementById('target_img').style.left = ((parseInt(nowImgX2.replace('px', '')) + moveX) + 'px');
var nowImgY2 = document.getElementById('target_img').style.top;
document.getElementById('target_img').style.top=((parseInt(nowImgY2.replace('px', '')) + moveY) + 'px');
mt_count++;
}
}
// --------------------------------------------------------------------------------
// VTRログの要素数をカウントする
// --------------------------------------------------------------------------------
function getVTRDataCount( data ){
var count = 0;
for(key in data){ count++; }
return count;
}
////////////////////////////////////////////////////////////////////////////////////
// viewモード - ここまで -
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// graphモード - ここから -
////////////////////////////////////////////////////////////////////////////////////
// ---------------------------------------------------------------------------------
// Graphモードの設定の初期化
// ---------------------------------------------------------------------------------
function initGraphModeSetting() {
// ディスプレイの解像度、使用カラー数(bitカラー)を設定
setWindowArea();
// 画面表示領域をセット
setClientArea();
// グラフ出力用DIVタグ
document.write('
';
alert('データの読み込みを開始します。');
getGraphLogData();
}
// コントローラーの配置
//var divController = document.createElement('div');
//divController.style.backgroundImage ='url(https://www.nr-sc8.com/images/control_back.gif)';
//divController.name='controller_div';
//divController.style.position='absolute';
//divController.style.left = (clientX/2) - (776/2) + 9;
//divController.style.bottom = '0';
//divController.style.height = 150;
//divController.style.width = 776;
//objBody.appendChild(divController);
// コントローラーのDivにIDを指定
//divController.setAttribute('id','control_div');
// コントローラーの位置指定ハンドラ開始
//timer = setInterval('setControllerPosition()', 300);
}
// ---------------------------------------------------------------------------------
// Graphログデータ取得
// ---------------------------------------------------------------------------------
function getGraphLogData(){
// エリアの高さを設定
var ah = requestObj['ah'];
if ( ah == 1 ) {
area_height = 300;
} else if ( ah == 2 ) {
area_height = 300;
} else if ( ah == 3 ) {
area_height = 30;
} else {
$ah = 1;
area_height = 300;
}
// エリアの数を取得
var area_num = (Math.floor(document.body.scrollHeight / area_height) + 1);
// グラフデータを取得
var htmlTag= document.createElement('script');
htmlTag.src='https://www.nr-sc8.com/?m=log&a=graph_data&tid=' + requestObj['tid'] + '&url=' +requestObj['url'] + '&as=' +requestObj['as'] + '&ae=' +requestObj['ae'] + '&at=' +requestObj['at'] + '&ut=' +requestObj['ut'] + '&ic=' +requestObj['ic'] + '&ah=' + requestObj['ah'] + '&an=' + area_num + '&kw=' + requestObj['kw'] + '&rf=' + requestObj['rf'] + '&se=' + requestObj['se'] + '&dh=' + requestObj['dh'] + '&cy=' + requestObj['cy'] + '&cm=' + requestObj['cm'] + '&cdt=' + requestObj['cdt'] + '&cd=' + requestObj['cd'] + '&ch=' + requestObj['ch'];
var bodyObj = document.getElementsByTagName('body').item(0);
bodyObj.appendChild(htmlTag);
}
// ---------------------------------------------------------------------------------
// Graphログデータ読み込み完了ハンドラ
// ---------------------------------------------------------------------------------
function getGraphLogDataHandler(data){
alert('データの読み込みが完了しました。');
// ローディング表示を消去
document.getElementById('loading').style.display = 'none';
graphData = data.obj;
// Graph表示
startGraphDisp();
}
// --------------------------------------------------------------------------------
// Graph表示
// --------------------------------------------------------------------------------
var overGraphFlg = false;
// エリアの幅設定
var area_flg = 1;
var area_height = 300;
if ( requestObj['ah'] == 1 ) {
// フック
area_flg = 1;
area_height = 300;
} else if ( requestObj['ah'] == 2 ) {
// 俯瞰
area_flg = 2;
area_height = 300;
} else if ( requestObj['ah'] == 3 ) {
// 詳細
area_flg = 3;
area_height = 30;
} else {
area_flg = 1;
area_height = 300;
}
function startGraphDisp() {
// ---------------------------------------------------------------------------
// グラフ背景を配置 - ここから -
// ---------------------------------------------------------------------------
// グラフ背景の高さ設定
var graph_black_height = 0;
if ( document.body.scrollHeight % area_height != 0 ) {
graph_black_height = (Math.floor(document.body.scrollHeight / area_height) + 1) * area_height;
if ( area_height==30 ) {
graph_black_height = (Math.floor(document.body.scrollHeight / 300) + 1) * 300;
}
} else {
graph_black_height = document.body.scrollHeight;
}
var graph_back_style = "position: absolute;";
graph_back_style += "width: " + document.body.scrollWidth + "px;";
graph_back_style += "height: " + graph_black_height + "px;";
graph_back_style += "left: 0;";
graph_back_style += "top: 0;";
graph_back_style += "z-index: 100;";
// 背景色の設定
if( area_flg == 1 ) {
graph_back_style += "background-image: url(https://www.nr-sc8.com/images/black.gif);";
} else if ( area_flg == 2 ) {
graph_back_style += "background-image: url(https://www.nr-sc8.com/images/black.gif);";
} else if ( area_flg == 3 ) {
graph_back_style += "background-image: url(https://www.nr-sc8.com/images/clear.gif);";
}
var graph_back = '';
document.getElementById('vtr_graph').innerHTML = graph_back;
// ---------------------------------------------------------------------------
// グラフ背景を配置 - ここまで -
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// グラフ設定
// ---------------------------------------------------------------------------
// グラフの本数
var graph_num = requestObj['g_num'];
// 表示するグラフの取得
var graph_disp_contents = new Array();
var tmp_contents = requestObj['g_contents'];
graph_disp_contents = tmp_contents.split("");
// グラフのデータ配列
var graph_base_data = new Array(6);
graph_base_data[1] = new Array(3);
graph_base_data[1]['img'] = "blue.gif";
graph_base_data[1]['name'] = "people";
graph_base_data[2] = new Array(3);
graph_base_data[2]['img'] = "green.gif";
graph_base_data[2]['name'] = "exit";
graph_base_data[3] = new Array(3);
graph_base_data[3]['img'] = "orange.gif";
graph_base_data[3]['name'] = "cr";
graph_base_data[4] = new Array(3);
graph_base_data[4]['img'] = "red.gif";
graph_base_data[4]['name'] = "time";
graph_base_data[5] = new Array(3);
graph_base_data[5]['img'] = "violet.gif";
graph_base_data[5]['name'] = "av";
graph_base_data[6] = new Array(3);
graph_base_data[6]['img'] = "yellow.gif";
graph_base_data[6]['name'] = "conv";
// グラフの高さ配列
var graph_height = new Array(6);
graph_height[1] = 260;
graph_height[2] = 120;
graph_height[3] = 72;
graph_height[4] = 50;
graph_height[5] = 36;
graph_height[6] = 26;
// エリア数を取得
var area_count = getGraphDataCount(graphData);
// グラフコンテンツ格納用変数
var graph_contents = "";
// ブラウザの平均サイズを設定
if ( document.body.scrollWidth < graphData[0]['browserX'] ) {
var browserX = document.body.scrollWidth;
} else {
var browserX = graphData[0]['browserX'];;
}
var browserY = graphData[0]['browserY'];
// 各種グラフの表示
if ( area_flg == 1 ) {
// --------------------------------------------------
// フック - ここから -
// --------------------------------------------------
// 空白エリアの設定
var blank_area_num_style = "background-color: #EEEEEE;";
blank_area_num_style += "padding-top: 145px;";
blank_area_num_style += "height: 155px;";
blank_area_num_style += "width: 20px;";
blank_area_num_style += "position: absolute;";
blank_area_num_style += "left: 0;";
blank_area_num_style += "top: 0;";
blank_area_num_style += "border-right: 1px solid #333333;";
blank_area_num_style += "z-index: 499;";
var blank_area_num = '';
graph_contents += blank_area_num;
// グラフの配置( 1回のループで1エリア分を表示 )
for( var i=0; i < (getGraphDataCount(graphData)); i++ ) {
// ---------------------------------------------------------------
// エリア分割ライン
// ---------------------------------------------------------------
var line_style = "background-color: #FFFFFF;";
line_style += "height: 1px;";
line_style += "position: absolute;";
line_style += "font-size: 1px;";
line_style += "width: " + document.body.scrollWidth + "px;";
line_style += "left: 0;";
line_style += "top: " + ( ( i + 1 ) * area_height ) + "px;";
line_style += "z-index: 500;";
var line_html = '';
graph_contents += line_html;
// ---------------------------------------------------------------
// グラフを表示
// ---------------------------------------------------------------
// フック率の判定
var graph_img = "blue.gif";
var hook_rate = Math.floor((( graphData[i]['people_str'] / graphData[i]['cr_num'] ) * 100 ));
if ( hook_rate > 80 ) {
graph_img = "red.gif";
} else if( 60 < hook_rate && hook_rate <= 80 ) {
graph_img = "yellow.gif";
} else if( 40 < hook_rate && hook_rate <= 60 ) {
graph_img = "green.gif";
}
// グラフ設定
var graph_style = "background-image: url(https://www.nr-sc8.com/images/" + graph_img + ");";
graph_style += "height: 300px;";
graph_style += "position: absolute;";
graph_style += "width: " + Math.floor(graphData[i]['cr']) + "px;";
graph_style += "top: " + (( i * area_height ) + 300) + "px;";
graph_style += "z-index: 100;";
//var graph_left = Math.floor(((document.body.scrollWidth - graphData[i]['cr']) / 2));
//if ( graph_left % 2 != 0 ) {
// graph_left++;
//}
//graph_style += "left: " + graph_left + "px;";
graph_style += "left: 20px;";
var graph_html = '';
graph_contents += graph_html;
// ---------------------------------------------------------------
// エリア番号
// ---------------------------------------------------------------
var area_num_style = "background-color: #EEEEEE;";
area_num_style += "padding-top: 145px;";
area_num_style += "height: 155px;";
area_num_style += "padding-left: 5px;";
area_num_style += "position: absolute;";
area_num_style += "font-size: small;";
area_num_style += "left: 0;";
area_num_style += "top: " + (( i * area_height ) + 300 ) + "px;";
area_num_style += "border-right: 1px solid #333333;";
area_num_style += "z-index: 499;";
if ( i<10 ) {
area_num_style += "padding-left: 6px;";
area_num_style += "width: 14px;";
} else {
area_num_style += "padding-left: 3px;";
area_num_style += "width: 17px;";
}
var area_num = '
';
}
area_html2 += '離脱: ' + graphData[i]['exit_num'] + ' ( ' + per_exit + '% )