// JavaScript Document
var menu1=new Array()

var menu2=new Array()
menu2[0]='<a href="http://alp.access-company.com/news/press.html" target=_self>Press Releases</a>'
menu2[1]='<a href="http://alp.access-company.com/news/archive.html" target=_self>Press Release Archives</a>'
menu2[2]='<a href="http://alp.access-company.com/news/accessnews.html" target=_self>ACCESS in the News</a>'
menu2[3]='<a href="http://alp.access-company.com/news/events.html" target=_self>Events</a>'
menu2[4]='<a href="http://alp.access-company.com/news/contacts.html" target=_self>Media Contacts</a>'

var menu3=new Array()
menu3[0]='<a href="http://alp.access-company.com/overview/acomplete.html" target=_self>A Complete Platform</a>'
menu3[1]='<a href="http://alp.access-company.com/overview/alparch.html" target=_self>Architecture</a>'
menu3[2]='<a href="http://alp.access-company.com/overview/designedmarket.html" target=_self>Designed for the Market</a>'
menu3[3]='<a href="http://alp.access-company.com/overview/nativeapps.html" target=_self>Easy-to-Use Native Applications</a>'
menu3[4]='<a href="http://alp.access-company.com/overview/threeapp.html" target=_self>Three Application Environments</a>'
menu3[5]='<a href="http://alp.access-company.com/overview/mobileexp.html" target=_self>Modern Mobile Experience</a>'
menu3[6]='<a href="http://alp.access-company.com/overview/hiker.html" target=_self>Hiker Application Environment</a>'
menu3[7]='<a href="http://alp.access-company.com/overview/designeduse.html" target=_self>Designed for Maximum Usability</a>'
menu3[8]='<a href="http://alp.access-company.com/overview/mlecosystem.html" target=_self>The ACCESS Mobile Linux Ecosystem</a>'
menu3[9]='<a href="http://alp.access-company.com/overview/productdetails.html" target=_self>Product Details</a>'

var menu4=new Array()

var menu5=new Array()

var menu6=new Array()

var menu7=new Array()  


var menuwidth='185px'; //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 = "http://alp.access-company.com/images/m_home_1.gif";
			return (false);
		case 'news':
			img2.src = "http://alp.access-company.com/images/m_news_1.gif";
			return (false);
		case 'overview':
			img3.src = "http://alp.access-company.com/images/m_overview_1.gif";
			return (false);
		case 'ux':
			img4.src = "http://alp.access-company.com/images/m_ux_1.gif";
			return (false);
		case 'doc':
			img5.src = "http://alp.access-company.com/images/m_doc_1.gif";
			return (false);
		case 'adn':
			img6.src = "http://alp.access-company.com/images/m_adn_1.gif";
			return (false);
		case 'ace':
			img7.src = "http://alp.access-company.com/images/m_ace_1.gif";
			return (false);
	}
}

function swapImageBack()
{
	if (dropmenuobj.selected == 'home')
		img1.src = "http://alp.access-company.com/images/m_home_2.gif";
	else
		img1.src = "http://alp.access-company.com/images/m_home_0.gif";
	
	if (dropmenuobj.selected == 'news')
		img2.src = "http://alp.access-company.com/images/m_news_2.gif";
	else
		img2.src = "http://alp.access-company.com/images/m_news_0.gif";
		
	if (dropmenuobj.selected == 'overview')
		img3.src = "http://alp.access-company.com/images/m_overview_2.gif";
	else
		img3.src = "http://alp.access-company.com/images/m_overview_0.gif";
		
	if (dropmenuobj.selected == 'ux')
		img4.src = "http://alp.access-company.com/images/m_ux_2.gif";
	else
		img4.src = "http://alp.access-company.com/images/m_ux_0.gif";
	
	if (dropmenuobj.selected == 'doc')	
		img5.src = "http://alp.access-company.com/images/m_doc_2.gif";
	else
		img5.src = "http://alp.access-company.com/images/m_doc_0.gif";
		
	if (dropmenuobj.selected == 'adn')	
		img6.src = "http://alp.access-company.com/images/m_adn_2.gif";
	else
		img6.src = "http://alp.access-company.com/images/m_adn_0.gif";
		
	if (dropmenuobj.selected == 'ace')	
		img7.src = "http://alp.access-company.com/images/m_ace_2.gif";
	else
		img7.src = "http://alp.access-company.com/images/m_ace_0.gif";
} 


// 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;
}

