/*
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("tahoma, Arial, Verdana", "plain", "bold", "9pt", "Arial, tahoma, Verdana,", "plain", "bold", "9pt");
myNavBar.setAlign("left");

tempMenu = new NavBarMenu(110, 150);
tempMenu.addItem(new NavBarMenuItem("トップページ", "#"));
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(130, 130);
tempMenu.addItem(new NavBarMenuItem("人気壁紙アーティスト", "#"));
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(140, 140);
tempMenu.addItem(new NavBarMenuItem("インフォメーション", "#"));
tempMenu.addItem(new NavBarMenuItem("What's new<br>更新情報", "http://www.wallpaperlink.com/info/new.html"));
myNavBar.addMenu(tempMenu);

tempMenu = new NavBarMenu(120, 150);
tempMenu.addItem(new NavBarMenuItem("コンタクト", "#"));
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>一般ユーザーさま用", "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);
}