var gService = false;
var gTimeZone = 9;

// Code section for Enable First-Party Cookie Tracking
function dcsCookie(){
	if (typeof(dcsOther)=="function"){
		dcsOther();
	}
	else if (typeof(dcsPlugin)=="function"){
		dcsPlugin();
	}
	else if (typeof(dcsFPC)=="function"){
		dcsFPC(gTimeZone);
	}
}
function dcsGetCookie(name){
	var pos=document.cookie.indexOf(name+"=");
	if (pos!=-1){
		var start=pos+name.length+1;
		var end=document.cookie.indexOf(";",start);
		if (end==-1){
			end=document.cookie.length;
		}
		return unescape(document.cookie.substring(start,end));
	}
	return null;
}
function dcsGetCrumb(name,crumb){
	var aCookie=dcsGetCookie(name).split(":");
	for (var i=0;i<aCookie.length;i++){
		var aCrumb=aCookie[i].split("=");
		if (crumb==aCrumb[0]){
			return aCrumb[1];
		}
	}
	return null;
}
function dcsGetIdCrumb(name,crumb){
	var cookie=dcsGetCookie(name);
	var id=cookie.substring(0,cookie.indexOf(":lv="));
	var aCrumb=id.split("=");
	for (var i=0;i<aCrumb.length;i++){
		if (crumb==aCrumb[0]){
			return aCrumb[1];
		}
	}
	return null;
}
function dcsFPC(offset){
	if (typeof(offset)=="undefined"){
		return;
	}
	var name=gFpc;
	var dCur=new Date();
	dCur.setTime(dCur.getTime()+(dCur.getTimezoneOffset()*60000)+(offset*3600000));
	var dExp=new Date(dCur.getTime()+315360000000);
	var dSes=new Date(dCur.getTime());
	if (document.cookie.indexOf(name+"=")!=-1){
		var id=dcsGetIdCrumb(name,"id");
		var lv=parseInt(dcsGetCrumb(name,"lv"));
		var ss=parseInt(dcsGetCrumb(name,"ss"));
		if ((id==null)||(id=="null")||isNaN(lv)||isNaN(ss)){
			return;
		}
		WT.co_f=id;
		var dLst=new Date(lv);
		dSes.setTime(ss);
		if ((dCur.getTime()>(dLst.getTime()+1800000))||(dCur.getTime()>(dSes.getTime()+28800000))){
			dSes.setTime(dCur.getTime());
			WT.vt_f_s="1";
		}
		if ((dCur.getDay()!=dLst.getDay())||(dCur.getMonth()!=dLst.getMonth())||(dCur.getYear()!=dLst.getYear())){
			WT.vt_f_d="1";
		}
	}
	else{
		var tmpname=name+"_TMP=";
		document.cookie=tmpname+"1";
		if (document.cookie.indexOf(tmpname)!=-1){
			document.cookie=tmpname+"; expires=Thu, 01-Jan-1970 00:00:01 GMT";
			if ((typeof(gWtId)!="undefined")&&(gWtId!="")){
				WT.co_f=gWtId;
			}
			else if ((typeof(gTempWtId)!="undefined")&&(gTempWtId!="")){
				WT.co_f=gTempWtId;
				WT.vt_f="1";
			}
			else{
				WT.co_f="2";
				var cur=dCur.getTime().toString();
				for (var i=2;i<=(32-cur.length);i++){
					WT.co_f+=Math.floor(Math.random()*16.0).toString(16);
				}
				WT.co_f+=cur;
				WT.vt_f="1";
			}
			if (typeof(gWtAccountRollup)=="undefined"){
				WT.vt_f_a="1";
			}
			WT.vt_f_s="1";
			WT.vt_f_d="1";
		}
		else{
			WT.vt_f="2";
			WT.vt_f_a="2";
			return;
		}
	}
	WT.co_f=escape(WT.co_f);
	WT.vt_sid=WT.co_f+"."+dSes.getTime();
	var expiry="; expires="+dExp.toGMTString();
	document.cookie=name+"="+"id="+WT.co_f+":lv="+dCur.getTime().toString()+":ss="+dSes.getTime().toString()+expiry+"; path=/"+(((typeof(gFpcDom)!="undefined")&&(gFpcDom!=""))?("; domain="+gFpcDom):(""));
}

// Code section for Enable SmartView Transition Page tracking
function dcsTP(){
	var name="WT_DC";
	var expiry="; expires=Thu, 31-Dec-2020 08:00:00 GMT";
	var path="; path=/";
	var domain="";
	if ((document.cookie.indexOf(name+"=")!=-1)&&(dcsGetCrumb(name,"tsp")=="1")){
		WT.ttp="1";
	}
	if (dcsGetMeta("SmartView_Page")=="1"){
		WT.tsp="1";
		document.cookie=name+"=tsp=1"+expiry+path+domain;
	}
	else{
		document.cookie=name+"=; expires=Sun, 1-Jan-1995 00:00:00 GMT;"+path+domain;
	}
}
function dcsGetMeta(name){
	var elems;
	if (document.all){
		elems=document.all.tags("meta");
	}
	else if (document.documentElement){
		elems=document.getElementsByTagName("meta");
	}
	if (typeof(elems)!="undefined"){
		for (var i=1;i<=elems.length;i++){
			var meta=elems.item(i-1);
			if (meta.name&&(meta.name.indexOf(name)==0)){
				return meta.content;
				break;
			}
		}
	}
	return null;
}

// Code section for Use the new first-party cookie generated with this tag.
function dcsAdv(){
	dcsFunc("dcsET");
	dcsFunc("dcsCookie");
	dcsFunc("dcsAdSearch");
	dcsFunc("dcsTP");
}

var gImages=new Array;
var gIndex=0;
var DCS=new Object();
var WT=new Object();
var DCSext=new Object();
var gQP=new Array();
var gI18n=true;

