// ########## Delete Error Message
// ########## 2002.12.01
function HideError(){
	return true;
}
window.onerror = HideError;

// ##### for Site Renewal 2006.12.26 start
// delete style sheet
//if (document.layers) {
//	document.write('<link rel="stylesheet" href="/css/n4style.css" type="text/css">');
//} else{
//	document.write('<link rel="stylesheet" href="/css/style.css" type="text/css">');
//}
// ##### for Site Renewal 2006.12.26 end



// ########## OS,Browser Info
// ########## 2002.01.01
var ie  = (navigator.appName.indexOf('Micr') != -1);
var mac = (navigator.userAgent.indexOf('Mac') != -1 || navigator.userAgent.indexOf('mac') != -1);
var win = (navigator.userAgent.indexOf('Win') != -1 || navigator.userAgent.indexOf('win') != -1);



// ########## Netscape 4.x系 再読込バグ回避
// ########## 2003.02.01
function N4_Reload(init) {
	if (init==true) with (navigator) {
		if ((appName=="Netscape") && (parseInt(appVersion)==4)) {
			document.N4_pgW = innerWidth;
			document.N4_pgH = innerHeight;
			onresize = N4_Reload;
		}
	} else if (innerWidth != document.N4_pgW || innerHeight != document.N4_pgH) location.reload();
}
N4_Reload(true);





// ########## IMGのPreLoad
// ########## 2002.01.01
function PreLoad() {
	imgList = new Array("/image/header_menu01_on.gif","/image/header_menu02_on.gif","/image/header_menu03_on.gif","/image/header_menu04_on.gif","/image/header_menu06_on.gif","/image/header_menu06_on.gif","/image/bt_fundinfo_on.gif","/image/bt_proinfo_on.gif","/fund/image/tab_price_on.gif","/fund/image/tab_inc_on.gif","/fund/image/tab_rat_on.gif","/image/bt_enlargement_on.gif","/image/bt_prodetail_on.gif","/products/image/index_tab_01_on.gif","/products/image/index_tab_02_on.gif","/products/image/index_tab_03_on.gif","/products/image/index_tab_04_on.gif","/products/image/index_tab_05_on.gif","/products/image/index_bt_01_on.gif","/products/image/index_bt_02_on.gif","/products/image/index_bt_03_on.gif","/products/image/index_bt_04_on.gif","/products/image/index_bt_05_on.gif","/recruit/image/recruit_tl01_on.gif","/recruit/image/recruit_tl02_on.gif","/recruit/image/recruit_tl03_on.gif","/recruit/image/recruit_tl04_on.gif","/recruit/image/recruit_tl04_on.gif","/recruit/image/recruit_tl05_on.gif","/recruit/image/recruit_tl06_on.gif","/recruit/image/recruit_tl07_on.gif","/recruit/image/recruit_tl08_on.gif","/fund/image/bt_dl_on.gif");
	PreImg = new Array();
	for(i=0; i<imgList.length; i++) {
		PreImg[i] = new Image();
		PreImg[i].src = imgList[i];
	}
}
document.onload = PreLoad;


// ########## Object検索・取得
// ########## 2002.01.01
function GetObj(n, d) {
	var p,i,x;
	if(!d) d = document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d = parent.frames[n.substring(p+1)].document;
		n = n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x = d.all[n];
	for(i=0; !x&&i<d.forms.length; i++) x = d.forms[i][n];
	for(i=0; !x&&d.layers&&i<d.layers.length; i++) x = GetObj(n,d.layers[i].document);
	if(!x && document.getElementById) x = document.getElementById(n);
	return x;
}





// ########## IMG切り替え
// ########## 2002.01.01
function ChgIMG() {
	var i , j = 0 , x , a = ChgIMG.arguments;
	document.My_sr = new Array;
	for(i=0; i<(a.length-2); i+=3) if ((x=GetObj(a[i]))!=null){
		document.My_sr[j++] = x;
		if(!x.oSrc) x.oSrc = x.src;
		x.src = a[i+2];
	}
}





// ########## 切り替えIMGのReset
// ########## 2002.01.01
function ResetIMG() {
	var i , x , a = document.My_sr;
	for(i=0; a&&i<a.length&&(x=a[i])&&x.oSrc; i++) x.src = x.oSrc;
}





// ########## PullDown Menu Link
// ########## 2002.01.01
function JumpMenu(targ,selObj,restore){
	if(selObj.options[selObj.selectedIndex].value != "-"){
		eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
	}
	if (restore) selObj.selectedIndex = 0;
}





// ########## Sub Window Open (Win,Mac-IE4不具合回避済み)
// ## WindowのFocus()処理はサブウィンドウ側にonLoadイベントで仕込む事
// ########## 2003.04.01
//## Win IE4／Mac IE4でclosed判定バグ回避

function WinReportOpen(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=540,height=400');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function WinFundOpen(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=520,height=400');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function WinProOpen(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=776,height=510');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function WinProOpen2(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=790,height=510');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function WinWordOpen(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=460,height=500');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function openWin(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=641,height=493');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function openGuideWin(URL,WN) {
	if(sbwin_closed(window.newwin)){
		newwin = window.open(URL,WN,'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,menubar=yes,width=641,height=200');
		newwin.focus();
	}else{
		newwin.location.href = URL;
		newwin.focus();
	}
}

function sbwin_closed(winVar) {
	var ua = navigator.userAgent
	if( !!winVar ){
		if( ( ua.indexOf('Gecko')!=-1 || ( ua.indexOf('MSIE 4')!=-1 && ua.indexOf('Win')!=-1 ) ) ) return winVar.closed
		else return typeof winVar.document != 'object'
	}else return true
}






// ########## Layer 切り替え
// ########## 2002.10.01
function SHLayer() {
	var i,p,v,obj,args = SHLayer.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=GetObj(args[i]))!=null) {
		v = args[i+2];
		if (obj.style) {
			obj = obj.style;
			v = (v=='show')?'visible':(v=='hide')?'hidden':v;
		}
		obj.visibility=v;
	}
}


// ########## お気に入り追加（windows版IEのみ）
function addFav(URL, PageTitle) {
	if(win && document.all) {
		window.external.AddFavorite(URL, PageTitle);
	} else {
		alert("この機能をご利用になるには、windows版のInternet Explororをご使用ください。");
	}
}

function nnFont() {
	sSheet = document.styleSheets[document.styleSheets.length-1];
	if ( document.defaultView.getComputedStyle(document.body,"").getPropertyValue("font-size") == "14px" ){
		sSheet.insertRule("body {font-size: 16px}",sSheet.cssRules.length);
	}
}

if ( document.defaultView && document.styleSheets ) window.onload = nnFont;


// E N D