// ホスト名及びパスを取得
var str_hostname = location.hostname;
var str_pathname = location.pathname;





document.write('<script type="text/javascript" language="javascript">');

document.write('function siteJudge(link_num) {');

// 引数を数値で取ってこないとエラーになった為、ここでどのリンクから呼ばれたかを文字列に変換
// Analyticsで表示するページ名
document.write('switch(link_num) {');
document.write(' case 0 :');
document.write('  link_name = "トヨタホームの分譲住宅ポータルサイト";');
document.write('  break;');
document.write(' case 1 :');
document.write('  link_name = "メルマガ募集中";');
document.write('  break;');
document.write(' case 2 :');
document.write('  link_name = "販売中の物件一覧";');
document.write('  break;');
document.write(' default :');
document.write('  link_name = "none";');
document.write('  break;');
document.write('}');

//デバッグ用
//document.write('alert("location.hostname="+location.hostname);');
//document.write('alert("location.pathname="+location.pathname);');

// ホスト名及びパスを取得
document.write('var str_hostname = location.hostname;');
document.write('var str_pathname = location.pathname;');

// ドメイン名が「toyota-town.jp」である場合
document.write('if (str_hostname.match(/toyota-town.jp/)) {');

document.write('url_array = str_pathname.split("/");');
document.write('result_str = url_array[1];');
document.write('_gaq.push(["_trackPageview","/include/" + link_name + "/" + result_str]);');

//デバッグ用
//document.write('alert("/include/" + link_name + "/" + result_str);');

// 独自ドメインまたはテスト環境（IPアドレスそのまま）の場合
document.write('} else { ');

// テスト環境の場合
document.write('if (str_pathname.match(/toyota-tokusetsu-test/)) {');
document.write('url_array = str_pathname.split("/");');
document.write('result_str = url_array[2];');

//独自ドメインの場合
document.write('} else {');
document.write('_gaq.push(["_trackPageview","/include/" + link_name + "/" + str_hostname]);_gaq.push(["_link", this.href]); return false;');

//デバッグ用
//document.write('alert("/include/" + link_name + "/" + str_hostname);');

document.write('} ');
document.write('}');

document.write('}');
document.write('</script>');





// フッター表示部分 ↓開始*******************************


document.write('<div class="include-header clearfix">');
document.write('  <ul class="include-header-list clearfix">');


// ドメイン名が「toyota-town.jp」である場合
if (str_hostname.match(/toyota-town.jp/)) {


    document.write('<li><a href="http://www.toyota-town.jp/" target="_blank" onclick="siteJudge(0);">トヨタホームの分譲住宅ポータルサイト</a></li>');
    document.write('<li><a href="http://www.toyota-town.jp/others/club" target="_blank" onclick="siteJudge(1);">メルマガ会員募集中</a></li>');
    document.write('<li style="padding:0 0 0 10px;"><a href="http://www.toyota-town.jp/exhibition/all" target="_blank" onclick="siteJudge(2);">販売中の物件一覧</a></li>');


// 独自ドメインまたはテスト環境（IPアドレスそのまま）の場合
} else {
    // テスト環境の場合
    if (str_pathname.match(/toyota-tokusetsu-test/)) {


    document.write('<li><a href="http://www.toyota-town.jp/" target="_blank" onclick="siteJudge(0);">トヨタホームの分譲住宅ポータルサイト</a></li>');
    document.write('<li><a href="http://www.toyota-town.jp/others/club" target="_blank" onclick="siteJudge(1);">メルマガ会員募集中</a></li>');
    document.write('<li style="padding:0 0 0 10px;"><a href="http://www.toyota-town.jp/exhibition/all" target="_blank" onclick="siteJudge(2);">販売中の物件一覧</a></li>');


    //独自ドメインの場合
    } else {


    document.write('<li><a href="http://www.toyota-town.jp/" target="_blank" onclick="siteJudge(0);">トヨタホームの分譲住宅ポータルサイト</a></li>');
    document.write('<li><a href="http://www.toyota-town.jp/others/club" target="_blank" onclick="siteJudge(1);">メルマガ会員募集中</a></li>');
    document.write('<li style="padding:0 0 0 10px;"><a href="http://www.toyota-town.jp/exhibition/all" target="_blank" onclick="siteJudge(2);">販売中の物件一覧</a></li>');


    }
}


document.write('  </ul>');
document.write('</div><!--include-header end-->');


// フッター表示部分 ↑終了*******************************

