

//▼jsファイル読み込み-------------------------------
document.write('<script src="/letter/js/jquery.js" type="text/javascript"></script>');
document.write('<script src="/letter/js/scrollsmoothly.js" type="text/javascript"></script>');
document.write('<script src="/letter/js/inlinebg.js" type="text/javascript"></script>');
//document.write('<script src="/letter/js/anchorlinkoff.js" type="text/javascript"></script>');
//document.write('<script src="/letter/js/externallink.js" type="text/javascript"></script>');



//▼ブラウザ判定-------------------------------

function checkGecko(){
	var ua = navigator.userAgent;
	if(ua.indexOf('Gecko')!=-1){
		return true;
	} else {
		return false;
	}
}


//▼CSS分岐設定-------------------------------

if(checkGecko()){
	document.write('<link href="/letter/css/diverge_mozilla.css" rel="stylesheet" type="text/css">');
} else {
	document.write('<link href="/letter/css/diverge_ie.css" rel="stylesheet" type="text/css">');
}








//▼別窓で開く-------------------------------

function wo_r(_tgt){
	if(_tgt){
		_popWin = window.open(_tgt);
		_popWin.focus();
	}
}





//▼ポップアップウィンドウ-------------------------------

//汎用
function wo(_tgt,_width,_height,_toolbar){
	if(_tgt){
		_width = (_width)?_width:660;
		_height = (_height)?_height:600;
		_toolbar = (_toolbar)?_toolbar:0;
		_popWin = window.open(_tgt,'_blank','width='+_width+',height='+_height+',scrollbars=yes,resizable=yes,toolbar='+_toolbar+',directories=no,location=no,menubar=no,status=yes');
		_popWin.focus();
	}
}

//▼画像拡大ウィンドウオープン
function imgZoom(num){
	if(win_closed(window.imgZoomWin)){
		imgZoomWin=window.open("/letter/sub_win/img_zoom.html?"+num,"imgZoomWin","width=600,height=470,status=0,scrollbars=1,resizable=1");
		imgZoomWin.focus();
	}else {
		window.imgZoomWin.location.href ="/letter/sub_win/img_zoom.html?"+num;
		imgZoomWin.focus();
	}
}

//▼親または子ウインドウの有無確認関数-------------------------------
function win_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 if( ua.indexOf('Firefox')!=-1 && ua.indexOf('Mac')!=-1 ){
			return winVar.closed;
		} else if( ua.indexOf('Safari')!=-1 && ua.indexOf('Mac')!=-1 ){
			return true;
		} else {
			return typeof winVar.document != 'object';
		}
	} else {
		return true;
	}
}






//▼flash8をembedする（サイズ指定あり。fileNameはパス・拡張子とも要記述）-------------------------------

function embedFla8(fileName,_width,_height){

	sslFla8();

	//fileNameからファイル名を渡す場合;
	myURL = fileName; 
	
	//ディレクトリ部分を取り除く;
    myFileName = myURL.substring(myURL.lastIndexOf("/")+1,myURL.length)
    
    //拡張子を取り除く;
    myFileName2 = myFileName.substring(0,myFileName.indexOf("."));
    thisFileName = "thisFileName=" + myFileName2;

	_width = (_width)?_width:480;
	_height = (_height)?_height:360;
	var writeStr = '\
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+ _codebase +' width="' + _width + '" height="' + _height + '" id="' + myFileName2 + '" align="middle">\
	<param name="allowScriptAccess" value="sameDomain" />\
	<param name="movie" value="' + fileName + '" />\
	<param name="flashvars" value="' + thisFileName + '" />\
	<param name="menu" value="false" />\
	<param name="quality" value="high" />\
	<param name="bgcolor" value="#4B585F" />\
	<embed src="' + fileName + '" FlashVars="' + thisFileName + '" menu="false" quality="high" bgcolor="#4B585F" width="' + _width + '" height="' + _height + '" name="' + myFileName2 + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"'+ _pluginspage +' />\
	</object>';
	document.write(writeStr);
}

//▼httpsの際の回避-------------------------------

function sslFla8(){
	
	if(location.protocol == 'http:'){
		_codebase = 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
		_pluginspage = 'pluginspage="http://www.macromedia.com/go/getflashplayer" '
		_path = ''
	} else {
		_codebase = 'codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
		_pluginspage = 'pluginspage="https://www.macromedia.com/go/getflashplayer" '
	}
}