if (window.RegExp){
	var RE={"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g,"%22":/\"/g,"%7F":/\x7F/g,"%A0":/\xA0/g,"%2520":/%250A/g};
	var I18NRE={"%25":/\%/g};
}

// Code section for Enable Event Tracking
function dcsParseSvl(sv){
	sv=sv.split(" ").join("");
	sv=sv.split("\t").join("");
	sv=sv.split("\n").join("");
	var pos=sv.toUpperCase().indexOf("WT.SVL=");
	if (pos!=-1){
		var start=pos+8;
		var end=sv.indexOf('"',start);
		if (end==-1){
			end=sv.indexOf("'",start);
			if (end==-1){
				end=sv.length;
			}
		}
		return sv.substring(start,end);
	}
	return "";
}
function dcsIsOnsite(host){
	var doms="www.brother.co.jp,solutions.brother.co.jp,regist.brother.jp,www.regist.brother-hanbai.co.jp";
	var aDoms=doms.split(',');
	for (var i=0;i<aDoms.length;i++){
		if (host.indexOf(aDoms[i])!=-1){
			return 1;
		}
	}
	return 0;
}
function dcsIsHttp(e){
	return (e.href&&e.protocol&&(e.protocol.indexOf("http")!=-1))?true:false;
}

var gHref="";
// 2008.08.12 mod start
//function dcsSaveHref(evt){
//	if (evt.preventDefault&&evt.target.href){
//		evt.preventDefault();
//		gHref=evt.target.href;
//	}
//}
//function dcsLoadHref(evt){
//	if (gHref.length>0){
//		window.location=gHref;
//		gHref="";
//	}
//}
var gFrame="";
function dcsSaveHref(evt){
	if (evt.preventDefault){
		if (evt.target.target){
			gFrame=evt.target.target.toLowerCase();
			if (gFrame=="_top"||gFrame=="_parent"){
			} else if (gFrame=="_self"){
				gFrame="";
			} else if (gFrame=="_blank"||!window.top[gFrame]){
				gFrame="";
				return;
			}
		}
		if (evt.target.href){
			evt.preventDefault();
			gHref=evt.target.href;
		} else {
			gFrame="";
		}
	}
}
function dcsLoadHref(evt){
	if (gHref.length>0){
		if (gFrame.length>0){
			window.open(gHref,gFrame);
		}else{
			window.location=gHref;
		}
		gHref=gFrame="";
	}
}
// 2008.08.12 mod end
function dcsEvt(evt,tag){
	var e=evt.target||evt.srcElement;
	while (e.tagName&&(e.tagName!=tag)){
		e=e.parentElement||e.parentNode;
	}
	return e;
}
function dcsBind(event,func){
	if ((typeof(window[func])=="function")&&document.body){
		if (document.body.addEventListener){
			document.body.addEventListener(event, window[func], true);
		}
		else if(document.body.attachEvent){
			document.body.attachEvent("on"+event, window[func]);
		}
	}
}
function dcsET(){
	dcsBind("click","dcsAnchor");
	dcsBind("click","dcsOffsite");
	dcsBind("mousedown","dcsDownload");
	dcsBind("keypress","dcsDownload");
	dcsBind("mousedown","dcsRightClick");
}

function dcsMultiTrack(){
	if (arguments.length%2==0){
		for (var i=0;i<arguments.length;i+=2){
			if (arguments[i].indexOf('WT.')==0){
				WT[arguments[i].substring(3)]=gI18n?dcsEscape(dcsEncode(arguments[i+1]),I18NRE):arguments[i+1];
			}
			else if (arguments[i].indexOf('DCS.dcsref')==0){
				DCS[arguments[i].substring(4)]=gI18n?dcsEscape(arguments[i+1],I18NRE):arguments[i+1];
			}
			else if (arguments[i].indexOf('DCS.dcsqry')==0){
				DCS[arguments[i].substring(4)]=gI18n?queryEncode(arguments[i+1]):arguments[i+1];
			}
			else if (arguments[i].indexOf('DCS.')==0){
				DCS[arguments[i].substring(4)]=arguments[i+1];
			}
			else if (arguments[i].indexOf('DCSext.')==0){
				DCSext[arguments[i].substring(7)]=gI18n?dcsEscape(dcsEncode(arguments[i+1]),I18NRE):arguments[i+1];
			}
		}
		var dCurrent=new Date();
		DCS.dcsdat=dCurrent.getTime();
		dcsFunc("dcsCookie");
		dcsTag();
	}
}

function dcsOffsite(evt){
	evt=evt||(window.event||"");
	if (evt){
		var e=dcsEvt(evt,"A");
		var host=e.hostname;
		if (host&&!dcsIsOnsite(host)){
			//var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):"";
			var qry="";
			var path=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
			gHref=gFrame=""; // 2008.08.12 add
			dcsSaveHref(evt);
			dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsqry",qry,"WT.ti","Offsite:"+host+path,"WT.os","1");
			DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.os="";
		}
	}
}

function dcsDownload(evt){
	evt=evt||(window.event||"");
	var agt=navigator.userAgent.toLowerCase();
	var major=parseInt(navigator.appVersion);
	var nn=((agt.indexOf("mozilla")!=-1)&&(agt.indexOf("compatible")==-1));
	var nn_e=(nn&&(major>=4));
	var click = false;
	if (nn_e){
		// 2008.08.12 mod start
		//if (typeof(evt.keyCode) == 'undefined') {
		//	if (evt.which == 1) {
		//		click = true;
		//	}
		//} else {
		//	if (evt.keyCode == 13) {
		//		click = true;
		//	}
		//}
		if (evt.keyCode&&evt.keyCode>0) {
			if (evt.keyCode == 13) {
				click = true;
			}
		} else {
			if (evt.which == 1) {
				click = true;
			}
		}
		// 2008.08.12 mod end
	} else {
		// 2008.08.12 mod start
		//if (evt.keyCode == 13) {
		//	click = true;
		//} else if (typeof(evt.button) != 'undefined') {
		//	if (evt.button == 1) {
		//		click = true;
		//	}
		//}
		if (evt.keyCode&&evt.keyCode>0) {
			if (evt.keyCode == 13) {
				click = true;
			}
		} else if (evt.which&&evt.which>0) {
			if (evt.which == 1) {
				click = true;
			}
		} else {
			if (evt.button == 1) {
				click = true;
			}
		}
		// 2008.08.12 mod end
	}
	if (click) {
		var e=dcsEvt(evt,"A");
		var host=e.hostname;
		if (host&&dcsIsOnsite(host)){
			var path=(e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname;
			if (dcsAllowTypes(path)){
				// 2008.08.12 mod start
				//gHref="";
				//dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsref",window.location.href,"DCS.dcsqry",e.search||"","WT.ti",dcsDownloadTitle(e,path),"WT.dl","1");
				//DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl="";
				gHref=gFrame="";
				dcsSaveHref(evt);
				if (path.indexOf("/pub/j-ism/pdf/")==0){
					//mod start 2008.09.14
					//dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsref",window.location.href,"DCS.dcsqry",e.search||"","WT.ti",dcsDownloadTitle(e,path),"WT.dl","1","WT.cg_n","ISM","WT.si_n","CATTRN_ISM","WT.si_p",gCatPos[5]);
					dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsref",window.location.href,"DCS.dcsqry",e.search||"","WT.ti",dcsDownloadTitle(e,path),"WT.dl","1","WT.cg_n","ISM","WT.si_n","CATTRN_ISM","WT.si_p",gCatPos[5],"DCSext.WTCONVPAGE","1");
					//mod end 2008.09.14
				} else {
					dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsref",window.location.href,"DCS.dcsqry",e.search||"","WT.ti",dcsDownloadTitle(e,path),"WT.dl","1");
				}
				//DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=WT.cg_n=WT.si_n=WT.si_p="";
				DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=WT.cg_n=WT.si_n=WT.si_p=DCSext.WTCONVPAGE="";
				// 2008.08.12 mod end
			}
		}
	}
}

function dcsRightClick(evt){
	evt=evt||(window.event||"");
	if (evt){
		var btn=evt.which||evt.button;
		if (btn!=1){
			var e=dcsEvt(evt,"A");
			var host=e.hostname;
			if (host&&dcsIsOnsite(host)){
				var path=(e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname;
				if (dcsAllowTypes(path)){
					// 2008.08.12 mod start
					//gHref="";
					//dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsref",window.location.href,"DCS.dcsqry",e.search||"","WT.ti",dcsDownloadTitle(e,path),"WT.dl","1","WT.rc","1");
					//DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=WT.rc="";
					gHref=gFrame="";
					if (path.indexOf("/pub/j-ism/pdf/")==0){
						//mod start 2008.09.14
						//dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsref",window.location.href,"DCS.dcsqry",e.search||"","WT.ti",dcsDownloadTitle(e,path),"WT.dl","1","WT.rc","1","WT.cg_n","ISM","WT.si_n","CATTRN_ISM","WT.si_p",gCatPos[5]);
						dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsref",window.location.href,"DCS.dcsqry",e.search||"","WT.ti",dcsDownloadTitle(e,path),"WT.dl","1","WT.rc","1","WT.cg_n","ISM","WT.si_n","CATTRN_ISM","WT.si_p",gCatPos[5],"DCSext.WTCONVPAGE","1");
						//mod end 2008.09.14
					} else {
						dcsMultiTrack("DCS.dcssip",host,"DCS.dcsuri",path,"DCS.dcsref",window.location.href,"DCS.dcsqry",e.search||"","WT.ti",dcsDownloadTitle(e,path),"WT.dl","1","WT.rc","1");
					}
					DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=WT.rc=WT.cg_n=WT.si_n=WT.si_p="";
					// 2008.08.12 mod end
				}
			}
		}
	}
}

function dcsAllowTypes(path){
	var types="pdf";
	var ex_idx_from=path.lastIndexOf(".");
	if (ex_idx_from!=-1){ // 2008.08.12 add
		var ex_idx_to=path.indexOf("/",ex_idx_from);
		ex_idx_to=(ex_idx_to==-1)?path.length:ex_idx_to;
		if (path&&types.indexOf(path.substring(ex_idx_from+1,ex_idx_to))!=-1){
			return true;
		}
	} // 2008.08.12 add
	return false;
}

function dcsDownloadTitle(e,path){
	if (!e.firstChild.tagName){
		return e.innerHTML||"";
	} else if (e.firstChild.alt!=""){
		return e.firstChild.alt;
	} else {
		return "Download:"+((path.indexOf("/")!=0)?"/"+path:path);
	}
}

// Add customizations here

//modify 2008.08.12
//var gCatPos=["CATTOP","PRDTOP","PRDDTL","PRDABT"];
//modify 2008.08.18
//var gCatPos=["CATTOP","PRDTOP","PRDDTL","PRDABT","PRDLUP","CATADL"];
//var gCatPos=["CATTOP","PRDTOP","PRDDTL","PRDABT","PRDLUP","CATADL","SPECDTL","CONTACTTOP","EXAMPLETOP","FAQTOP","TAPETOP","TAPEDTL","PRDMOVIESAMPLETOP","HOUJINLABEL","HOUJINMOBILE"];
var gCatPos=["CATTOP","PRDTOP","PRDDTL","PRDABT","PRDLUP","CATADL","SPECDTL","CONTACTTOP","EXAMPLETOP","FAQTOP","TAPETOP","TAPEDTL","PRDMOVIESAMPLETOP","HOUJINLABEL","HOUJINMOBILE","SHOPSEARCH","HSMSERVICE"];
var gCatePosHoujin=["HOUJIN_TOP","SOLU_PRINT","SOLU_LABEL","SOLU_QUICK","SOLU_MOBILE","SOLU_STAMP","SOLU_RFID","BUZ_TOP","BUZ_DTL_1","BUZ_DTL_2","BUZ_DTL_3","BUZ_DTL_4","BUZ_DTL_5","BUZ_DTL_6","BUZ_DTL_7","BUZ_DTL_8","SOLU_PRINT_DTL","SOLU_LABEL_DTL","SOLU_QUICK_DTL","SOLU_MOBILE_DTL","SOLU_STAMP_DTL","SOLU_RFID_DTL","CONTACT_LIST"];
var gCateMymioSpl=["TOP","DL_TOP","CRAFT_TOP","CRAFT_DETAIL","CRAFT_DETAIL_DL","PBOOK_TOP","PBOOK_DL","ITEM_TOP","ITEM_DL","CARD_TOP","CARD_DETAIL","CARD_DETAIL_DL","MAO_TOP","MEISHI_TOP","MEISHI_CREATE","CARD_ORG_TOP","CARD_ORG_DETAIL","CARD_ORG_DETAIL_DL","CARD_EVT_TOP","CARD_EVT_DETAIL","CARD_EVT_DETAIL_DL","CARD_SEASON_TOP","CARD_SEASON_DTEAL","CARD_SEASON_DTEAL_DL","MAO_DL_TOP","MAO_DL_BLOG","MAO_DL_WALLPAPER","MAO_DL_SCRSAVER","MAO_CM_TOP","MAO_CM_DL","MAO_NEWS_INFO","MAO_PROFILE","MAO_DIARY"];
var gCateCorp=["CJCORP","CJCSR","CJECO","CJIR","CJNEWS","CJRCT","CJBCS","CJBWORKS","CJMANABURA"];


function dcsDetermineCategory(path){
	var cate="";
	var pReg,pMatch,pPart;
	if (path.indexOf("/product/mymio/")==0){
		cate="MYMIO";
		pReg=new RegExp("^(/product/mymio/info/.+?/)");
		if (path=="/product/mymio/"||path=="/product/mymio/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("feature/")==0||pPart.indexOf("spec/")==0||pPart.indexOf("photo/")==0||pPart.indexOf("accessory/")==0){
				cate+=";"+gCatPos[2];
				dcsSetConversion();
			}
		}
	} else if (path.indexOf("/product/printer/")==0){
		//modify 2008.08.08
		//cate="JUSTIO";
		cate="JUSTIO_PRINTER";

		pReg=new RegExp("^(/product/printer/info/.+?/)");
		if (path=="/product/printer/"||path=="/product/printer/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("/")>=0){
				cate+=";"+gCatPos[2];
				dcsSetConversion();
			}
		}
	} else if (path.indexOf("/product/mfc/")==0){
		//modify 2008.08.08
		//cate="JUSTIO";
		cate="JUSTIO_MFC";

		pReg=new RegExp("^(/product/mfc/info/.+?/)");
		if (path=="/product/mfc/"||path=="/product/mfc/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("/")>=0){
				cate+=";"+gCatPos[2];
				dcsSetConversion();
			}
		}
	} else if (path.indexOf("/product/inkmfc/")==0){
		//modify 2008.08.08
		//cate="JUSTIO";
		cate="JUSTIO_INKMFC";

		pReg=new RegExp("^(/product/inkmfc/info/.+?/)");
		if (path=="/product/inkmfc/"||path=="/product/inkmfc/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("/")>=0){
				cate+=";"+gCatPos[2];
				dcsSetConversion();
			}
		}
	} else if (path.indexOf("/product/hsm/")==0){
		cate="HSM";
		pReg=new RegExp("^(/product/hsm/(embropc|professional|practical)/.+?/)");
		if (path=="/product/hsm/"||path=="/product/hsm/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (path=="/product/hsm/service/"||path=="/product/hsm/service/index.htm") {
			cate+=";"+gCatPos[16];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("/")>=0){
				cate+=";"+gCatPos[2];
			}
		}
	// add 2008.09.09 start
	} else if (path=="/jp/hsm/shops/index_shp.htm"){
		cate="HSM";
		cate+=";"+gCatPos[15];
		dcsSetConversion();
	// add 2008.09.09 end
	} else if (path.indexOf("/product/ism/")==0){
		cate="ISM";
		if (path=="/product/ism/"||path=="/product/ism/index.htm") {
			cate+=";"+gCatPos[0];
		// 2008.08.12 add start
		} else if (path.indexOf("/product/ism/lineup/")==0) {
			cate+=";"+gCatPos[4];
		}
		// 2008.08.12 add end
	} else if (path.indexOf("/product/garment/")==0){
		cate="GARMENT";
		pReg=new RegExp("^(/product/garment/info/.+?/)");
		if (path=="/product/garment/"||path=="/product/garment/index.htm") {
			cate+=";"+gCatPos[0];

		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("/")>=0){
				cate+=";"+gCatPos[2];
			}
//		} else if (path=="/product/garment/info/gt541/"||path=="/product/garment/info/gt541/index.htm"){
//			cate+=";"+gCatPos[1];
//		} else if (path.indexOf("/product/garment/info/gt541/feature/")==0||path.indexOf("/product/garment/info/gt541/spec/")==0||path.indexOf("/product/garment/info/gt541/accessory/")==0){
//			cate+=";"+gCatPos[2];
		// 2008.08.19 add start
		} else if (path=="/product/garment/faq/"||path=="/product/garment/faq/index.htm"){
			cate+=";"+gCatPos[9];
			dcsSetConversion();
		}
		// 2008.08.19 add end
	// 2008.08.19 add start
	} else if (path.indexOf("/product/support_info/garment/")==0){
		cate="GARMENT";
		if (path=="/product/support_info/garment/contact/"||path=="/product/support_info/garment/contact/index.htm") {
			cate+=";"+gCatPos[7];
			dcsSetConversion();
		}
	// 2008.08.19 add end
	} else if (path.indexOf("/product/mwprinter/")==0){
		cate="MWPRINTER";
		pReg=new RegExp("^(/product/mwprinter/info/.+?/)");
		if (path=="/product/mwprinter/"||path=="/product/mwprinter/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("/")>=0){
				cate+=";"+gCatPos[2];
			}
		}
	// 2008.08.22 add start
	} else if (path.indexOf("/product/houjin/mobile/")==0) {
		cate="MWPRINTER";
		cate+=";"+gCatPos[14];
		if (path=="/product/houjin/mobile/"||path=="/product/houjin/mobile/index.htm"){
			cate+=";HOUJIN;"+gCatePosHoujin[4];
		} else {
			cate+=";HOUJIN;"+gCatePosHoujin[19];
		}
		dcsSetConversion();
	// 2008.08.22 add end
	} else if (path.indexOf("/product/labelprinter/")==0){
		cate="LABELPRINTER";
		pReg=new RegExp("^(/product/labelprinter/info/.+?/)");
		if (path=="/product/labelprinter/"||path=="/product/labelprinter/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("/")>=0){
				cate+=";"+gCatPos[2];
			}
		} 
	// 2008.08.22 add start
	} else if (path.indexOf("/product/houjin/labeling/")==0||path.indexOf("/product/houjin/quicklabel/")==0||path.indexOf("/product/houjin/rfid/")==0) {
		cate="LABELPRINTER";
		cate+=";"+gCatPos[13];
		if (path.indexOf("/product/houjin/labeling/")==0){
			if (path=="/product/houjin/labeling/"||path=="/product/houjin/labeling/index.htm"){
				cate+=";HOUJIN;"+gCatePosHoujin[2];
			} else {
				cate+=";HOUJIN;"+gCatePosHoujin[17];
			}
		} else if (path.indexOf("/product/houjin/quicklabel/")==0){
			if (path=="/product/houjin/quicklabel/"||path=="/product/houjin/quicklabel/index.htm"){
				cate+=";HOUJIN;"+gCatePosHoujin[3];
			} else {
				cate+=";HOUJIN;"+gCatePosHoujin[18];
			}
		} else if (path.indexOf("/product/houjin/rfid/")==0){
			if (path=="/product/houjin/rfid/"||path=="/product/houjin/rfid/index.htm"){
				cate+=";HOUJIN;"+gCatePosHoujin[6];
			} else {
				cate+=";HOUJIN;"+gCatePosHoujin[21];
			}
		}
		dcsSetConversion();
	// 2008.08.22 add end
	} else if (path.indexOf("/product/stamp/")==0){
		cate="STAMP";
		pReg=new RegExp("^(/product/stamp/info/.+?/)");
		if (path=="/product/stamp/"||path=="/product/stamp/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			// 2008.08.19 add start
			} else if (pPart=="example/"||pPart=="example/index.htm"){
				cate+=";"+gCatPos[8];
				dcsSetConversion();
			} else if (pPart.indexOf("/")>=0){
				cate+=";"+gCatPos[2];
			}
			// 2008.08.19 add end
		}
	} else if (path.indexOf("/product/labelwriter/")==0){
		cate="LABELWRITER";
		pReg=new RegExp("^(/product/labelwriter/info/.+?/)");
		if (path=="/product/labelwriter/"||path=="/product/labelwriter/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			} else if (pPart.indexOf("feature/")==0||pPart.indexOf("spec/")==0||pPart.indexOf("photo/")==0||pPart.indexOf("accessory/")==0){
				cate+=";"+gCatPos[2];
				dcsSetConversion();
			}
		}
		// 2008.08.21 add start
		else if (path=="/product/labelwriter/tape/index.htm") {
			cate+=";"+gCatPos[10];
		//} else if (path=="/product/labelwriter/tape/.+?/index.htm") {
		} else {
			pReg=new RegExp("^(/product/labelwriter/tape/.+?/)");
			if (pMatch=path.match(pReg)){
				pPart=path.substr(pMatch[0].length);
				if (pPart==""||pPart=="index.htm"){
					cate+=";"+gCatPos[11];
					dcsSetConversion();
				}
			}
		}
		// 2008.08.21 add start
	} else if (path.indexOf("/product/machine/")==0){
		cate="MACHINE";
		pReg=new RegExp("^(/product/machine/info/.+?/)");
		if (path=="/product/machine/"||path=="/product/machine/index.htm") {
			cate+=";"+gCatPos[0];
		} else if (pMatch=path.match(pReg)){
			pPart=path.substr(pMatch[0].length);
			if (pPart==""||pPart=="index.htm"){
				cate+=";"+gCatPos[1];
			// 2008.08.21 del start
			//} else if (pPart=="/cnc/"||pPart=="/cnc/index.htm"||pPart=="/wire/"||pPart=="/wire/index.htm"){
			//	cate+=";"+gCatPos[3];
			// 2008.08.21 del end
			// 2008.08.18 add start
			} else if (pPart=="spec/"||pPart=="spec/index.htm"){
				cate+=";"+gCatPos[6];
				dcsSetConversion();
			}
			// 2008.08.18 add end
		} 
		// 2008.08.21 add start
		else if (path=="/product/machine/cnc/"||path=="/product/machine/cnc/index.htm"||path=="/product/machine/wire/"||path=="/product/machine/wire/index.htm") {
			cate+=";"+gCatPos[3];
		}
		// 2008.08.21 add end
		// 2008.08.21 add start
		else if (path=="/product/machine/movie/index.htm"||path=="/product/machine/cnc/sample/index.htm") {
			cate+=";"+gCatPos[12];
		}
		// 2008.08.21 add end
	} else if (path=="/product/houjin/"||path=="/product/houjin/index.htm"){
		cate="HOUJIN";
		cate+=";"+gCatePosHoujin[0];
	} else if (path.indexOf("/product/houjin/printing/")==0){
		cate="HOUJIN";
		if (path=="/product/houjin/printing/"||path=="/product/houjin/printing/index.htm"){
			cate+=";"+gCatePosHoujin[1];
		} else {
			cate+=";"+gCatePosHoujin[16];
		}
	} else if (path.indexOf("/product/houjin/stamp/")==0){
		cate="HOUJIN";
		if (path=="/product/houjin/stamp/"||path=="/product/houjin/stamp/index.htm"){
			cate+=";"+gCatePosHoujin[5];
		} else {
			cate+=";"+gCatePosHoujin[20];
		}
	} else if (path.indexOf("/product/houjin/business/")==0){
		cate="HOUJIN";
		if (path=="/product/houjin/business/"||path=="/product/houjin/business/index.htm"){
			cate+=";"+gCatePosHoujin[7];
		} else if (path=="/product/houjin/business/business1/"||path=="/product/houjin/business/business1/index.htm"){
			cate+=";"+gCatePosHoujin[8];
		} else if (path=="/product/houjin/business/business2/"||path=="/product/houjin/business/business2/index.htm"){
			cate+=";"+gCatePosHoujin[9];
		} else if (path=="/product/houjin/business/business3/"||path=="/product/houjin/business/business3/index.htm"){
			cate+=";"+gCatePosHoujin[10];
		} else if (path=="/product/houjin/business/business4/"||path=="/product/houjin/business/business4/index.htm"){
			cate+=";"+gCatePosHoujin[11];
		} else if (path=="/product/houjin/business/business5/"||path=="/product/houjin/business/business5/index.htm"){
			cate+=";"+gCatePosHoujin[12];
		} else if (path=="/product/houjin/business/business6/"||path=="/product/houjin/business/business6/index.htm"){
			cate+=";"+gCatePosHoujin[13];
		} else if (path=="/product/houjin/business/business7/"||path=="/product/houjin/business/business7/index.htm"){
			cate+=";"+gCatePosHoujin[14];
		} else if (path=="/product/houjin/business/business8/"||path=="/product/houjin/business/business8/index.htm"){
			cate+=";"+gCatePosHoujin[15];
		}
	} else if (path=="/product/houjin/contact/index.htm"||path=="/product/houjin/contact/"){
		cate="HOUJIN";
		cate+=";"+gCatePosHoujin[22];
//add-s 2009.08.28
	} else if (path.indexOf("/special/justio/")==0){
		cate="JUSTIO_SPL;JUSTIO_SPL_TOP";
//add-e 2009.08.28
	} else if (path.indexOf("/jp/mymio/special/")==0){
		cate="MYMIO_SPL";
		if (path=="/jp/mymio/special/index.html"||path=="/jp/mymio/special/"){
			cate+="_TOP;"+gCateMymioSpl[0];
		} else if (path=="/jp/mymio/special/download/index.html"||path=="/jp/mymio/special/download/"){
			cate+="_DL;"+gCateMymioSpl[1];
		} else if (path.indexOf("/jp/mymio/special/download/craft/")==0){
			pReg=new RegExp("^(/jp/mymio/special/download/craft/.+?/.+?/)");
			if (path=="/jp/mymio/special/download/craft/index.html"||path=="/jp/mymio/special/download/craft/"){
				cate+="_DL;"+gCateMymioSpl[2];
			} else if (pMatch=path.match(pReg)){
				pPart=path.substr(pMatch[0].length);
				if (pPart==""||pPart=="index.html"){
					cate+="_DL;"+gCateMymioSpl[3];
				}
			}

		} else if (path.indexOf("/jp/mymio/special/download/p_book/")==0){
			if (path=="/jp/mymio/special/download/p_book/index.html"||path=="/jp/mymio/special/download/p_book/"){
				cate+="_DL;"+gCateMymioSpl[5];
			}

		} else if (path.indexOf("/jp/mymio/special/download/item/")==0){
			if (path=="/jp/mymio/special/download/item/index.html"||path=="/jp/mymio/special/download/item/"){
				cate+="_DL;"+gCateMymioSpl[7];
			}

		} else if (path.indexOf("/jp/mymio/special/download/")==0){
			var orgpat = "(birthday|moving|thank_you|marriage.*|love|welcome|baby)";
			pReg=new RegExp("^(/jp/mymio/special/download/"+orgpat+"/lst[0-9][0-9]\.html)");
			if (pMatch=path.match(pReg)){
				cate+="_DL;"+gCateMymioSpl[15];
			}
			pReg=new RegExp("^(/jp/mymio/special/download/"+orgpat+"/dtl.+?\.html)");
			if (pMatch=path.match(pReg)){
				cate+="_DL;"+gCateMymioSpl[16];
			}

			var evtpat = "(newyear_bs|christmas|helloween|summer|mothers_day|fathers_day|kanchu|valentine|congratulation.*)";
			pReg=new RegExp("^(/jp/mymio/special/download/"+evtpat+"/lst[0-9][0-9]\.html)");
			if (pMatch=path.match(pReg)){
				cate+="_DL;"+gCateMymioSpl[18];
			}
			pReg=new RegExp("^(/jp/mymio/special/download/"+evtpat+"/dtl.+?\.html)");
			if (pMatch=path.match(pReg)){
				cate+="_DL;"+gCateMymioSpl[19];
			}

			var seapat = "(card_spring|card_summer|card_autumn|card_winter)";
			pReg=new RegExp("^(/jp/mymio/special/download/"+seapat+"/lst[0-9][0-9]\.html)");
			if (pMatch=path.match(pReg)){
				cate+="_DL;"+gCateMymioSpl[21];
			}
			pReg=new RegExp("^(/jp/mymio/special/download/"+seapat+"/dtl.+?\.html)");
			if (pMatch=path.match(pReg)){
				cate+="_DL;"+gCateMymioSpl[22];
			}

		} else if (path=="/jp/mymio/special/mao/index.html"||path=="/jp/mymio/special/mao/"){
				cate+="_MAO;"+gCateMymioSpl[12];
		} else if (path=="/Mymio/meishi/index.html"||path=="/Mymio/meishi/"){
			cate+="_MEISHI;"+gCateMymioSpl[13];
		} else if (path=="/Mymio/meishi/cgi/index.cgi"||path=="/Mymio/meishi/cgi/"){
			cate+="_MEISHI;"+gCateMymioSpl[14];
		}
	} else if (path.indexOf("/corporate/")==0){
		cate=gCateCorp[0];
		cate=cate+";SIN_"+gCateCorp[0];
	
	} else if (path.indexOf("/csr/")==0){
		cate=gCateCorp[1];
		cate=cate+";SIN_"+gCateCorp[1];
	
	} else if (path.indexOf("/eco/")==0){
		cate=gCateCorp[2];
		cate=cate+";SIN_"+gCateCorp[2];
	
	} else if (path.indexOf("/investor/")==0){
		cate=gCateCorp[3];
		cate=cate+";SIN_"+gCateCorp[3];
	
	} else if (path.indexOf("/news/")==0){
		cate=gCateCorp[4];
		cate=cate+";SIN_"+gCateCorp[4];
	
	} else if (path.indexOf("/r/")==0){
		cate=gCateCorp[5];
		cate=cate+";SIN_"+gCateCorp[5];
	
	} else if (path.indexOf("/bcs/")==0){
		cate=gCateCorp[6];
		cate=cate+";SIN_"+gCateCorp[6];
	
	} else if (path.indexOf("/b_works/")==0){
		cate=gCateCorp[7];
		cate=cate+";SIN_"+gCateCorp[7];
	
	} else if (path.indexOf("/jp/manabura/")==0){
		cate=gCateCorp[8];
		cate=cate+";SIN_"+gCateCorp[8];
	
	}

	return cate;
}

