var strPath	= location.pathname;
var strUrl	= location.href.split("?");

var strPageName = strUrl[0];	/* s.pageName */
var strChannel  = "";			/* s.channel */ 

if( strPageName.charAt(strPageName.length-1) == "/" ) {
	strPath		= strPath + "index.html";
	strPageName = strPageName + "index.html";
}

s.eVar1	 = "";
s.eVar2	 = "";
s.eVar3	 = "";
s.eVar4	 = "";
s.eVar5	 = "";
s.eVar6	 = "";
s.eVar7	 = "";
s.eVar8	 = "";
s.eVar9	 = "";
s.eVar10 = "";
s.eVar11 = "";
s.eVar12 = "";
s.eVar13 = "";
s.eVar14 = "";


var strTitle = document.title;  
var blnCatalystFlg = true;

// error 404
if( strTitle.indexOf("404 Not Found",0) == 0 ) {
	blnCatalystFlg = false;
	s.pageType = "errorPage";
	var s_code=s.t();if(s_code)document.write(s_code);

// error 400 408 500 503
} else if( strTitle.indexOf("400 Bad Request",0) == 0 || strTitle.indexOf("408 Request Time-out",0) == 0 || 
	strTitle.indexOf("500 Internal Server Error",0) == 0 || strTitle.indexOf("503 Service Unavailable",0) == 0 ) {
	blnCatalystFlg = false;
	
// top
} else if( strPath.indexOf("/index.html",0) == 0 ) {
	strChannel = "ダンドリ_TOP";
	s.events = "event4";

// greeting
} else if( strPath.indexOf("/greeting/",0) == 0 ) {
	strChannel = "ダンドリ_引越しのご挨拶";

// scheduler
} else if( strPath.indexOf("/scheduler/",0) == 0 ) {
	strChannel = "ダンドリ_引越しスケジューラー";
	
	// calendar [scheduler]
	if( strPath.indexOf("/scheduler/calendar.html",0) == 0 ) {
		s.events = "event13";
	}

// shopping
} else if( strPath.indexOf("/shopping/",0) == 0 ) {
	strChannel = "ダンドリ_新居快適ショッピング";

// service
} else if( strPath.indexOf("/service/",0) == 0 ) {
	strChannel = "ダンドリ_お役立ちサービス";
	
// map
} else if( strPath.indexOf("/map/",0) == 0 ) {
	strChannel = "ダンドリ_引越し先マップ";

// checklist
} else if( strPath.indexOf("/checklist/",0) == 0 ) {
	strChannel = "ダンドリ_チェックリスト";
	
// geomancy
} else if( strPath.indexOf("/geomancy/",0) == 0 ) {
	strChannel = "ダンドリ_風水";
	
// contact
} else if( strPath.indexOf("/contact/",0) == 0 ) {
	strChannel = "ダンドリ_ご意見ご質問";
	
// form
} else if( strPath.indexOf("/form/",0) == 0 ) {

	// login.html [form]
	if( strPath.indexOf("/form/login.html",0) == 0 ) {
		s.events = "event5";
		
	// member_merit.html [form]
	} else if( strPath.indexOf("/form/member_merit.html",0) == 0 ) {
		strChannel = "ダンドリ_コンテンツその他";
		s.events = "event6";

	// registMail.html [form]
	} else if( strPath.indexOf("/form/registMail.html",0) == 0 ) {
		s.events = "event7";

	// tempAuth.html [form]
	} else if( strPath.indexOf("/form/tempAuth.html",0) == 0 ) {
		s.events = "event8";

	// registUserInfo.html [form]
	} else if( strPath.indexOf("/form/registUserInfo.html",0) == 0 ) {
		s.events = "event9:" + document.registForm.guid.value;

	// registTransferInfo.html [form]
	} else if( strPath.indexOf("/form/registTransferInfo.html",0) == 0 ) {
		s.events = "event10:" + document.registForm.guid.value;

	// registConfirm.html [form]
	} else if( strPath.indexOf("/form/registConfirm.html",0) == 0 ) {
		s.events = "event11:" + document.confirmForm.guid.value;
		// 性別
		s.eVar1 = document.confirmForm.sex.value;
		// 現住所郵便番号
		s.eVar2 = document.confirmForm.currentZip.value;
		// 引越先都道府県
		s.eVar3 = document.confirmForm.pref.value;
		// 引越先の住居タイプ
		s.eVar4 = document.confirmForm.domicileType.value;
		// 間取り
		s.eVar5 = document.confirmForm.arrangementType.value;
		// 現在のお住まいは賃貸契約ですか？
		s.eVar6 = isSelectedLease(document.confirmForm.additionalPropertyItemsSave.value);
		// ペット（犬）は飼っていますか？
		s.eVar7 = isSelectedPet(document.confirmForm.additionalPropertyItemsSave.value);
		// 車はお持ちですか？
		s.eVar8 = isSelectedCar(document.confirmForm.additionalPropertyItemsSave.value);
		// バイクはお持ちですか？
		s.eVar9 = isSelectedBike(document.confirmForm.additionalPropertyItemsSave.value);
		// お子様はいらっしゃいますか？
		s.eVar10 = isSelectedChild(document.confirmForm.additionalPropertyItemsSave.value);
		// ピアノはお持ちですか？
		s.eVar11 = isSelectedPiano(document.confirmForm.additionalPropertyItemsSave.value);
		// お引越は単身ですか？
		s.eVar12 = isSelectedSingle(document.confirmForm.additionalPropertyItemsSave.value);
		// 引越のきっかけ
		s.eVar13 = document.confirmForm.reason.value;
		// お知らせメール送信
		s.eVar14 = document.confirmForm.sendmailFlag.value;

	// registComplete.html [form]
	} else if( strPath.indexOf("/form/registComplete.html",0) == 0 ) {
		s.events = "event12";
	}
	
	
	
	
// othres 
} else {
	strChannel = "ダンドリ_コンテンツその他";
}

if( blnCatalystFlg ) {
	s.pageName = strPageName;
	s.eVar49 = s.pageName;
	s.channel = strChannel;	
	var s_code=s.t();if(s_code)document.write(s_code);
}

// 賃貸契約チェックボックスが選択されたかどうか判定
function isSelectedLease(value)
{
	if (value.charAt(338) == "E") {
		return 1;
	} else {
		return 0;
	}
}

// ペットチェックボックスが選択されたかどうか判定
function isSelectedPet(value)
{
	if (value.charAt(447) == "B") {
		return 1;
	} else {
		return 0;
	}
}

// 車チェックボックスが選択されたかどうか判定
function isSelectedCar(value)
{
	if (value.charAt(547) == "B") {
		return 1;
	} else {
		return 0;
	}
}

// バイクチェックボックスが選択されたかどうか判定
function isSelectedBike(value)
{
	if (value.charAt(629) == "Q") {
		return 1;
	} else {
		return 0;
	}
}

// 子供チェックボックスが選択されたかどうか判定
function isSelectedChild(value)
{
	if (value.charAt(718) == "E") {
		return 1;
	} else {
		return 0;
	}
}

// ピアノチェックボックスが選択されたかどうか判定
function isSelectedPiano(value)
{
	if (value.charAt(819) == "B") {
		return 1;
	} else {
		return 0;
	}
}

// 単身チェックボックスが選択されたかどうか判定
function isSelectedSingle(value)
{
	if (value.charAt(909) == "Q") {
		return 1;
	} else {
		return 0;
	}
}
