/* ------------------------------------------------------
   更新履歴
------------------------------------------------------ */
/* 2009/11/25
   ・サイトカタリスト

/* 2009/10/01
   ・レコメンドビーコン画像出力処理追記

/* 2008/12/19
   ・新規作成
------------------------------------------------------ */

/**********************************************************************************************
* フッターリンク要素
* 記述法 : 下記のフォーマットにて列を追加
  footerData.push(new Array("リンク先URL", "CSSクラス名", "ターゲットウィンドウ", "表示テキストもしくはHTML"));
*/

var footerData = new Array();
footerData.push(new Array('/jp/terms_of_use/index.html', '', '_self', 'ご利用に際して'));
footerData.push(new Array('/jp/terms_of_use/privacy_statement.html', '', '_self', '個人情報の取り扱い'));
footerData.push(new Array('/jp/faq/index.html', '', '_self', 'お問い合わせ'));
footerData.push(new Array('/jp/sitemap/index.html', '', '_self', 'サイトマップ'));



/******************************************************************************/
//etoyota.net効果検証ビーコン用JS読み込み

var protocol = location.protocol.indexOf('https') > -1 ? 'https:' : 'http:';
var url = protocol + '//etoyota.net/include/js/measurementBeacon.js';

document.write('<script src="' + url + '" type="text/javascript"></script>');


/******************************************************************************/
//Google Analystics用JS読み込み
if(location.protocol.indexOf('https') == -1){
    document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>');
}else {
    document.write('<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>');
}


/******************************************************************************/
//フッター出力

//共通フッター
function outputFooter(){
    var htmlStr = "";
    htmlStr += '<table width="100%" border=0 cellspacing=0 cellpadding=0>';
    htmlStr += '<tr><td class=footerMenu>';
    var len = footerData.length;
    for(var i=0; i<len; i++){
        if (i) htmlStr += '&nbsp; | &nbsp;';
        htmlStr += '<a class="' + footerData[i][1] + '" ';         htmlStr += 'href="'+footerData[i][0]+'" target="'+footerData[i][2]+'">'
        htmlStr += 'href="'+footerData[i][0]+'" target="'+footerData[i][2]+'">'+footerData[i][3]+'</a>';
    }
    htmlStr += '</td></tr>';
    htmlStr += '<tr><td class=footerCopy><img src="/jp/image/copyrights.gif" width=400 height=14 alt="(c) TOYOTA MOTOR CORPORATION. All Rights Reserved."></td></tr>';
    htmlStr += '</table>';

    document.write(htmlStr);
    outputBeacon();
}

//ニュース用フッター
function outputNewsFooter(){
    var htmlStr = "";
    htmlStr += '<div style="padding:3px; padding-left:12px;"><img src="/jp/image/copyrights.gif" width=400 height=14 alt="(c) TOYOTA MOTOR CORPORATION. All Rights Reserved."></div>';
    document.write(htmlStr);
    outputBeacon();
}

/******************************************************************************/
//ビーコン出力

function outputBeacon(){
    var htmlStr = "";

    etoyota_bc();
    google_bc();
    recommend_bc();
    SCoutput_bc();
}

/******************************************************************************/
//etoyota.net効果検証ビーコン

function etoyota_bc(){
    //eTOYOTA.net Beacon START
    measurementBeacon();
}

/******************************************************************************/
//ビーコン出力

function SCoutput_bc(){

    var catalystStr = "";
    catalystStr += '<script language="JavaScript" type="text/javascript">';
    catalystStr += ' var SCaccount="toyotamotormotorsportsprd"';
    catalystStr += '</script>';
    if(location.protocol.indexOf('https') == -1){
        catalystStr += '<script language="JavaScript" src="http://toyota.jp/include/js/s_code_v2.js"></script>';
    }else {
        catalystStr += '<script language="JavaScript" src="https://toyota.jp/include/js/s_code_v2.js"></script>';
    }
    document.write(catalystStr);
}

/******************************************************************************/
//Google Analystics ビーコン

function google_bc(){
    //Google Analystics start
    if (location.protocol.indexOf('https') == -1) {
        _uacct = "UA-641300-9";
    } else {
        _uacct = "UA-641300-10";
    }
    urchinTracker();
    //Google Analystics end
}
/******************************************************************************/
//レコメンド ビーコン

function recommend_bc(){
    if(window.location.protocol.indexOf('https') == -1){
        var colledurl = 'http://' + window.location.host + window.location.pathname + window.location.search;
        var beaconurl = 'http://search.toyota.jp/image/beacon.gif?item=' + escape(colledurl);
        var imgtag = '<img src="' + beaconurl + '">';
        document.write(imgtag);
    }
}
/******************************************************************************/