function dcsDetermineRefer(host,path){
	if (host=="www.brother.co.jp"){
		var qry_idx=path.indexOf("?");
		if (qry_idx>0){
			path=path.substr(0,qry_idx);
		}
		if (path=="/product/"||path=="/product/index.htm"){
			return "PRDSITE";
		} else if (path.indexOf("/jp/mymio/special/")==0||path.indexOf("/special/justio/")==0){
			return "SPECIALSITE";
		} else {
			return dcsDetermineCategory(path);
		}
	} else {
//		var qry=window.location.search;
//		if (qry.length>0){
//			if (qry.indexOf("?")==0){
//				qry=qry.substr(1);
//			}
//			var q_prms=qry.split("&");
//			for (var i=0;i<q_prms.length;i++){
//				if (q_prms[i]=="WT.srch=1"){
//					return "PAYSRCH";
//				} else if (q_prms[i].indexOf("WT.mc_id=MM")==0){
//					return "MAILMAG";
//				} else if (q_prms[i].indexOf("WT.mc_id=TM")==0){
//					return "TARGETINGMAIL";
//				} else if (q_prms[i].indexOf("WT.mc_id=BN")==0){
//					return "BANNER";
//				} else if (q_prms[i].indexOf("WT.mc_id=AF")==0){
//					return "AFFILI";
//				}
//			}
//		}
		
		var mcparam=dcsGetMC_Param();
		if (mcparam!=""){
			return mcparam;
		}
		
		if (host.indexOf("google")>=0||host.indexOf("search.msn.")>=0||host.indexOf("yahoo")>=0||host.indexOf("excite.co.jp")>=0||host.indexOf("goo.ne.jp")>=0||host.indexOf("infoseek.co.jp")>=0||host.indexOf(".alltheweb.com")>=0||host.indexOf(".biglobe.ne.jp")>=0||host.indexOf("search.nifty.com")>=0||host.indexOf("search.jp.aol.com")>=0||host.indexOf("search.live.com")>=0||host.indexOf("search.jword.jp")>=0||host.indexOf("ask.jp")>=0||host.indexOf("baidu.jp")>=0){
			return "ORGSRCH";
		}
		return "INBOUND";
	}
}

