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";
}

var strTitle = document.title;  
var blnCatalystFlg = true;

s.eVar1	= "";
s.eVar2	= "";
s.eVar3	= "";

// 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 ) {
	s.events = "event4";

// step 
} else if( strPath.indexOf("/step/",0) == 0 ) {
	
	if( strPath.indexOf("/step/hikkoshi-o/showStep1.htm",0) == 0 ) {
		s.events = "event5:" + document.answerForm.requestId.value;
		
	} else if( strPath.indexOf("/step/hikkoshi-o/showConfirm.htm",0) == 0 ) {
		s.events = "event6:" + document.answerForm.requestId.value;
		
		s.eVar1	= document.answerForm.answer_Q_zip_A_1.value + "-" + document.answerForm.answer_Q_zip_A_2.value;
		s.eVar2	= document.answerForm.answer_Q_next_address_1.value;

	} else if( strPath.indexOf("/step/hikkoshi-o/showThanks.htm",0) == 0 ) {
		var objParam = parseParam();
		var strRequestId = objParam["requestId"];
		s.events = "event7:" + strRequestId;
		s.eVar3 = strRequestId;
	}

// area
} else if( strPath.indexOf("/area/",0) == 0 ) {
	s.events = "event8";

// others 
} else {

}

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 parseParam() {
	var returnObj = {};
	var strUrl = document.location.search;
	if (strUrl==""||strUrl==null) return null;
	var strParam = strUrl.split('?')[1];
	var params = strParam.split('&');
	for(var i=0;i<params.length;i++){
		var kv = params[i].split('=');
		var key = kv[0];
		var value = kv[1];
		returnObj[key] = value;
	}
	return returnObj;
}