var WINDOW_NAME = "NIBAEC";

function gfLoadContents(url, w, h){
	enterContents(url, w, h);
}
function enterContents(url, w, h){

	var slvl = 0;
	if(enableWindowsize(1024,733)){
		slvl = 1;
	}

	switch(slvl){
		case 0:
			//alert("本コンテンツをご覧いただくには " + w + " × " + h + " 以上のモニター解像度が必要です。\n\n申し訳ございませんがモニター解像度の設定をご確認ください。");
			alert("本コンテンツをご覧いただくには 1024 × 768 以上のモニター解像度が必要です。\n\n申し訳ございませんがモニター解像度の設定をご確認ください。");
			break;
		case 1:
			bfpfullscreen(url,false);
			break;
	}

}
function enableWindowsize(w,h){
	var sw = 1024;
	var sh = 768;
//alert([sw,sh]);
	return (sw >= w && sh >= h);
}
function openAttention(w,h){
	var aw,ah;
	aw = 1024;
	ah = 768;
	if(w && h){
	}else{
		w = 644;
		h = 320;
	}
	attentionWin = window.open("attention.html","attentionWin","width=" + w + ",height=" + h + ",scrollbars=yes");
	attentionWin.moveTo((aw-w)/2,(ah-h)/2);
}
function ChangeImage(objName,chgObj){
	if(document.images){
		document.images[objName].src = eval(chgObj + ".src");
	}
}
function DownloadAfp(){
	afpWin = window.open("http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Japanese&P8_Language=Japanese","afpWin");
}
function installFinish(){
	top.location.reload(true);
}
function installFlash(){
	top.dummy.location.href = "index.html?pt=install";
}
function ___bfpfullscreen(strURI,isWindowClose){
	var aw = 1024;
	var ah = 768;
	
	newWin = window.open(strURI,"newWin","width="+aw+",height="+ah);
//	newWin = window.open(strURI,"newWin","width=1012,height=676");
//	newWin.moveTo(Math.floor((aw - 1012)/2),Math.floor((ah - 676)/2));
	newWin.moveTo(0,0);
}
function bfpfullscreen(strURI, isWindowClose){
	var strAppVer = navigator.appVersion;
	var strAppNM  = navigator.appName;
	var intPos    = strAppVer.indexOf("MSIE",0);
	var msg = "申し訳ございませんが、あなたのご利用のブラウザでは\n\n本コンテンツをご覧いただくことができません。\n\nMicrosoft Internet Explorerや\n\nSafari等のブラウザをご利用の上、再度お試しください。";
	
	//if(document.domain!="test.bfp.co.jp" && document.domain!="www.bfp.co.jp") return;
	if(strAppVer.indexOf("Win")>=0){ //OS--Windows
		if(strAppNM.indexOf("Microsoft")>=0){ //Browser--InternetExplorer
			if (strAppNM == "Microsoft Internet Explorer" && parseInt(strAppVer)>=4){ //IEversion more 4
				if(parseInt(strAppVer.slice(intPos+5,intPos+6))>=6){
					if(parseInt(strAppVer.indexOf("Windows NT 5.1",0)) > 0){ //WindowsXP
						windowSize = window.open(strURI ,WINDOW_NAME,"width=" + (1024-4) + ",height=" + (768+1) + ",toolbar=0,location=yes,directories=0,status=0,menubar=0,scrollbars=0,resizable=no");
						//windowSize.moveTo(-5,-32);
						if(isWindowClose==true){
							window.close();
						}
						//windowSize.focus();
					}else{ //Not WindowsXP
						windowSize = window.open(strURI ,WINDOW_NAME,"width=" + (1024-4) + ",height=" + (768+1) + ",toolbar=0,location=yes,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
						//windowSize.moveTo(-5,-24);
						if(isWindowClose==true){
							window.close();
						}
						//windowSize.focus();
					}
				}else{
					windowSize = window.open("" ,WINDOW_NAME,"fullscreen=1,width=" + (1024+3) + ",height=" + (768+1) + ",toolbar=0,location=yes,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
					//windowSize.resizeTo(Math.ceil(1024+3),Math.ceil(768+1));
					windowSize.resizeTo(Math.ceil(1024+3),Math.ceil(768+1));
					windowSize.moveTo  (0,0);
					windowSize.document.open("text/html", "replace");
					windowSize.document.write("<html><style type='text/css'>\n");
					windowSize.document.write("body{ border: 1px solid #000000; overflow: hidden; margin: 0pt;}");
					windowSize.document.write("#stillloadingDiv{ position: absolute; left: 0px; top: 0px; width: 100%px; height: 19px; z-index: 1; background-color: #C0C0C0; layer-background-color: #C0C0C0; clip:rect(0,100%,19,0);}");
					windowSize.document.write("</style>\n");
					windowSize.document.write("<body onload=\"top.document.location.replace('"+strURI+"')\" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 scroll='no'>");
					windowSize.document.write("<div ID='stillloadingDiv'></div>");
					windowSize.document.write("</body></html>");
					windowSize.document.close();
					if(isWindowClose==true){
						window.close();
					}
					windowSize.focus();
				}
			}else{ //IEversion under 4
				windowSize = window.open(strURI,WINDOW_NAME,"width=" + (1024+1) + ",height=" + (768-21) + ",toolbar=0,location=yes,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=0,top=0,screenX=0,screenY=0",true);
				if(isWindowClose==true){
					window.close();
				}
			}
		}else if(strAppNM.indexOf("Netscape")>=0){ //Browser--NetscapeNavigator
			//*
			//alert("safari");
			windowSize = window.open(strURI,"NIBAEC","location=yes,scrollbars=no,resizable=no,width=1024,height=768,top=0,left=0");
			windowSize.moveBy(0,-10);
			//windowSize.location.href = strURI;
			//*/
			if(isWindowClose==true){
				window.close();
			}
			/*
			//windowSize = window.open("",WINDOW_NAME,"scrollbars=0,resizable=0,width=" + (1024-12) +",height=" + (768-30));
			windowSize = window.open("",WINDOW_NAME,"location=yes,scrollbars=0,resizable=0,outerWidth=" + 1024 +",outerheight=" + 768 +",top=0,left=0");
			windowSize.moveBy(0,-10);
			windowSize.location.href = strURI;
			if(isWindowClose==true){
				window.close();
			}
			//*/
			
		}else{ //Browser-- 3rdParty
			alert(msg);
		}
	}else if(strAppVer.indexOf("Mac")>=0){ //OS-Machintosh
		if(strAppVer.indexOf("Safari")>=0){ //Brower--Safari
			windowSize=window.open("",WINDOW_NAME,"location=yes,scrollbars=0,resizable=0,width=" + (1024) +",height=" + (768-18));
			windowSize.moveTo(0,0);
			windowSize.location.href=strURI;
			if(isWindowClose==true){
				window.close();
			}
		}else{
			if(strAppNM.indexOf("Microsoft")>=0){ //Browser--InternetExplorer
				windowSize = window.open(strURI,WINDOW_NAME,"alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=1,hotkeys=1,location=yes,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0");
				windowSize.resizeTo(1024,768);
				if(isWindowClose==true){
					window.close();
				}
			}else if(strAppNM.indexOf("Netscape")>=0){ //Browser--NetscapeNavigator
				windowSize=window.open("",WINDOW_NAME,"location=yes, scrollbars=0,resizable=0,width=" + (1024-12) +",height=" + (768-30));
				windowSize.moveTo(0,0);
				windowSize.location.href=strURI;
				if(isWindowClose==true){
					window.close();
				}
			}else{ //Browser-- 3rdParty
				alert("お使いのブラウザでは、ご覧いただけません。");
				/*
				location.replace("alert.html");
				if(isWindowClose==true){
					window.close();
				}
				*/
			}
		}
	}else{
		alert(msg);
	}
}
