﻿/*
Top Navigational Bar II (By Mike Hall)
Last updated: 00/05/08
*/

var myNavBar = new NavBar(0);
var tempMenu;

myNavBar.setSizes(1, 2, 1);
myNavBar.setColors("#ffffff", "#ffffff", "#000000", "#ffffff", "#990033", "#ffffff", "#000000", "#ffffff", "#990033");
myNavBar.setFonts("Arial, tahoma, Verdana", "plain", "bold", "9pt", "Arial, tahoma, Verdana,", "plain", "bold", "9pt");
myNavBar.setAlign("left");

tempMenu = new NavBarMenu(90, 150);
tempMenu.addItem(new NavBarMenuItem("Home", "#"));
tempMenu.addItem(new NavBarMenuItem("Home<br>トップページ", "http://www.wallpaperlink.com"));
tempMenu.addItem(new NavBarMenuItem("Japanese<br>ウィンドウズ用ページ", "http://www.wallpaperlink.com/pcj.html"));
tempMenu.addItem(new NavBarMenuItem("Japanese<br>マック用ページ", "http://www.wallpaperlink.com/macj.html"));
tempMenu.addItem(new NavBarMenuItem("English<br>For Windows", "http://www.wallpaperlink.com/pc.html"));
tempMenu.addItem(new NavBarMenuItem("English<br>For Mac", "http://www.wallpaperlink.com/mac.html"));
myNavBar.addMenu(tempMenu);

tempMenu = new NavBarMenu(100, 130);
tempMenu.addItem(new NavBarMenuItem("Ranking", "#"));
tempMenu.addItem(new NavBarMenuItem("Top 020", "http://www.wallpaperlink.com/rank/index.html"));
tempMenu.addItem(new NavBarMenuItem("Top 021-040", "http://www.wallpaperlink.com/rank/index2.html"));
tempMenu.addItem(new NavBarMenuItem("Top 041-060", "http://www.wallpaperlink.com/rank/index3.html"));
tempMenu.addItem(new NavBarMenuItem("Top 061-080", "http://www.wallpaperlink.com/rank/index4.html"));
tempMenu.addItem(new NavBarMenuItem("Top 081-100", "http://www.wallpaperlink.com/rank/index5.html"));
myNavBar.addMenu(tempMenu);

tempMenu = new NavBarMenu(95, 165);
tempMenu.addItem(new NavBarMenuItem("Official", "#"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 1<br>公式壁紙 あ行", "http://www.wallpaperlink.com/dirj/celebrity/a/index.html"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 2<br>公式壁紙 か行", "http://www.wallpaperlink.com/dirj/celebrity/k/index.html"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 3<br>公式壁紙 さ行", "http://www.wallpaperlink.com/dirj/celebrity/s/index.html"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 4<br>公式壁紙 た行", "http://www.wallpaperlink.com/dirj/celebrity/t/index.html"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 5<br>公式壁紙 な行", "http://www.wallpaperlink.com/dirj/celebrity/n/index.html"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 6<br>公式壁紙 は行", "http://www.wallpaperlink.com/dirj/celebrity/h/index.html"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 7<br>公式壁紙 ま行", "http://www.wallpaperlink.com/dirj/celebrity/m/index.html"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 8<br>公式壁紙 や行", "http://www.wallpaperlink.com/dirj/celebrity/y/index.html"));
tempMenu.addItem(new NavBarMenuItem("Official Wallpaper 9<br>公式壁紙 その他", "http://www.wallpaperlink.com/dirj/celebrity/x/index.html"));
myNavBar.addMenu(tempMenu);

tempMenu = new NavBarMenu(115, 130);
tempMenu.addItem(new NavBarMenuItem("Information", "#"));
tempMenu.addItem(new NavBarMenuItem("What's new<br>更新情報", "http://www.wallpaperlink.com/info/new.html"));
myNavBar.addMenu(tempMenu);

tempMenu = new NavBarMenu(100, 150);
tempMenu.addItem(new NavBarMenuItem("Contact", "#"));
tempMenu.addItem(new NavBarMenuItem("Add Wallpaper<BR>壁紙の投稿", "http://www.wallpaperlink.com/cgi-bin/formmail/wallpaper.cgi"));
tempMenu.addItem(new NavBarMenuItem("Add Account<BR>ランキングの参加", "http://www.wallpaperlink.com/cgi-bin/rank/accounts.cgi"));
tempMenu.addItem(new NavBarMenuItem("Edit Account<BR>ランキングの更新", "http://www.wallpaperlink.com/cgi-bin/rank/accounts.cgi?login"));
tempMenu.addItem(new NavBarMenuItem("Add Account<BR>リンクの登録", "http://www.wallpaperlink.com/cgi-bin/link/accounts.cgi"));
tempMenu.addItem(new NavBarMenuItem("Edit Account<BR>リンクの更新", "http://www.wallpaperlink.com/cgi-bin/link/accounts.cgi?login"));
tempMenu.addItem(new NavBarMenuItem("For Webmaster<BR>HP管理者さま用", "http://www.wallpaperlink.com/cgi-bin/formmail/webmaster.cgi"));
tempMenu.addItem(new NavBarMenuItem("For User<BR>一般ユーザーさま用<br>公式壁紙情報もこちら", "http://www.wallpaperlink.com/cgi-bin/formmail/public.cgi"));
myNavBar.addMenu(tempMenu);

window.onload = init;    // Set up page onload event.

function init() {

  myNavBar.resize(getWindowWidth());
  myNavBar.create();
  updatePosition();
}

function updatePosition() {

  var viewTop, viewBottom;
  var dy;

  viewTop = getPageScrollY();
  viewBottom = viewTop + getWindowHeight();

  if (myNavBar.bottom < viewTop)
    myNavBar.moveTo(0, viewTop - myNavBar.height);
  if (myNavBar.top > viewBottom)
    myNavBar.moveTo(0, viewBottom);

  dy = Math.round(Math.abs(viewTop - myNavBar.y) / 2);
  if (viewTop < myNavBar.y)
    dy = -dy;

  myNavBar.moveBy(0, dy);
  setTimeout('updatePosition()', 25);
}