﻿/**
* swf書出し関数。<body>内にてswf書出し場所に<div id=属性名"></div>をセット。
* ファイルはimagesディレクトリ直下に設置。
* @param divID cssのdiv属性のid名
* @param swfName sfwファイル名（".swf"を除く）
* @param width 幅
* @param height 高さ
* @return swf埋め込みタグの生成
*/
function writeSWF(divID,swfName,width,height){
	if(document.getElementById(divID)){
		var tag ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'
			 + width 
			 + '" height="' 
			 + height 
			 + '" hspace="0" vspace="0" id="'
			 + swfName
			 + '" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/images/flash/'
			 + swfName
			 + '.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><embed src="/images/flash/'
			 + swfName
			 + '.swf" width="'
			 + width
			 + '" height="'
			 + height
			 + '" hspace="0" vspace="0" align="middle" quality="high" bgcolor="#FFFFFF" swLiveConnect=true id="'
			 + swfName
			 + '" name="'
			 + swfName
			 + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
		
		document.getElementById(divID).innerHTML = tag;
	}
}

writeSWF("head_flash","img",950,256);

var targetURL =protocol + '//' + hostPath + "/sitemap.html"; //対象URL
var thisURL =location.href; //現在読み込んでいるURL
   if(targetURL == thisURL){
   //読み込むURLと対象のURLが一致する場合
	if(document.getElementById('head_flash')){
   //document.getElementById(CSSのID).innerHTML = 'HTMLタグ';
   //例画像を読み込み
	document.getElementById('head_flash').innerHTML = '<img src="/images/header/tophead_image.jpg" border="0"/>';
   //flashを非表示
	document.getElementById('head_flash').style.display='block';
}
} else {
   //読み込むURLと対象のURLが一致しない場合
   //flashを表示
	if(document.getElementById('head_flash')){
	document.getElementById('head_flash').style.display='block';
   }
}