﻿// JavaScript Document
var menu1=new Array()

var menu2=new Array()
menu2[0]='<a href="news/index.html" target=_self>ニュース・イベント概要</a>'
menu2[1]='<a href="news/press.html" target=_self>ニュースリリース</a>'
menu2[2]='<a href="news/archive.html" target=_self>過去のニュースリリース</a>'
menu2[3]='<a href="news/accessnews.html" target=_self>メディア掲載</a>'
menu2[4]='<a href="news/events.html" target=_self>イベント</a>'
menu2[5]='<a href="https://www.access.co.jp/contact/form.php?type=3" target=_self>報道機関からのお問い合わせ</a>'

var menu3=new Array()
menu3[0]='<a href="overview/customization.html" target=_self>先進のUIエンジン</a>'
menu3[1]='<a href="overview/limo.html" target=_self>LiMo対応</a>'
menu3[2]='<a href="overview/operator.html" target=_self>オペレータパック</a>'
menu3[3]='<a href="overview/netfront.html" target=_self>NetFront製品</a>'
menu3[4]='<a href="overview/application.html" target=_self>アプリケーションスイート</a>'
menu3[5]='<a href="overview/mobile.html" target=_self>対応端末</a>'
menu3[6]='<a href="overview/developer.html" target=_self>開発者ネットワーク</a>'
menu3[7]='<a href="overview/features.html" target=_self>機能</a>'
menu3[8]='<a href="overview/diagram.html" target=_self>モジュール図</a>'

var menu4=new Array()

var menu5=new Array()

var menu6=new Array()

var menu7=new Array()  


var menuwidth='220px'; //default menu width
var menuheight='30px'; //default menu width
var menubgcolor='#f0f0f0';  //menu bgcolor
var disappeardelay=0;  //menu disappear speed onMouseout (in miliseconds) 
var hidemenu_onclick="yes"; //hide menu when user clicks within menu?

var ie4=document.all;
var ns6=document.getElementById&&!document.all;

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>');
function getposOffset(what, offsettype)
{
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null)
	{
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth)
{
	if (ie4||ns6)
		dropmenuobj.style.left=dropmenuobj.style.top="-500px";
	
	if (menuwidth!="")
	{
		dropmenuobj.widthobj=dropmenuobj.style;
		dropmenuobj.widthobj.width=menuwidth;
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
		obj.visibility=visible;
	else if (e.type=="click")
		obj.visibility=hidden;
}

function iecompattest()
{
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function clearbrowseredge(obj, whichedge)
{
	var edgeoffset=0;
	if (whichedge=="rightedge")
	{
		var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth;
	}
	else
	{
		var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset;
		var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
		{ 
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight;
			if ((dropmenuobj.y-topedge) < dropmenuobj.contentmeasure) 
				edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge;
		}
	}
	return edgeoffset;
} 

function populatemenu(what)
{
	if (ie4||ns6)
		dropmenuobj.innerHTML=what.join("");
}


function dropdownmenu(obj, e, menucontents, menuwidth, tab, selected)  
{
	if (window.event) { event.cancelBubble=true; }
	else if (e.stopPropagation) { e.stopPropagation(); }
	
	clearhidemenu();
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv;
	populatemenu(menucontents);
	
	dropmenuobj.tab = tab;
	dropmenuobj.selected = selected; 
	
	swapImageBack(); 
	 
	swapImage();
	
	if ( dropmenuobj.tab == "home" || dropmenuobj.tab == "ux" || dropmenuobj.tab == "doc" || dropmenuobj.tab == "adn" || dropmenuobj.tab == "ace")  
	{ 
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth); 
		return clickreturnvalue(); 
	} 
	
	if (ie4||ns6)
	{
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth);
		dropmenuobj.x=getposOffset(obj, "left");
		dropmenuobj.y=getposOffset(obj, "top");
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px";
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px";
	}
	
	return clickreturnvalue();
}

function clickreturnvalue()
{
	if (ie4||ns6) { return false; }
	else { return true; }
}

