var menu1 = new Array();
menu1[0]  = "<font class=\"small\"><a href=\"http://www.vestaxpro.com/\"  target=\"_blank\">www.vestaxpro.com Vestax<\/a><\/font>";
menu1[1]  = "<font class=\"small\">Check out the latest in the Worlf of Vestax and Vestax DJs. Find out what's happenning with the latest in products, music and what we have lined up in what you're all waiting for. Advancing the art of Djing...Raising the bar...<\/a><\/font>";
menu1[2]  = "<font class=\"small\"><a href=\"mailto:news@vestax.jp\">news@vestax.jp<\/font><\/a>";

var menu2 = new Array();
menu2[0]  = "<a href=\"sample/test/test1.html\">てすと　2<\/a>";
menu2[1]  = "<a href=\"sample/test/test2.html\">メニュー 2-1<\/a>";
menu2[2]  = "<a href=\"sample/test/test3.html\">メニュー 2-2<\/a>";
menu2[3]  = "<a href=\"sample/test/test4.html\">メニュー 2-3<\/a>";

var bg_color = "#ffffff";

var id        = "popupmenu";
var popupmenu = null;

function PopupMenu_Show(e ,m_list)
{
	var x = -10;
	var y = -10;

	// 座標取得
	if( document.all )
	{
		with( document.body )
		{
			x += event.clientX + scrollLeft;
			y += event.clientY + scrollTop;
		}// with //
	}else if( document.getElementById || document.layers ){
		x += e.pageX;
		y += e.pageY;
	}// if //

	// メッセージ設定
	var menu = "<table summary=\"ポップアップメニュー\">";
	var len = m_list.length;
	for( i = 0 ; i < len ; i ++ )
	{
		menu = menu.concat("<tr><td>", m_list[i], "<\/td><\/tr>");
	}// for //
	menu = menu.concat("<\/table>");

	if( document.all )
	{
		popupmenu                       = document.all(id);
		popupmenu.style.backgroundColor = bg_color;
		popupmenu.style.posLeft         = x;
		popupmenu.style.posTop          = y;
		popupmenu.innerHTML             = menu;
		popupmenu.style.visibility      = "visible";
	}else if( document.getElementById ){
		popupmenu                       = document.getElementById(id);
		popupmenu.style.backgroundColor = bg_color;
		popupmenu.style.left            = x;
		popupmenu.style.top             = y;
		popupmenu.innerHTML             = menu;
		popupmenu.style.visibility      = "visible";
	}else if( document.layers ){
		popupmenu         = document.layers[id];
		popupmenu.bgColor = bg_color;
		popupmenu.moveTo(x, y);
		popupmenu.document.open();
		popupmenu.document.write(menu);
		popupmenu.document.close();
		popupmenu.visibility = "show";
	}// if //

	// マウスイベント取得
	if( document.layers )
	{
		document.captureEvents(Event.MOUSEMOVE);
	}// if //
	document.onmousemove = PopupMenu_Hide;
}// PopupMenu_Show //

function PopupMenu_Hide(e)
{
	var x           = 0;
	var y           = 0;
	var menu_left   = 0;
	var menu_right  = 0;
	var menu_top    = 0;
	var menu_bottom = 0;

	if( document.all )
	{
		with( document.body )
		{
			x = event.clientX + scrollLeft;
			y = event.clientY + scrollTop;
		}// with //

		menu_left   = popupmenu.offsetLeft;
		menu_right  = popupmenu.offsetWidth + menu_left;
		menu_top    = popupmenu.offsetTop;
		menu_bottom = popupmenu.offsetHeight + menu_top;
	}else if( document.getElementById ){
		x = e.pageX;
		y = e.pageY;

		menu_left   = popupmenu.offsetLeft;
		menu_right  = popupmenu.offsetWidth + menu_left;
		menu_top    = popupmenu.offsetTop;
		menu_bottom = popupmenu.offsetHeight + menu_top;
	}else if( document.layers ){
		x = e.pageX;
		y = e.pageY;

		menu_left   = popupmenu.left;
		menu_right  = popupmenu.clip.right + menu_left;
		menu_top    = popupmenu.top;
		menu_bottom = popupmenu.clip.bottom + menu_top;
	}// if //

	if( menu_left > x || menu_top > y || menu_right < x || menu_bottom < y )
	{
		if( document.all )
		{
			popupmenu.style.visibility = "hidden";
		}else if( document.getElementById ){
			popupmenu.style.visibility = "hidden";
		}else if( document.layers ){
			popupmenu.visibility = "hide";
		}// if //
	}// if //
}// PopupMenu_Hide //