function dcsGetMC_Param(){
	var qry=window.location.search;
	if (qry.length>0){
		if (qry.indexOf("?")==0){
			qry=qry.substr(1);
		}
		var q_prms=qry.split("&");
		for (var i=0;i<q_prms.length;i++){
			if (q_prms[i]=="WT.srch=1"){
				return "PAYSRCH";
			} else if (q_prms[i].indexOf("WT.mc_id=MM")==0){
				return "MAILMAG";
			} else if (q_prms[i].indexOf("WT.mc_id=TM")==0){
				return "TARGETINGMAIL";
			} else if (q_prms[i].indexOf("WT.mc_id=BN")==0){
				return "BANNER";
			} else if (q_prms[i].indexOf("WT.mc_id=AF")==0){
				return "AFFILI";
			}
		}
	}
	return "";

}

function dcsDepth(){
	var name="smz.depth="
	var parts=document.cookie.split("; ");
	var length=name.length;
	var str="";
	var i=0;
	while (parts[i]){
		if (parts[i].substr(0,length) == name){
			str=parts[i].substr(length,parts[i].length);
			break;
		}
		i++;
	}
	if (isNaN(str)){
		str=0;
	}
	str++;
	document.cookie = name+str+"; path=/";
	return str;
}

function dcsVar(){
	var dCurrent=new Date();
	WT.tz=dCurrent.getTimezoneOffset()/60*-1;
	if (WT.tz==0){
		WT.tz="0";
	}
	WT.bh=dCurrent.getHours();
	WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;
	if (typeof(screen)=="object"){
		WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;
		WT.sr=screen.width+"x"+screen.height;
	}
	if (typeof(navigator.javaEnabled())=="boolean"){
		WT.jo=navigator.javaEnabled()?"Yes":"No";
	}
	if (document.title){
		WT.ti=gI18n?dcsEscape(dcsEncode(document.title),I18NRE):document.title;
	}
	WT.js="Yes";
	WT.jv=dcsJV();
	if (document.body&&document.body.addBehavior){
		document.body.addBehavior("#default#clientCaps");
		if (document.body.connectionType){
			WT.ct=document.body.connectionType;
		}
		document.body.addBehavior("#default#homePage");
		WT.hp=document.body.isHomePage(location.href)?"1":"0";
	}
	if (parseInt(navigator.appVersion)>3){
		if ((navigator.appName=="Microsoft Internet Explorer")&&document.body){
			WT.bs=document.body.offsetWidth+"x"+document.body.offsetHeight;
		}
		else if (navigator.appName=="Netscape"){
			WT.bs=window.innerWidth+"x"+window.innerHeight;
		}
	}
	WT.fi="No";
	if (window.ActiveXObject){
		for(var i=10;i>0;i--){
			try{
				var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
				WT.fi="Yes";
				WT.fv=i+".0";
				break;
			}
			catch(e){
			}
		}
	}
	else if (navigator.plugins&&navigator.plugins.length){
		for (var i=0;i<navigator.plugins.length;i++){
			if (navigator.plugins[i].name.indexOf('Shockwave Flash')!=-1){
				WT.fi="Yes";
				WT.fv=navigator.plugins[i].description.split(" ")[2];
				break;
			}
		}
	}
	if (gI18n){
		WT.em=(typeof(encodeURIComponent)=="function")?"uri":"esc";
		if (typeof(document.defaultCharset)=="string"){
			WT.le=document.defaultCharset;
		} 
		else if (typeof(document.characterSet)=="string"){
			WT.le=document.characterSet;
		}
	}
//	WT.sp="@@SPLITVALUE@@";
	DCS.dcsdat=dCurrent.getTime();
	DCS.dcssip=window.location.hostname;
	DCS.dcsuri=window.location.pathname;
	if (window.location.search){
		DCS.dcsqry=gI18n?queryEncode(window.location.search):window.location.search;
		if (gQP.length>0){
			for (var i=0;i<gQP.length;i++){
				var pos=DCS.dcsqry.indexOf(gQP[i]);
				if (pos!=-1){
					var front=DCS.dcsqry.substring(0,pos);
					var end=DCS.dcsqry.substring(pos+gQP[i].length,DCS.dcsqry.length);
					DCS.dcsqry=front+end;
				}
			}
		}
	}
	DCSext.WTCLTHRU=dcsDepth();
	var refr_src="";
	var refr_host="";
	var refr_path="";
	if ((window.document.referrer!="")&&(window.document.referrer!="-")){
		if (!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){
			DCS.dcsref=gI18n?dcsEscape(window.document.referrer, I18NRE):window.document.referrer;
		}
		var refr=window.document.referrer;
		var refr_host_idx=refr.indexOf("://")+3;
		if (refr_host_idx>3){
			var refr_path_idx=refr.indexOf("/",refr_host_idx);
			if (refr_path_idx==-1){
				refr_host=refr.substr(refr_host_idx);
			} else {
				refr_host=refr.substring(refr_host_idx,refr_path_idx);
				refr_path=refr.substr(refr_path_idx);
			}
			refr_src=dcsDetermineRefer(refr_host,refr_path);
		}
	} else {
		//refr_src="DIRECT";
		var mcparam=dcsGetMC_Param();
		if (mcparam!=""){
			refr_src=mcparam;
		}else{
			refr_src="DIRECT";
		}
	}
	var cate=dcsDetermineCategory(window.location.pathname).split(";");
	var cat="";
	var cat_pos="";
	if (cate.length>0&&cate[0].length>0){
		cat=cate[0];
		WT.cg_n=cat;
		WT.si_n="CATTRN_"+cat;

		if (cat=="HOUJIN"){
			DCSext.HOUCGN=cat;
			DCSext.HOUSIN="CATTRN_"+cat;
		}

		//if (cate.length==2&&cate[1].length>0){
		if (cate.length>=2&&cate[1].length>0){
			cat_pos=cate[1];
			WT.si_p=cat_pos;
			if (cat=="HOUJIN"){
				DCSext.HOUSIP=cat_pos;
				dcsSetHoujinSub(cat_pos);
			}
		}
	}

	//category for houjin
	if (cate.length>2&&cate[2].length>0){
		cat+=";"+cate[2];
		WT.cg_n=cat;
		WT.si_n+=";CATTRN_"+cate[2];
		DCSext.HOUCGN=cate[2];
		DCSext.HOUSIN="CATTRN_"+cate[2];
		if (cate.length>=4&&cate[3].length>0){
			cat_pos+=";"+cate[3];
			WT.si_p=cat_pos;
			DCSext.HOUSIP=cate[3];
			dcsSetHoujinSub(cate[3]);
		}
	}

	//2008.09.09 add start
	var co_ref_cat=dcsGetCookie("abs.wtcorefcat");
	//2008.09.09 add end

	if (refr_src.indexOf(";")>0){
		var refr_cate=refr_src.split(";");
		var refr_cat="";
		var refr_pos="";
		if (refr_cate.length>0&&refr_cate[0].length>0){
			refr_cat=refr_cate[0];
			//if (refr_cate.length==2&&refr_cate[1].length>0){
			if (refr_cate.length>=2&&refr_cate[1].length>0){
				refr_pos=refr_cate[1];
			}
		}
		if (cat==refr_cat){
			DCSext.WTCATTRN=1;
			if (cat_pos==gCatPos[1]&&refr_pos==gCatPos[0]){
				DCSext.WTCATTRN_1=1;
			} else if (cat_pos==gCatPos[2]&&refr_pos==gCatPos[1]){
				DCSext.WTCATTRN_2=1;
			} else if (cat_pos==gCatPos[3]&&refr_pos==gCatPos[0]){
				DCSext.WTCATTRN_1A=1;
			}
		// 2008.08.12 add start
		} else {
			DCSext.WTSRCCAT=refr_cat;
		// 2008.08.12 add end
		}

		//2008.09.09 add start
		//if (co_ref_cat==null){
		if (DCSext.WTCLTHRU==1){
			dcsSetRefCatA(cat);
			DCSext.WTLEAVEHIT="1";
			DCSext.WTAVAILHIT="0";
		} else {
			DCSext.WTLEAVEHIT="0";
			DCSext.WTAVAILHIT="1";
		}
		//2008.09.09 add end

	// 2008.08.12 mod start
	//} else if (DCSext.WTCLTHRU==1){
	//	DCSext.WTTRFSRC=refr_src;
	} else {
		//2008.09.09 add start
		if (cat=="") {
			if (DCSext.WTCLTHRU==1){
				DCSext.WTLEAVEHIT="1";
				DCSext.WTAVAILHIT="0";
			} else {
				DCSext.WTLEAVEHIT="0";
				DCSext.WTAVAILHIT="1";
			}
		} else {
			//if (co_ref_cat==null){
			if (DCSext.WTCLTHRU==1){
				dcsSetRefCatA(cat);
				DCSext.WTLEAVEHIT="1";
				DCSext.WTAVAILHIT="0";
			} else {
				DCSext.WTLEAVEHIT="0";
				DCSext.WTAVAILHIT="1";
			}
		}
		//2008.09.09 add end

		DCSext.WTSRCCAT=refr_src;
		if (DCSext.WTCLTHRU==1){
			DCSext.WTTRFSRC=refr_src;
		}
	// 2008.08.12 mod end
	}

	//2008.11.17 add start
	dcsReVisit();
	//2008.11.17 add end

}

