/* -----------------------------------------------
*
* 浜松市共有スクリプト
*
------------------------------------------------ */
//--------------------------------------------------
//----↓サイドメニュー出力用↓--------------------
//--------------------------------------------------

//主なコンテンツ
function SIDEcts()
{
document.write('<div id="indexA">\n');
document.write('<h3><img src="/ui/right-area/right-area-cts.gif" width="240" height="26" alt="主なコンテンツへのリンク"></h3>\n');
document.write('<ul>\n');
document.write('<li><A href="/lifeindex/">暮らしの情報</A></li>\n');
document.write('<li><A href="/businessindex/">事業者向け情報</A></li>\n');
document.write('<li><A href="/square/">市政情報</A></li>\n');
document.write('<li><A href="/ward/">7つの行政区</A></li>\n');
document.write('<li><A href="http://hamamatsu-daisuki.net/index.php" target="_blank">観光情報<img src="/img/icon_new_window01.gif" alt="外部リンク／新しいウィンドウが開きます。" width="16" height="16" border="0"></A></li>\n');
document.write('<li><A href="/jump/jump_unagi.html" target="_blank">シティプロモーション <img src="/img/icon_new_window01.gif" alt="外部リンク／新しいウィンドウが開きます。" width="16" height="16" border="0"></A></li>\n');
document.write('<li class="listEnd"><A href="/voice/">みなさんの声／お問い合わせ</A></li>\n');
document.write('</ul>\n');
document.write('</div>\n');
}

//お困りですか？ アクティブ（SIDEcontact）非アクティブ（SIDEcontactOFF）
function SIDEcontactOFF()
{
document.write('<br>\n');
}
//お困りですか？ アクティブ（SIDEcontact）非アクティブ（SIDEcontactOFF）
function SIDEcontact()
{
document.write('<div id="indexB">\n');
document.write('<h3><img src="/ui/right-area/right-area-contact.gif" width="240" height="26" alt="お困りですか？"></h3>\n');
document.write('<ul>\n');
document.write('<li><img src="/ui/right-area/call.jpg" alt="コールセンターご案内">担当課がわからないとき</li>\n');
document.write('<li class="listEnd">コールセンターへお気軽にご相談ください。</li>\n');
document.write('<li class="listEnd">■電話番号<br>053-457-2111<br>■受付時間<br>午前8時30分〜午後5時15分</li>\n');
document.write('</ul>\n');
document.write('</div>\n');
}

//暮らしの情報
function SIDElife()
{
document.write('<div id="indexC">\n');
document.write('<h3><img src="/ui/right-area/right-area-life.gif" width="240" height="26" alt="暮らしの情報"></h3>\n');
document.write('<ul>\n');
document.write('<li class="listNB">よく利用される情報</li>\n');
document.write('<li class="listNB"><a href="/lifeindex/life/sinsei/kosekitodoke.html">戸籍謄本</a></li>\n');
document.write('<li class="listNB"><a href="https://www.mb.epss.jp/w" target="_blank">施設予約<img src="/img/icon_new_window01.gif" alt="外部リンク／新しいウィンドウが開きます。" width="16" height="16" border="0"></a></li>\n');
document.write('<li class="listNB"><a href="/maps/">施設案内</a></li>\n');
document.write('<li><a href="/lifeindex/study/library/">本を借りる</a></li>\n');
document.write('</ul>\n');
document.write('<ul>\n');
document.write('<li class="listEnd"><a href="/voice/enquete-gd.htm" target="_blank">浜松市公式Webサイトに関するアンケート <img src="/img/icon_new_window01.gif" alt="外部リンク／新しいウィンドウが開きます。" width="16" height="16" border="0"></a></li>\n');
document.write('</ul>\n');
document.write('</div>\n');
}

//事業者向け情報
function SIDEbiz()
{
document.write('<div id="indexC">\n');
document.write('<h3><img src="/ui/right-area/right-area-biz.gif" width="240" height="26" alt="事業者向け情報"></h3>\n');
document.write('<ul>\n');
document.write('<li class="listNB">よく利用される情報</li>\n');
document.write('<li class="listNB"><a href="/businessindex/bid/index.htm">発注情報</a> ／ <a href="/businessindex/bid/bisbid-rss20.xml" target="_blank">発注情報RSS <img src="/img/icon_new_window01.gif" alt="外部リンク／新しいウィンドウが開きます。" width="16" height="16" border="0"></a></li>\n');
document.write('<li><a href="/admin/reform/shiteikanri/h23koushin.htm">平成23年度　指定管理者公募</a></li>\n');
document.write('<li><a href="/businessindex/haiki/index.htm">産業廃棄物</a></li>\n');
document.write('<li><a href="/businessindex/shinko/promotion/bike.htm">電動バイクの購入補助</a></li>\n');
document.write('</ul>\n');
document.write('<ul>\n');
document.write('<li class="listNB">企業広告募集</li>\n');
document.write('<li class="listNB"><a href="/businessindex/banner/index.htm">Webサイトバナー広告(掲載企業募集中！)</a></li>\n');
document.write('</ul>\n');
document.write('</div>\n');
}