function contains_ns6(a, b) 
{
	while (b.parentNode)
	{
		if ((b = b.parentNode) == a) { return true; }
	}
			
	return false;
}

function dynamichide(e)
{
	if (ie4&&!dropmenuobj.contains(e.toElement))
		delayhidemenu();
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhidemenu();
}

function hidemenu(e)
{
	if (typeof dropmenuobj!="undefined") 
	{
		if (ie4||ns6)
		{
			dropmenuobj.style.visibility="hidden";
		}
	}
	swapImageBack();
}

function delayhidemenu()
{
	if (ie4||ns6)
	{
		delayhide=setTimeout("hidemenu()",disappeardelay);
	}
	
}

function clearhidemenu()
{
	if (typeof delayhide!="undefined") 
		clearTimeout(delayhide);
}

function swapImage()
{
	switch (dropmenuobj.tab)
	{
		case 'home':
			img1.src = "/access/assets/images/access_linux_platform/images/m_home_1.png";
			return (false);
		case 'news':
			img2.src = "/access/assets/images/access_linux_platform/images/m_news_1.png";
			return (false);
		case 'overview':
			img3.src = "/access/assets/images/access_linux_platform/images/m_overview_1.png";
			return (false);
		case 'ux':
			img4.src = "/access/assets/images/access_linux_platform/images/m_ux_1.png";
			return (false);
		case 'doc':
			img5.src = "/access/assets/images/access_linux_platform/images/m_doc_1.png";
			return (false);
		case 'adn':
			img6.src = "/access/assets/images/access_linux_platform/images/m_adn_1.png";
			return (false);
		case 'ace':
			img7.src = "/access/assets/images/access_linux_platform/images/m_ace_1.png";
			return (false);
	}
}

function getSel()
{
	return 'overview';
}

function swapImageBack()
{
	if (dropmenuobj.selected == 'home')
		img1.src = "/access/assets/images/access_linux_platform/images/m_home_2.png";
	else
		img1.src = "/access/assets/images/access_linux_platform/images/m_home_0.png";
	
	if (dropmenuobj.selected == 'news')
		img2.src = "/access/assets/images/access_linux_platform/images/m_news_2.png";
	else
		img2.src = "/access/assets/images/access_linux_platform/images/m_news_0.png";
		
	if (dropmenuobj.selected == 'overview')
		img3.src = "/access/assets/images/access_linux_platform/images/m_overview_2.png";
	else
		img3.src = "/access/assets/images/access_linux_platform/images/m_overview_0.png";
		
	if (dropmenuobj.selected == 'ux')
		img4.src = "/access/assets/images/access_linux_platform/images/m_ux_2.png";
	else
		img4.src = "/access/assets/images/access_linux_platform/images/m_ux_0.png";
	
	if (dropmenuobj.selected == 'doc')	
		img5.src = "/access/assets/images/access_linux_platform/images/m_doc_2.png";
	else
		img5.src = "/access/assets/images/access_linux_platform/images/m_doc_0.png";
		
	if (dropmenuobj.selected == 'adn')	
		img6.src = "/access/assets/images/access_linux_platform/images/m_adn_2.png";
	else
		img6.src = "/access/assets/images/access_linux_platform/images/m_adn_0.png";
		
	if (dropmenuobj.selected == 'ace')	
		img7.src = "/access/assets/images/access_linux_platform/images/m_ace_2.png";
	else
		img7.src = "/access/assets/images/access_linux_platform/images/m_ace_0.png";
} 


// Non header specific functions

function alt_window(url, winname, wide, tall) 
{
	popupWin = window.open(url, winname, "scrollbars,toolbar,menubar,location,status,resizable,height="+tall+",width="+wide);
}

function selectLang(theForm) 
{
		var option = theForm.Language.options[theForm.Language.selectedIndex].value
		window.location = option;
		return true;
}

function selectPage(theForm) 
{
		var option = theForm.browseByProductForm.options[theForm.browseByProductForm.selectedIndex].value
		window.location = option;
		return true;
}