function dcsSetHoujinSub(pname){
	var subcatname = "";
	if (pname=="HOUJIN_TOP"){
		subcatname = "HOUJIN_TOP";
	} else if(pname=="SOLU_PRINT"||pname=="SOLU_LABEL"||pname=="SOLU_QUICK"||pname=="SOLU_MOBILE"||pname=="SOLU_STAMP"||pname=="SOLU_RFID"){
		subcatname = "SEARCH_SOLU";
	} else if(pname=="BUZ_TOP"||pname.indexOf("BUZ_DTL_")==0){
		subcatname = "SEARCH_BUZ";
	} else if(pname=="SOLU_PRINT_DTL"||pname=="SOLU_LABEL_DTL"||pname=="SOLU_QUICK_DTL"||pname=="SOLU_MOBILE_DTL"||pname=="SOLU_STAMP_DTL"||pname=="SOLU_RFID_DTL"){
		subcatname = "HOUJIN_DTL";
	} else if(pname.indexOf("CONTACT_")==0){
		subcatname = "CONTACT";
	}

	if (subcatname!=""){
		DCSext.HOUCGNSUB=subcatname;
	}

}

function dcsSetRefCatA(str){
	document.cookie = "abs.wtcorefcat="+str+"; path=/";
}

function dcsSetConversion(){
	DCSext.WTCONVPAGE="1";
}

