// -------------------------
// siryo.js
// -------------------------
// 2008-02-27更新

// light.js読込
document.write("<script type=\"text/JavaScript\" src=\"http://www.pref.yamaguchi.lg.jp/webnavi/module/js/light.js\"></script>");

// --------------------
function changeTitle(){ // タイトルのスラッシュを半角に置換
// --------------------
	var z_ttl = document.title;
	h_ttl = "";
	for(i=0;i<z_ttl.length;i++){
		c = z_ttl.charAt(i);
		if(c=="／") c = "/";
		h_ttl += c;
	}
	document.title = h_ttl;
}

// onloadで実行
window.onload = function(){
	changeTitle();
	copyRightYear(); /* light.jsの共通関数 */
}


// 以下、旧siryo.jsのリニューアル対応版
// --------------------
function SiryoHeader(ym){
// --------------------
	var y = ym.substr(0,4);
	var m = (ym.substr(4,2)*1)+"";
	// var jym = NumToZen(y) + "年" + NumToZen(m) + "月";
	var jym = y + "年" + m + "月";
	// var ym_link = '<a href="http://webnavi.pref.yamaguchi.lg.jp/press/?m=' + ym + '" title="' + jym + 'の目次に戻ります。">' + jym +'</a>';
	var ym_link = '<a href="http://webnavi.pref.yamaguchi.lg.jp/press/?m=' + ym + '">' + jym +'</a>';
	var html = new Array(
'<div id="wrapper">',
'<div id="head">',
'<div class="logo">',
'<img src="http://www.pref.yamaguchi.lg.jp/module/shareimg/ymg_logo.gif" alt="" width="764"  height="46" usemap="#GoRoot">',
'<map name="GoRoot" id="GoRoot">',
'<area shape="rect" coords="0,0,165,46" href="http://www.pref.yamaguchi.lg.jp" alt="山口県公式ウェブサイト">',
'</map>',
'</div>',
'<dl class="ancherlink-hidden">',
'<dt>ページ内リンク</dt>',
'<dd>',
'<ol>',
'<li><a href="#contents">[共通メニューを跳ばして本文へ]</a></li>',
'<li><a href="#foot">[ページ末尾のサイトポリシー・著作情報へ]</a></li>',
'</ol>',
'</dd>',
'</dl>',
'<hr class="hidden">',
'<dl id="subhead">',
'<dt class="search">検索</dt>',
'<dd class="src-item">',
'<form action="http://webnavi.pref.yamaguchi.lg.jp/search/">',
'<p style="display:inline;">',
'<input type="hidden" name="e" value="u">',
'<input type="text" class="txt" name="q" value="">',
'<input type="submit" class="btn" value="検索">',
'</p>',
'</form>',
'<a href="http://webnavi.pref.yamaguchi.lg.jp/search/">検索の仕方</a>',
'</dd>',
'<dt class="env">閲覧環境</dt>',
'<dd class="resize"><a href="http://www.pref.yamaguchi.lg.jp/theme/guidance/font.html">文字拡大について</a></dd>',
'</dl>',
'<dl id="globalnavi">',
'<dt>グローバルナビ</dt>',
'<dd>',
'<ul>',
'<li class="kurashi"><a href="http://www.pref.yamaguchi.lg.jp/theme/kurashi/" title="くらしの情報">くらしの情報</a></li>',
'<li class="business"><a href="http://www.pref.yamaguchi.lg.jp/theme/business/" title="ビジネスと産業">ビジネスと産業</a></li>',
'<li class="profile"><a href="http://www.pref.yamaguchi.lg.jp/theme/profile/" title="山口の魅力と観光">山口の魅力と観光</a></li>',
'<li class="kensei"><a href="http://www.pref.yamaguchi.lg.jp/theme/kensei/" title="県政情報">県政情報</a></li>',
'<li class="org"><a href="http://www.pref.yamaguchi.lg.jp/theme/org/" title="組織から探す">組織から探す</a></li>',
'<li class="sitemap"><a href="http://www.pref.yamaguchi.lg.jp/theme/sitemap/" title="サイトマップ">サイトマップ</a></li>',
'</ul>',
'</dd>',
'</dl>',
'</div>',
'<hr class="hidden">',
'<div id="contents">',
'<dl id="topicpath">',
'<dt>トピックパス</dt>',
'<dd class="pankuzu">',
'<a href="http://www.pref.yamaguchi.lg.jp">トップページ</a> &gt; <a href="http://webnavi.pref.yamaguchi.lg.jp/press/">報道発表</a> &gt; ' + ym_link + ' &gt; 資料',
'</dd>',
'</dl>',
'<div id="main" style="position:relative;">',
'<div style="font-size:12px;color:gray;line-height:1.3;width:300px;position:absolute;top:5px;left:420px;">※ 原則として発表時の情報を掲載しています。<br>　 日付にご注意ください。</div>',
'<div class="back"><img src="../all/img/news_back.gif" alt="戻る"><a href="javascript:history.back();">戻る</a></div>',
'<div class="ttl"><img src="../all/img/ttl.gif" width="200" height="40" alt="報道発表"></div>',
'<div id="news">'
);
	document.write(html.join("\n"));
}
// --------------------
function SiryoFooter(){
// --------------------
	var html = new Array(
'</div>',
'<div class="back2"><img src="../all/img/news_back.gif" alt="戻る"><a href="javascript:history.back();">戻る</a></div>',
'<p class="btm">&nbsp;</p>',
'<p class="return-head"><span><a href="" onclick="PageUp();return false;">このページの先頭へ</a></span></p>',
'</div>',
'</div>',
'<hr class="hidden">',
'<div id="foot">',
'<dl id="globalnavi2">',
'<dt>グローバルナビ</dt>',
'<dd>',
'<ul>',
'<li class="kurashi"><a href="http://www.pref.yamaguchi.lg.jp/theme/kurashi/">くらしの情報</a></li>',
'<li class="business"><a href="http://www.pref.yamaguchi.lg.jp/theme/business/">ビジネスと産業</a></li>',
'<li class="profile"><a href="http://www.pref.yamaguchi.lg.jp/theme/profile/">山口の魅力と観光</a></li>',
'<li class="kensei"><a href="http://www.pref.yamaguchi.lg.jp/theme/kensei/">県政情報</a></li>',
'<li class="org"><a href="http://www.pref.yamaguchi.lg.jp/theme/org/">組織から探す</a></li>',
'</ul>',
'</dd>',
'</dl>',
'<ul class="footlink">',
'<li><a href="http://www.pref.yamaguchi.lg.jp/theme/guidance/about.html">このサイトの利用について</a></li>',
'<li><a href="http://www.pref.yamaguchi.lg.jp/theme/guidance/privacy.html">個人情報の取り扱い</a></li>',
'<li><a href="http://www.pref.yamaguchi.lg.jp/theme/guidance/contact.html">ご意見・お問合せ</a></li>',
'</ul>',
'<ul class="officeinfo">',
'<li>〒753-8501 山口県山口市滝町1番1号</li>',
'<li>電話：083-922-3111（代表）</li>',
'<li>[<a href="http://www.pref.yamaguchi.lg.jp/theme/guidance/access.html">アクセス</a>]</li>',
'</ul>',
'<p class="copyright">Copyright &copy;<span id="cyear"></span> Yamaguchi Prefecture.All Rights Reserved.</p>',
'</div>',
'</div>'
);
	document.write(html.join("\n"));
}
// --------------------
function Mail1(ad1,ad2,ad3,expres){
// --------------------
	sch="$";
	rep="&#46;";
	as1 = ad1.replace(sch,rep);
	as2 = ad2.replace(sch,rep);
	as3 = ad3.replace(sch,rep);
	ad = as3 + "&#64;" + as2 + "&#46;" + as1
	if(expres==""){
		expres = ad;
	}
	document.write("<a href='&#109;&#97;");
	document.write("&#105;&#108;&#116;&#111;&#58;" + ad + "'>" + expres + "</a>");
}
// --------------------
function NumToZen(str){
// --------------------
	han = "0123456789";
	zen = "０１２３４５６７８９";
	ret = "";
	for(i=0;i<str.length;i++){
		c = str.charAt(i);
		n = han.indexOf(c,0);
		if (n>=0) c = zen.charAt(n);
		ret += c;
	}
	return ret;
}
// --------------------
function PageUp(){
// --------------------
	var x1 = x2 = x3 = 0;
	var y1 = y2 = y3 = 0;
	if(document.documentElement){
		x1 = document.documentElement.scrollLeft || 0;
		y1 = document.documentElement.scrollTop || 0;
	}
	if(document.body){
		x2 = document.body.scrollLeft || 0;
		y2 = document.body.scrollTop || 0;
	}
	x3 = window.scrollX || 0;
	y3 = window.scrollY || 0;
	var x = Math.max(x1, Math.max(x2, x3));
	var y = Math.max(y1, Math.max(y2, y3));
	window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
	if (x > 0 || y > 0) {
		window.setTimeout("PageUp()",50);
	}
}

