/*@cc_on @*/
/*@if (@_jscript_version >= 5)
	if(!window.XMLHttpRequest&&window.ActiveXObject){window.XMLHttpRequest=function(){var x=".XMLHTTP",s="Msxml2"+x,rg=["Microsoft"+x,s,s+".3.0",s+".4.0",s+".5.0"],c=rg.length;while(c--){try{return new ActiveXObject(rg[c]);}catch(e){}};return null;}}
@end @*/

function CClient()
{
	var szHost=document.location.hostname,szLctn=String(document.location.href);
	this.Usr = navigator.userAgent.toLowerCase();
	this.Path = szLctn.replace(/\w+:\/\/[^\/:]+(:\d*)?/,"").replace(/\?.*$/,"");

	this.Host = document.location.protocol + "//" + szHost;

	this.Host += (0 == document.location.port.length) ? "" : ":" + document.location.port;

	this.IsMSIE = ((-1 != this.Usr.indexOf("msie")) && (-1 == this.Usr.indexOf("opera")));
	this.XpSvc2 = this.IsMSIE ? (-1 != this.Usr.indexOf("sv1")) : false;
	if(this.IsMSIE)
	{
		this.appVersion =
		{
			min4  : (/MSIE\x20[4-9]/i).test(this.Usr),
			min5  : (/MSIE\x20[5-9]/i).test(this.Usr),
			min55 : (/MSIE\x20([6-9]|5\.5)/i).test(this.Usr),
			min6  : (/MSIE\x20[6-9]/i).test(this.Usr)
		}
	}
	this.IsMny  = (/msmoney\x20/i).test(this.Usr);
	this.IsMSNE = (/MSN\x20[^8-9]/i).test(this.Usr);
	this.IsMSN8 = (/MSN\x20[8-9]/i).test(this.Usr);
	this.IsMSNA = (/(MSN\x20Companion|WebTV)/i).test(this.Usr);
	this.IsMac  = (-1 != this.Usr.indexOf("mac"));
	this.IsAOL  = (-1 != this.Usr.indexOf("aol"));
	this.IsWin  = (-1 != this.Usr.indexOf("windows"));
	this.IsNS   = (
		(-1 != this.Usr.indexOf("mozilla"))
		&& (-1 == this.Usr.indexOf("spoofer"))
        && (-1 == this.Usr.indexOf("compatible"))
        && (-1 == this.Usr.indexOf("opera"))
        && (-1 == this.Usr.indexOf("webtv"))
        && (-1 == this.Usr.indexOf("hotjava"))
        );

	this.PHWin = null;
	if((null == self.name) || (0 == self.name.length) || ("msnMain" == self.name)){self.name = "mny" + String(Date.parse(new Date()));}
}
function DoHelp(szId,
	szTpc)
{
	var W,H,szWD,szWNm,fIsIEPC,szQry,cpxScrnY=screen.width,cpxScrnX=screen.availHeight,fSearch=false,szUrl=g_Client.Host+"/inc/panehelp.aspx",szFile="",szKey="";

	var nV98 = (g_Client.Usr.search(/msmoney\s+(prm\s+){0,1}(.\d{1,}\.\d{1,}\.\d{1,})\./i) != -1) ? RegExp.$2 : "0";
	if((0 == phid && null == szId) || (null != szTpc))
	{
		szFile = (null != szTpc) ? szTpc : "";
	}
	else
	{
		szKey = (null == szId) ? phid : szId;
		fSearch = true;
	}
	szQry = "?tmt=" + escape(window.name) + "&v2=" + escape(document.location.search) + "&v98=" + escape(nV98) + "&v99=" + escape(g_Client.Path);
	szQry += (fSearch) ? "&SEARCHTERM=" + escape(szKey) + "&S_TEXT=" + escape("このページに関連するトピックは次のとおりです。目的の見出しをクリックしてください。") : "&TOPIC=" + szFile;
	szQry += ("undefined" != typeof v1) ? "&v1=" + escape(v1) : "&v1=" + escape(g_Client.Host);

	W = ((cpxScrnY <= 800) && !g_Client.IsMac) ? 180 : 230;
	H = (g_Client.IsWin && g_Client.IsAOL) ? cpxScrnX - window.screenTop - 22 : cpxScrnX;

	if(g_Client.IsMSNE)
	{
		window.external.showHelpPane(szUrl + szQry,W);
	}
	else if(g_Client.IsMSNA)
	{
		top.location.replace(szUrl + szQry);
	}
	else
	{
		fIsIEPC = g_Client.IsMSIE && !g_Client.IsMac && !g_Client.IsAOL;
		if(fIsIEPC && (null != g_Client.PHWin) && !g_Client.PHWin.closed)
		{
			g_Client.PHWin.location.replace(szUrl + szQry);
		}
		else
		{
			szWNm = fIsIEPC ? "_help26" : "_help";
			szWD = "toolbar=0,status=0,menubar=0,width=" + W + ",height=" + H + ",left=" + (cpxScrnY - W) + ",top=0,resizable=1";
			g_Client.PHWin = window.open(szUrl + szQry,szWNm,szWD);
		}
		if(g_Client.PHWin && !g_Client.IsMac && !g_Client.IsNS && (self != g_Client.PHWin.opener)){g_Client.PHWin.opener = self}
	}
}

function _fC(_u){
	_u=escape(_u);
	var i=0,_aA=["%3A\\/\\/","\\/","\\.","-","_","%3A//","%2F","%2E","%2D","%5F"];
	for(;i<5;i++){_u = _u.replace(new RegExp(_aA[i],"g"),_aA[i + 5]);}
	return _u;
}
function O_LC(){
	var _sH=screen.height,_sW=screen.width,_sW2=(_sW-535)/2,_sH2=(_sH-192)/2,t=(document.location.protocol=="http:")?"http://ccc01.opinionlab.com":"https://secure.opinionlab.com/ccc01";
	window.open(t+'/comment_card.asp?time1='+g_OLtm+'&time2='+(new Date()).getTime()+'&prev='+_fC(document.referrer)+'&referer='+_fC(g_Client.Host+g_Client.Path)+'&height='+_sH+'&width='+_sW,'comments','width=535,height=192,screenX='+_sW2+',screenY='+_sH2+',top='+_sH2+',left='+_sW2+',resizable=yes,scrollbars=no');
}

function LogErr(){
	if(!g_ErrPut){
		g_ErrPut=true;
		var _a=arguments,_i=(new Image()).src="/inc/chan/ourcode/errlog.gif?msg="+escape(_a[0])+"&url="+escape(_a[1])+"&line="+_a[2];
	}
	return true;
}
function AddHandler(hobj,e,pFn){
	if(hobj.addEventListener){hobj.addEventListener(e.substring(2),pFn,false);}
	else if(hobj.attachEvent){hobj.attachEvent(e,pFn);}
	else{var punk = hobj[e];if(punk == null){hobj[e] = pFn;} else {hobj[e] = function(){punk();pFn();}}}
}
function RemoveHandler(hobj,e,pFn){
	if(hobj.removeEventListener){hobj.removeEventListener(e.substring(2),pFn,false);}
	else if(hobj.detachEvent){hobj.detachEvent(e,pFn);
	}else{var punk=hobj[e];if(punk!=null){hobj[e]=null}}
}
var phid=0,g_ErrPut=false,g_OLtm=(new Date()).getTime(),g_Client=new CClient();