﻿/* urlparser class */

var urlparser = function(){
	this.url  = document.location.href;
	this.path = document.location.pathname;
	this.host = document.location.hostname;
	if(this.path == "/"){
		this.path_ary = {};
	}
	else {
		this.pathreg = this.path.replace(/^\//,"");
		this.pathreg = this.pathreg.replace(/(\..*$|\/$)/,"");
		this.path_ary = this.pathreg.split("/");
	}
	this.layer = this.path_ary.length;	
	this.current = this.path_ary[0];

	this.descend = function(){

		if (this.path_ary.length > 0){
			this.parent_dir = this.path_ary.shift();
			this.current = this.path_ary[0];
			this.layer = this.path_ary.length;
		}
	};
}

var dir = new urlparser();
var formname = "";

//top
if(location.pathname == "/" || location.pathname == "/index.html" || location.pathname == "/index.htm" || location.pathname == "/_home.html"){
	s.channel = "J:COM_TOP";
//business_dir
} else if(document.URL.indexOf(document.domain + "/business",0) != -1){
do{
	switch(dir.current){
		case "business":	s.channel="B2B: 法人のお客様";			break;
			case "biz_devl":	s.channel="B2B: J:COM導入ガイド";		break;
			case "mediaguide":	s.channel="B2B: メディアガイド";		break;
			case "soho":		s.channel="B2B: J:COM in the office";	break;
		//for debugging purpose
		case "files":			s.channel="B2B: 法人のお客様";			break;
			case "testurl": 	s.channel="B2B: J:COM導入ガイド";		break;
	}
	dir.descend();
}while(dir.layer > 0);
//corporate_dir
} else if(document.URL.indexOf(document.domain + "/corporate",0) != -1){
do{
	switch(dir.current){
		case "corporate":		s.channel="CORP: 企業情報";			break;
			case "business":		s.channel="CORP: 事業内容";			break;
			case "corp":			s.channel="CORP: 会社案内";			break;
			case "csr":				s.channel="CORP: 社会貢献活動";		break;
			case "group_companies":	s.channel="CORP: グループ会社";		break;
			case "newsreleases":	s.channel="CORP: ニュースリリース";	break;
	}
	dir.descend();
}while(dir.layer > 0);
//ir_dir
} else if(document.URL.indexOf(document.domain + "/ir",0) != -1){
do{
	switch(dir.current){
		case "ir":			s.channel="IR: IR情報";			break;
			case "accounts":	s.channel="IR: 電子広告";		break;
			case "analyst":		s.channel="IR: アナリスト一覧";	break;
			case "calendar":	s.channel="IR: IRカレンダー";	break;
			case "faq":			s.channel="IR: よくあるご質問";	break;
			case "financial":	s.channel="IR: 財務・業績情報";	break;
			case "irlibrary":	s.channel="IR: IR資料室";		break;
			case "manage":		s.channel="IR: 経営方針";		break;
			case "stocks":		s.channel="IR: 株式情報";		break;
	}
	dir.descend();
}while(dir.layer > 0);
//services_dir
} else if(document.URL.indexOf(document.domain + "/services",0) != -1){
do{
	switch(dir.current){
		case "services":	s.channel="サービス";		break;
			case "tv": 	s.channel="J:COM TV";		break;
			case "hdr":	s.channel="J:COM TV (HDR)";	break;
			case "net":	s.channel="J:COM NET";		break;
			case "phone":	s.channel="J:COM PHONE";	break;
			case "mobile":	s.channel="J:COM MOBILE";	break;
			case "secure":	s.channel="J:COM 緊急地震速報";	break;
			case "chideji_bs_ao":	s.channel="J:COM TV (追加地デジ/BSデジコース)";	break;
			case "area":	
				if(dir.parent_dir=="services"){	
					s.channel="サービスエリア検索";	s.pageName="サービスエリア検索";
				}break;
			case "pricing":	s.channel="料金";		break;
			case "pay":	s.channel="料金";		break;
			case "netprice":	s.channel="料金";	break;
	}
	dir.descend();
}while(dir.layer > 0);
//information_commons_dir||information_room_dir
} else if(document.URL.indexOf(document.domain + "/information/common",0) != -1||document.URL.indexOf(document.domain + "/information/common",0) != -1){
do{
	switch(dir.current){
		case "zip":						s.channel="サービスエリア検索";		break;
		case "zip_select":				s.channel="サービスエリア検索";		break;
		case "zip_select_new":			s.channel="サービスエリア検索";		break;
		case "pref":					s.channel="サービスエリア検索";		break;
		case "pref_select":				s.channel="サービスエリア検索";		break;
		case "pref_select_new":			s.channel="サービスエリア検索";		break;
		case "detail":					s.channel="サービスエリア検索";		break;
		case "detail_select":			s.channel="サービスエリア検索";		break;
		case "detail_select_new":		s.channel="サービスエリア検索";		break;
		case "freeword":				s.channel="サービスエリア検索";		break;
		case "free_word":				s.channel="サービスエリア検索";		break;
		case "free_word_select":		s.channel="サービスエリア検索";		break;
		case "free_word_select_new":	s.channel="サービスエリア検索";		break;
		case "set_area":				s.channel="サービスエリア検索";		break;
		case "mdu_search":				s.channel="サービスエリア検索";		break;
		case "area":					s.channel="サービスエリア検索";		break;
		case "area_select":				s.channel="サービスエリア検索";		break;
		case "area_select_new":			s.channel="サービスエリア検索";		break;
		case "pricing":					s.channel="料金";					break;
	}
	dir.descend();
}while(dir.layer > 0);
//files_starter_dir
} else if(document.URL.indexOf(document.domain + "/files/starter",0) != -1){
do{
	switch(dir.current){
		case "starter":		s.channel="starter";	break;
	}
	dir.descend();
}while(dir.layer > 0);
//files_customer_dir
} else if(document.URL.indexOf(document.domain + "/files/customer",0) != -1){
do{
	switch(dir.current){
		case "customer":	s.channel="customer";	break;
	}
	dir.descend();
}while(dir.layer > 0);
//other_dir
} else {
do{
	switch(dir.current){
		case "secure":			s.channel="J:COM 緊急地震速報";			break;
		case "soho":			s.channel="B2B: J:COM in the office";	break;
		case "campaign":		s.channel="キャンペーン";				break;
		case "mediaguide":		s.channel="B2B: メディアガイド";		break;
		case "user":			s.channel="加入者特典";					break;
		case "join":			s.channel="お申込み・お手続き";			break;
		case "square":			s.channel="J:COM SQUARE";				break;
		case "about":			s.channel="カスタマーサポート";			break;
		case "customer":		s.channel="カスタマーサポート";			break;
		case "popup_invoice":	s.channel="カスタマーサポート";			break;
		case "faq":				s.channel="カスタマーサポート";			break;
		case "support":			s.channel="カスタマーサポート";			break;
		case "pricing":			s.channel="料金";						break;
		case "pay":				s.channel="料金";						break;
		case "netprice":		s.channel="料金";						break;
		case "area_select":		s.channel="サービスエリア検索";			break;
		case "contactus":		s.channel="お問合せ";					break;
		case "program":			s.channel="番組情報";					break;
		case "aboutjcom":		s.channel="J:COMってなに？";			break;
		case "biz_devl":		s.channel="B2B J:COM導入ガイド";		break;
		case "notice":			s.channel="お知らせ";					break;
		case "shop":			s.channel="ジェイコムショップ";			break;
		case "inmyroom":		s.channel="J:COM in My Room";			break;
		case "brand":			s.channel="ブランド";					break;
		case "contact":			s.channel="お申込み・お手続き";			break;
		case "files":			s.channel="files";						break;
		case "mail":			s.channel="mail";						break;
		case "1Sriasd521Js":	s.channel="BROOM";						break;
	}
	dir.descend();
}while(dir.layer > 0);
}

//	cookieの読み込み関数
//	引数：c_word=名前
//	返却値：値
function CookieRead(c_word){
	if(typeof(c_word) == "undefined")			// cookieの有無の確認
		return "";								// cookieなしの場合、動作終了
		c_word = c_word + "=";
		c_data = "";
		s_cookie = document.cookie + ";";		// cookieの読み込み
		start = s_cookie.indexOf(c_word);		// 名前の検索
	// 名前と一致するものありの場合、値の取り出し
	if (start != -1){
		end = s_cookie.indexOf(";", start);
		c_data = unescape(s_cookie.substring(start + c_word.length, end));
	}	return c_data;}

/* by SBT
//サイトカタリスト用pageName変数の取得
if(s.pageName == undefined){	//pageName変数の有無の確認
		//pageName変数なしの場合、サイトカタリストのデータ取得用にURLを変更
		jcom_url = document.URL;
		//URLからクエリ文字列の削除
		if(jcom_url.indexOf("?",0) != -1){ jcom_url = jcom_url.substr(0,jcom_url.indexOf("?",0)); }
		//URLから「index.html」の削除
		if(jcom_url.indexOf("/index.html",0) != -1){ jcom_url = jcom_url.substr(0,jcom_url.indexOf("/index.html",0)); }
		//URLの「/」が最後の文字列の場合、削除
		if(jcom_url.lastIndexOf("/",jcom_url.length) + 1 == jcom_url.length){ jcom_url = jcom_url.substr(0,jcom_url.lastIndexOf("/",jcom_url.length)); }
	sc_page=jcom_url;
} else {
	//pageName変数ありのケース
	sc_page=s.pageName;
}
*/
/* by SBT
//加入者のページトラッキング
if(CookieRead("jcom_sc") == "jcom_member"){ s.prop7="member:"+sc_page; }

//キャンペーン閲覧者のページトラッキング
if(CookieRead("jcom_cm_sc") == "jcom_campaign"){ s.prop17="campaign:"+sc_page; }
*/

//「教えて！J:COM」対応
if(document.URL.indexOf("//www.jcom.co.jp/library/okwave/footer.html",0) != -1 && document.referrer.indexOf("//oshiete.jcom.co.jp",0) != -1){
	var Okweb_url = document.referrer;
	s.channel = "jcom_OKWave";
		//URLからクエリ文字列の削除
		if(Okweb_url.indexOf("?",0) != -1){ Okweb_url = Okweb_url.substr(0,Okweb_url.indexOf("?",0)); }
		//URLから「index.html」の削除
		if(Okweb_url.indexOf("/index.html",0) != -1){ Okweb_url = Okweb_url.substr(0,Okweb_url.indexOf("/index.html",0)); }
		//URLの「/」が最後の文字列の場合、削除
		if(Okweb_url.lastIndexOf("/",Okweb_url.length) + 1 == Okweb_url.length){ Okweb_url = Okweb_url.substr(0,Okweb_url.lastIndexOf("/",Okweb_url.length)); }
	s.pageName=Okweb_url;
}

//番組情報：サイトセクション用
s.prop13=s.channel;
s.prop48="sc_jcom.js";
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t();if(s_code)document.write(s_code)//--></script>
<!--/DO NOT REMOVE/-->
<!-- End SiteCatalyst code version: H.15.1. -->

