document.write('<p id="localMenuTop"><a href="http://olympuspen.com/jp/style/"><img src="/style/common/img/template/menu_top.gif" width="160" height="64" alt="PEN STYLE" /></a></p>');
document.write('<div class="localMenu">');
document.write('<ul id="acc">');
document.write('	<li id="local_photocon" class="last existSub">');
document.write('    <a href="/style/photocon/" class="btnContest"><img src="/style/common/img/template/btn_menu_12.gif" width="150" height="43" alt="クリエイティブフォト・コンテスト" /></a>');
document.write('    <ul class="sub">');
document.write('		<li id="local_photocon_sub1"><a href="/style/photocon/apply.html" class="act">クリエイティブフォト・コンテストについて</a></li>');
document.write('		<li id="local_photocon_sub2"><a href="/style/photocon/theme.html" class="act">公募テーマ</a></li>');
document.write('		<li id="local_photocon_sub7"><a href="/index.html/module/PhcLibrary/action/ThemeDetail/theme_cd/133/order/new" class="act">応募作品一覧</a></li>');
document.write('		<li id="local_photocon_sub4"><a href="/style/photocon/archives.html" class="act">過去の開催結果</a></li>');
document.write('		</ul>');
document.write('  </li>');
document.write('</ul>');
document.write('</div>');
document.write('<div id="linkBnnr">');
document.write('<ul>'); 
document.write('	<li><a href="http://www.youtube.com/user/OlympusPen" target="_blank"><img src="/style/common/img/template/btn_youtube.jpg" width="160" height="35" alt="公式YouTubeチャンネル OlympusPen" class="over" /></a></li>');
document.write('	<li id="twitter-btn"><a href="http://twitter.com/olympuspenstyle" target="_blank"><img src="/style/common/img/template/btn_twitter.jpg" width="160" height="35" alt="公式Twitterアカウント olympuspenstyle" class="over" /></a></li>');
document.write('	<!-- AddThis Button BEGIN -->');
document.write('	<li><a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4bc5189b7cbb9e9a"><img src="/style/common/img/template/share_btn.gif" width="160" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4bc5189b7cbb9e9a"></script></li>');
document.write('	<!-- AddThis Button END -->');
document.write('</ul>');
document.write('</div>');

// 以下、メニュー制御（変更不可）
bodyID = $("body").attr("id");
prepareSubMenu = bodyID.split('_');
subMenuName = prepareSubMenu[0];

$("#local_" + subMenuName + " > a").addClass("act");
$("#local_" + subMenuName + " ul").show();
$("#local_" + bodyID + " > a").attr("href","javascript:;");
if(bodyID != subMenuName){
	$("#local_" + bodyID + " > a").removeClass("act").removeAttr("href").css("background-color","#e3e4e4");
}else{
	$("#local_" + subMenuName + " > a").removeAttr("href")
}

$("div#fotopusMenu").hover(
	function(){$("p a",$(this)).addClass("act");$("div#dropMenu",$(this)).show()},
	function(){$("p a",$(this)).removeClass("act");$("div#dropMenu",$(this)).hide()}
);

// 以下、ロールオーバー
function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'over') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;


