//Favorite
function addBookmark(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
} 

//FullScreen Open For Flash Site
var link_txt;
function getFullscreen(){
	var url = "/flash/";
	
	var isWin=(navigator.appVersion.indexOf("Win")!=-1)? true : false;
	var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)? true : false;
	if(screen.availHeight > 1050 || screen.availWidth > 1680){
		
		var ah=1050;
		var aw=1680;
		var h = Math.floor( (screen.availHeight-ah)/2 );
		var w = Math.floor( (screen.availWidth-aw)/2 );
	
		var str="screenX=0,screenY=0";
		str = ",top="+h+",left="+w+",scrollbars=no,resizable=yes,status=yes";
	
		if(window.screen){
			str+=",height="+ah;
			str+=",width="+aw;
		}
	//	var tmp=window.open(url,'newWin',str);
		var tmp=window.open(url,'newWin',str);
		tmp.resizeTo(aw,ah);
	
	}else{
		
		if(isWin&&isIE){
			//window.open(url,'newWin','fullscreen=yes');
			//window.open(url,'newWin','fullscreen=yes');
			var str="left=0,screenX=0,top=0,screenY=0,scrollbars=no,resizable=yes,status=yes";
			if(window.screen){
				var ah=screen.availHeight;
				var aw=screen.availWidth;
				str+=",height="+ah;
				str+=",width="+aw;
			}
	
			//var tmp=window.open(url,'newWin',str);
			var tmp=window.open(url,'newWin',str);
			tmp.moveTo(0,0);
			tmp.resizeTo(aw,ah);
		}else{
			
			var str="left=0,screenX=0,top=0,screenY=0,scrollbars=no,resizable=yes,status=yes";
			if(window.screen){
				var ah=screen.availHeight;
				var aw=screen.availWidth;
				str+=",height="+ah;
				str+=",width="+aw;
			}
	
			//var tmp=window.open(url,'newWin',str);
			var tmp=window.open(url,'newWin',str);
			tmp.moveTo(0,0);
			tmp.resizeTo(aw,ah);
		}
	}
}

//Flash Insert For main.html
function introFlash()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=location.protocol+"//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="750" height="285">\n');
	document.write('<param name="movie" value="/swf/intro.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="wmode" value="opaque" / >');
	document.write('<embed src="/swf/intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="750" height="285"></embed>\n');
	document.write('</object>\n');
}
function companyFlash()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=location.protocol+"//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="750" height="200">\n');
	document.write('<param name="movie" value="/swf/company.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="wmode" value="opaque" / >');
	document.write('<embed src="/swf/company.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="750" height="200"></embed>\n');
	document.write('</object>\n');
}
function headBanner02_5()
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=location.protocol+"//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60">');
	document.write('<param name="movie" value="/swf/headBanner02_5.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<embed src="/swf/headBanner02_5.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60" wmode="transparent"></embed>');
	document.write('</object>');
}


//Insurance Page Open From Flash
function openInsurance(url) {
	if(!window.opener || window.opener.closed){ // メインウィンドウの存在をチェック
		var tmp2 = window.open(url,'mainWin', 'scrollbars=yes,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes');
	}else{
		//Google Chrome safari対応
		if(window.navigator.userAgent.indexOf('AppleWebKit')>-1) {
			window.blur();
		}
		window.opener.focus();
		window.opener.location.href = url; // 存在する場合はページを切りかえる
	}
}

function closeWin(){
	window.close();
}

function test() {
	var str = window.navigator.userAgent.indexOf('AppleWebKit');
	window.alert(str)
}

function testOpen(url) {
	var str="left=0,screenX=0,top=0,screenY=0,scrollbars=no,resizable=yes,status=yes";
	window.open(url, 'newWin', str)
	
}
function testFocus(url) {
	if(!window.opener || window.opener.closed){ // メインウィンドウの存在をチェック
		var tmp2 = window.open(url,'mainWin', 'scrollbars=yes,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes');
	}else{
		if(window.navigator.userAgent.indexOf('AppleWebKit')>-1) {
			window.blur();
		}
		window.opener.focus();
		window.opener.location.href = url; // 存在する場合はページを切りかえる
		
	}
}
