window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d)
{
 d.style.display='block';
}
}

var justonetime = false;
function menuchange(pobject, psTab)
{	
	if (pobject!= undefined)
		pobject.src = "pictures/menu_" + psTab + ".png";
}

function menuidchange(pid, psTab)
{	
	myobject = document.getElementById(pid);
	if (myobject!= undefined)
		myobject.src = "pictures/menu_" + psTab + ".png";
}

/*
Définit l'image de survol et les sous menus affichés
*/
function submenu(psTab)
{
	var asLink;
	var oSubMenu;
		
	oSubMenu = document.getElementById('submenu');
	if (oSubMenu != undefined)
	{
		asLink = new Array();
		// Selon la catégorie
		switch (psTab)
		{
			case "company":
			asLink = [
			           ['About US', '../company/company_aboutus.html'],
					   ['Consortium', '../company/company_consortium.html'],
					   ['Partners', '../company/company_partners.html'],
					   ['Customers', '../company/company_customers.html'],
					   ['Team', '../company/company_team.html'],
					   ['Employment', '../company/company_employment.html']
					   ];
			break;

			case "services":
			asLink = [
			           ['Consulting', '../services/services_consulting.html'],
					   ['Training', '../services/services_training.html'],
					   ['Support', 'https://support.igeoss.com']
					   ];
			break;
			
			case "products":
			asLink = [
			           ['Poly3D', '../products/products_poly3D.html'],
					   ['Dynel2D', '../products/products_dynel2D.html'],
					   ['Dynel3D', '../products/products_dynel3D.html']
					   ];
			break;		

			case "downloads":
			asLink = [
			           ['Industry', '../downloads/downloads_industry.html'],
					   ['Academic', '../downloads/downloads_academic.html']
					   ];
			break;

			case "newsroom":
			asLink = [
			           ['Latest News', '../newsroom/newsroom_latestnews.html'],
			           ['Event Calendar', '../newsroom/newsroom_eventcalendar.html'],					   
					   ['Press Book', '../newsroom/newsroom_pressbook.html']
					   ];
			break;

			case "rd":
			asLink = [
			           ['Research', '../rd/rd_research.html'],
			           ['Research Users', '../rd/rd_researchusers.html'],					   
					   ['Publications', '../rd/rd_publications.php'],
   					   ['Forum', 'http://www.igeoss.com/phpBB2/index.php']
					   ];
			break;
			
			case "contact":
			asLink = [
			           ['Contact Us', '../contact/contact_contactus.html'],
					   ['Office Location', '../contact/contact_officelocation.html']
					   ];
			break; 
					  
			default:
			break;
		}
		
		if (!justonetime)
		{
			oSubMenu.innerHTML = getSubMenu(asLink);
			justonetime = true;
		}
	}
}

/*
Construit le sous menu à partir d'un tableau
pasItems est un tableau de [Titre, Lien]
*/
function getSubMenu(pasItems)
{
	var sHTML;
	var i;
	
	sHTML = "";
	for (i=0;i < pasItems.length;i++)
	{
	 sHTML = sHTML + "<a class='submenu_item' href='" + pasItems[i][1] +"'>"+ pasItems[i][0] + "</a>";
	}
	
	return sHTML;	
}

function image_window(url,w,h)
{
	window.open(url,'_blank','location=no, scrollbars=yes, toolbar=no, resizable = yes, width=600,height=480');
}