function dcsReVisit(){

	var path=window.location.pathname;
	var revisname="";
	if (path.indexOf("/jp/mymio/special/")==0){
		revisname="abs.revis.mymio.spl";
		if (dcsCheckReVisit(revisname)){
			DCSext.REVIST_MYMIO_SPL="1";
			DCSext.REVIST_MYMIO="1";
		}else{
			DCSext.REVIST_MYMIO_SPL="0";
			DCSext.REVIST_MYMIO="0";
		}
	}else if(path.indexOf("/product/mymio/")==0){
		revisname="abs.revis.mymio.prd";
		if (dcsCheckReVisit(revisname)){
			DCSext.REVIST_MYMIO_PRD="1";
			DCSext.REVIST_MYMIO="1";
		}else{
			DCSext.REVIST_MYMIO_PRD="0";
			DCSext.REVIST_MYMIO="0";
		}
	}else if(path.indexOf("/special/justio/")==0){
		revisname="abs.revis.justio.spl";
		if (dcsCheckReVisit(revisname)){
			DCSext.REVIST_JUSTIO_SPL="1";
		}else{
			DCSext.REVIST_JUSTIO_SPL="0";
		}

	}

}

function dcsCheckReVisit(name){
	if (document.cookie.indexOf(name+"=")!=-1){
		return true;
	}else{
		var dCur=new Date();
		dCur.setTime(dCur.getTime()+(dCur.getTimezoneOffset()*60000)+(gTimeZone*3600000));
		var dExp=new Date(dCur.getTime()+315360000000);
		var expiry="; expires="+dExp.toGMTString();
		document.cookie=name+"=abs.revisit"+expiry+"; path=/"+(((typeof(gFpcDom)!="undefined")&&(gFpcDom!=""))?("; domain="+gFpcDom):(""));
		
		return false;

	}
}

