//-------------------------------------------------------------------
// ポップアップウィンドウ
//-------------------------------------------------------------------

function popupWindow (url) {
  open (url, 'news_window', 'width=600,height=590,scrollbars=yes,top=10,left=10,menubar=no,toolbar=no,location=no,status=yes,resizable=yes');
}

//-------------------------------------------------------------------
// 中央表示
//-------------------------------------------------------------------



function alignCenter () {
  var layout = document.getElementById ('layout');
  var windowHeight;
  if (window.innerHeight) {
    windowHeight = window.innerHeight;
  } else {
    windowHeight = document.documentElement.clientHeight;
  }
  windowHeight = windowHeight / 2 - 300;
  if (windowHeight < 0) {
    layout.style.top = '0px';
  } else {
    layout.style.top = windowHeight + 'px';
  }
}

//-------------------------------------------------------------------
// メニューからアクティブなページのリンクを外す
//-------------------------------------------------------------------

var menu_items = new Array ();

menu_items[0] = new Object ();
menu_items[0].id = 'menu_about';
menu_items[0].url = 'about';

menu_items[1] = new Object ();
menu_items[1].id = 'menu_showcase';
menu_items[1].url = 'showcase';

menu_items[2] = new Object ();
menu_items[2].id = 'menu_profile';
menu_items[2].url = 'profile';

menu_items[3] = new Object ();
menu_items[3].id = 'menu_link';
menu_items[3].url = 'link';

menu_items[4] = new Object ();
menu_items[4].id = 'menu_bridal';
menu_items[4].url = 'bridal';

function delete_link () {
	var this_url = location.href;
	for (var i = 0; i < menu_items.length; i++) {
		if (this_url.indexOf (menu_items[i].url) > 1) {
			document.getElementById(menu_items[i].id).firstChild.style.backgroundPosition = 'bottom';
		}
	}
}

//-------------------------------------------------------------------
// イベントハンドラ
//-------------------------------------------------------------------

window.onresize = function () {
	alignCenter();
}

window.onload = function () {
	delete_link ();
}