//市政情報
function SIDEadmn()
{
document.write('<div id="indexC">\n');
document.write('<h3><img src="/ui/right-area/right-area-admin.gif" width="240" height="26" alt="市政情報"></h3>\n');
document.write('<ul>\n');
document.write('<li class="listNB">よく利用される情報</li>\n');
document.write('<li class="listNB"><a href="/square/room/index.htm">市長の部屋</a></li>\n');
document.write('<li class="listNB"><a href="/officer/index.htm">職員採用情報</a></li>\n');
document.write('<li class="listNB"><a href="/square/sosiki/top.htm">市役所組織の紹介</a></li>\n');
document.write('</ul>\n');
document.write('</div>\n');
}


//主なコンテンツ 行政区・区役所
function SIDEword()
{
document.write('<div id="indexA">\n');
document.write('<h3><img src="/ui/right-area/right-area-cts.gif" width="240" height="26" alt="主なコンテンツへのリンク"></h3>\n');
document.write('<ul>\n');
document.write('<li><a href="/ward/index.htm">7つの行政区トップ</a>\n');
document.write('<li><a href="/ward/nakaku/index.html">中区・中区役所</a>\n');
document.write('<li><a href="/ward/higashiku/index.html">東区・東区役所</a>\n');
document.write('<li><a href="/ward/nishiku/index.html">西区・西区役所 </a>\n');
document.write('<li><a href="/ward/minamiku/index.html">南区・南区役所 </a>\n');
document.write('<li><a href="/ward/kitaku/index.html">北区・北区役所 </a>\n');
document.write('<li><a href="/ward/hamakitaku/index.html">浜北区・浜北区役所 </a>\n');
document.write('<li><a href="/ward/tenryuku/index.html">天竜区・天竜区役所 </a>\n');
document.write('<li><a href="/square/intro/dmc/kuwari/zentyoumei1.htm">町名対応一覧</a>\n');
document.write('<li class="listEnd"><a href="/ward/data_list.htm">各区の基礎データ一覧</a>\n');
document.write('</ul></div>\n');
}

//地図ページ右メニュー
function SIDEctsMAP()
{
//地図専用
document.write('<div id="indexC">\n');
document.write('<h3><img src="/ui/right-area/right-area-maps.gif" width="240" height="26" alt="地図情報"></h3>\n');
document.write('<ul>\n');
document.write('<li><A href="/maps/index6.htm">市役所・区役所・地域自治センター</A></li>\n');
document.write('<li><A href="/maps/index2.htm">文化・教養</A></li>\n');
document.write('<li><A href="/maps/index3.htm">スポーツ・レジャー</A></li>\n');
document.write('<li><A href="/maps/index4.htm">主な公園・野外活動</A></li>\n');
document.write('<li><A href="/maps/index5.htm">市民生活・福祉</A></li>\n');
document.write('<li><A href="/maps/index7.htm">サービスセンター</A></li>\n');
document.write('<li><A href="/maps/index8.htm">公民館</A></li>\n');
document.write('<li>各区の施設マップ<br><A href="/ward/nakaku/map.html">中区</A> ／ <A href="/ward/higashiku/map.html">東区</A> ／ <A href="/ward/nishiku/map.html">西区</A> ／ <A href="/ward/minamiku/map.html">南区</A> ／ <A href="/ward/kitaku/map.html">北区</A> ／ <A href="/ward/hamakitaku/map.html">浜北区</A> ／ <A href="/ward/tenryuku/map.html">天竜区</A></li>\n');
document.write('<li class="listEnd"><A href="https://www.mb.epss.jp/w" target="_blank">施設予約（まつぼっくり） <img src="/img/icon_new_window01.gif" alt="外部リンク／新しいウィンドウが開きます。" width="16" height="16" border="0"></A></li>\n');
document.write('</ul>\n');
document.write('</div>\n');
//主なコンテンツ
document.write('<div id="indexA">\n');
document.write('<h3><img src="/ui/right-area/right-area-cts.gif" width="240" height="26" alt="主なコンテンツへのリンク"></h3>\n');
document.write('<ul>\n');
document.write('<li><A href="/lifeindex/">暮らしの情報</A></li>\n');
document.write('<li><A href="/businessindex/">事業者向け情報</A></li>\n');
document.write('<li><A href="/square/">市政情報</A></li>\n');
document.write('<li><A href="/ward/">7つの行政区</A></li>\n');
document.write('<li><A href="http://hamamatsu-daisuki.net/index.php" target="_blank">観光情報 <img src="/img/icon_new_window01.gif" alt="外部リンク／新しいウィンドウが開きます。" width="16" height="16" border="0"></A></li>\n');
document.write('<li><A href="/jump/jump_unagi.html" target="_blank">シティプロモーション <img src="/img/icon_new_window01.gif" alt="外部リンク／新しいウィンドウが開きます。" width="16" height="16" border="0"></A></li>\n');
document.write('<li class="listEnd"><A href="/voice/">みなさんの声／お問い合わせ</A></li>\n');
document.write('</ul>\n');
document.write('</div>\n');
}