function queryEncode(str){
	var v,v_sp;
	v=str;
	if (str.indexOf("?")==0){
		v=str.substring(1);
	}
	v_sp=v.split("&");
	for (var i=0;i<v_sp.length;i++){
		var e_pos=v_sp[i].indexOf("=");
		var v_enc=dcsEscape(dcsEncode(v_sp[i].substring(e_pos+1)),I18NRE);
		if (v_enc.indexOf("%25")>-1&&v_enc.indexOf("%2525")==-1){
			v_enc=dcsEscape(v_enc,I18NRE);
		}
		v_sp[i]=v_sp[i].substring(0,e_pos+1)+v_enc;
	}
	return v_sp.join("&");
}

function dcsA(N,V){
	return "&"+N+"="+dcsEscape(V, RE);
}

function dcsEscape(S, REL){
	if (typeof(REL)!="undefined"){
		var retStr = new String(S);
		for (R in REL){
			retStr = retStr.replace(REL[R],R);
		}
		return retStr;
	}
	else{
		return escape(S);
	}
}

function dcsEncode(S){
	if (typeof(encodeURIComponent)=="function"){
		return encodeURIComponent(S);
	}
	else{
		var str_split = escape(S).split("%u");
		var str = '';
		for (i=0;i<str_split.length;i++){
			if (i>0){
				str_split[i]=treatEscape(str_split[i]);
			}
			str+=str_split[i];
		}
		return str;
	}
}

function treatEscape(str){
	var dest;
	var rest = '';
	if (str.length>4){
		rest=str.substring(4,str.length);
		str=str.substring(0,4);
	}
	var c = parseInt(str,16);
	if ((c>=0x0001)&&(c<= 0x007F)){
	    dest='%'+str.charAt(2)+str.charAt(3);
	}
	else if(c>0x07FF){
	    dest='%'+(0xE0|((c>>12)&0x0F)).toString(16);
	    dest+='%'+(0x80|((c>>6)&0x3F)).toString(16);
	    dest+='%'+(0x80|((c>>0)&0x3F)).toString(16);
	}
	else{
	    dest='%'+(0xC0|((c>>6)&0x1F)).toString(16);
	    dest+='%'+(0x80|((c>>0)&0x3F)).toString(16);
	}
	return dest+rest;
}

function dcsCreateImage(dcsSrc){
	if (document.images){
		gImages[gIndex]=new Image;
		if ((typeof(gHref)!="undefined")&&(gHref.length>0)){
			gImages[gIndex].onload=gImages[gIndex].onerror=dcsLoadHref;
		}
		gImages[gIndex].src=dcsSrc;
		gIndex++;
	}
	else{
		document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+dcsSrc+'">');
	}
}

function dcsMeta(){
	var elems;
	if (document.all){
		elems=document.all.tags("meta");
	}
	else if (document.documentElement){
		elems=document.getElementsByTagName("meta");
	}
	if (typeof(elems)!="undefined"){
		for (var i=1;i<=elems.length;i++){
			var meta=elems.item(i-1);
			if (meta.name){
				if (meta.name.indexOf('WT.')==0){
					WT[meta.name.substring(3)]=gI18n?dcsEscape(dcsEncode(meta.content),I18NRE):meta.content;
				}
				else if (meta.name.indexOf('DCSext.')==0){
					DCSext[meta.name.substring(7)]=gI18n?dcsEscape(dcsEncode(meta.content),I18NRE):meta.content;
				}
				else if (meta.name.indexOf('DCS.dcsref')==0){
					DCS[meta.name.substring(4)]=gI18n?dcsEscape(meta.content,I18NRE):meta.content;
				}
				else if (meta.name.indexOf('DCS.dcsqry')==0){
					DCS[meta.name.substring(4)]=gI18n?queryEncode(meta.content):meta.content;
				}
				else if (meta.name.indexOf('DCS.')==0){
					DCS[meta.name.substring(4)]=meta.content;
				}
			}
		}
	}
}

function dcsTag(){
	if (document.cookie.indexOf("WTLOPTOUT=")!=-1){
		return;
	}
	var P="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+(gDcsId==""?'':'/'+gDcsId)+"/dcs.gif?";
	for (N in DCS){
		if (DCS[N]) {
			P+=dcsA(N,DCS[N]);
		}
	}
	for (N in WT){
		if (WT[N]) {
			P+=dcsA("WT."+N,WT[N]);
		}
	}
	for (N in DCSext){
		if (DCSext[N]) {
			P+=dcsA(N,DCSext[N]);
		}
	}
	if (P.length>2048&&navigator.userAgent.indexOf('MSIE')>=0){
		P=P.substring(0,2040)+"&WT.tu=1";
	}
	dcsCreateImage(P);
}

function dcsJV(){
	var agt=navigator.userAgent.toLowerCase();
	var major=parseInt(navigator.appVersion);
	var mac=(agt.indexOf("mac")!=-1);
	var nn=((agt.indexOf("mozilla")!=-1)&&(agt.indexOf("compatible")==-1));
	var nn4=(nn&&(major==4));
	var nn6up=(nn&&(major>=5));
	var ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));
	var ie4=(ie&&(major==4)&&(agt.indexOf("msie 4")!=-1));
	var ie5up=(ie&&!ie4);
	var op=(agt.indexOf("opera")!=-1);
	var op5=(agt.indexOf("opera 5")!=-1||agt.indexOf("opera/5")!=-1);
	var op6=(agt.indexOf("opera 6")!=-1||agt.indexOf("opera/6")!=-1);
	var op7up=(op&&!op5&&!op6);
	var jv="1.1";
	if (nn6up||op7up){
		jv="1.5";
	}
	else if ((mac&&ie5up)||op6){
		jv="1.4";
	}
	else if (ie5up||nn4||op5){
		jv="1.3";
	}
	else if (ie4){
		jv="1.2";
	}
	return jv;
}

function dcsFunc(func){
	if (typeof(window[func])=="function"){
		window[func]();
	}
}

dcsVar();
dcsMeta();
dcsFunc("dcsAdv");
dcsTag();