//主なコンテンツ 図書館
function SIDElibrary()
{
document.write('<div id="indexA">\n');
document.write('<h3><img src="/ui/right-area/right-area-cts.gif" width="240" height="26" alt="主なコンテンツへのリンク"></h3>\n');
document.write('<ul><li>検索と予約<ul>\n');
document.write('<li><A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacMnuTopInitAction.do?WebLinkFlag=1&moveToGamenId=tifschcmpd">蔵書検索へ</A>／\n');
document.write('<A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/MOpacMnuTopInitAction.do">携帯サイトへ</A></li>\n');
document.write('</ul></li>\n');
document.write('<li>図書館を利用するには<ul>\n');
document.write('<li><A href="/lifeindex/study/library/guide/index.htm">はじめて利用するには</A>／\n');
document.write('<A href="/lifeindex/study/library/guide/index.htm#lbl02">借りるときは</A>／\n');
document.write('<A href="/lifeindex/study/library/guide/index.htm#lbl03">返すときは</A>／\n');
document.write('<A href="/lifeindex/study/library/access/index.htm">各館のご案内</A>／\n');
document.write('<A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacMnuTopInitAction.do?WebLinkFlag=1&moveToGamenId=msgcld">休館日カレンダー</A>／\n');
document.write('<A href="/lifeindex/study/library/guide/yoyaku.htm">予約サービスガイド</A>／\n');
document.write('<A href="/lifeindex/study/library/guide/koenolibrary.htm">声のライブラリー</A>／\n');
document.write('<A href="/lifeindex/study/library/guide/filmlibrary.htm">16ミリフィルムライブラリー</A>／\n');
document.write('<A href="/lifeindex/study/library/guide/bookmobile.htm">自動車文庫の巡回予定</A>／\n');
document.write('<A href="/lifeindex/study/library/business/business.htm">ビジネス支援サービス</A>／<A href="/lifeindex/study/library/qa.htm">図書館Ｑ＆Ａ</A></li>\n');
document.write('</ul></li>\n');
document.write('<li>図書館からのお知らせ<ul>\n');
document.write('<li><A href="http://www.lib.city.hamamatsu.shizuoka.jp/info/index.htm">お知らせとお願い</A>／\n');
document.write('<A href="/lifeindex/study/library/kizou.htm">図書資料の寄贈について</A>／ <A href="/lifeindex/study/library/tayori/index.htm">はままつ図書館だより</A>／\n');
document.write('<A href="http://www2.lib.city.hamamatsu.shizuoka.jp/boupub/mail/adr.jsp">メールマガジン</A>／\n');
document.write('<A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacMnuTopInitAction.do?WebLinkFlag=1&moveToGamenId=msgnewmenu">新しく入った本</A>／\n');
document.write('<A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacMnuTopInitAction.do?WebLinkFlag=1&moveToGamenId=msgrankmenu">貸し出しや予約が多い本／</A>\n');
document.write('<A href="/lifeindex/study/library/youkou/youkou.htm">図書館要綱</A></li>\n');
document.write('</ul></li>\n');
document.write('<li>利用状況の確認<ul>\n');
document.write('<li><A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacMnuTopInitAction.do?WebLinkFlag=1&moveToGamenId=usrchpass">パスワードの変更</A>／\n');
document.write('<A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacMnuTopInitAction.do?WebLinkFlag=1&moveToGamenId=usrchmail">メールアドレスの登録・変更</A>／\n');
document.write('<A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacMnuTopInitAction.do?WebLinkFlag=1&moveToGamenId=usrlend">借りている本の確認</A>／\n');
document.write('<A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacMnuTopInitAction.do?WebLinkFlag=1&moveToGamenId=usrrsv">予約している本の確認</A></li>\n');
document.write('</ul></li>\n');
document.write('<li>調べもの相談<ul>\n');
document.write('<li><A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacRefRefUkeDispAction.do">レファレンス申し込み</A>／\n');
document.write('<A href="https://www.lib.city.hamamatsu.shizuoka.jp/licsxp-opac/WOpacReqOdrUkeDispAction.do">リクエスト申し込み</A></li>\n');
document.write('</ul></li>\n');
document.write('<li>図書館について<ul>\n');
document.write('<li class="listEnd"><A href="/lifeindex/study/library/publication/index.htm">出版物</A>／\n');
document.write('<A href="/lifeindex/study/library/access/kounyuuzassi.htm">購入雑誌一覧</A>／ <A href="/lifeindex/study/library/data.htm">統計情報</A>／\n');
document.write('<A href="/lifeindex/study/library/history.htm">図書館のあゆみ</A>／\n');
document.write('<A href="/lifeindex/study/library/link/index.htm">リンク集</A></li></ul>\n');
document.write('</li></ul></div>\n');
}

//--------------------------------------------------
//----↓スタイルシート変更用↓--------------------
//--------------------------------------------------
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet('font_size_l');
setActiveStyleSheet(title);


