var expandedAll = true;

var tabrefs = new Array();
tabrefs["profilo-della-camera"] = "section1";
tabrefs["contatti"] = "section1";
tabrefs["statuto"] = "section1";
tabrefs["staff"] = "section1";
tabrefs["cda"] = "section1";
tabrefs["colleggio-dei-revisori"] = "section1";
tabrefs["cosa-facciamo"] = "section2";
tabrefs["richiesta-servizio"] = "section2";
tabrefs["pubblicazioni"] = "section3";
tabrefs["camic-magazine"] = "section3";
tabrefs["camic-newsletter"] = "section3";
tabrefs["country-overview"] = "section3";
tabrefs["newsletter-europea"] = "section3";
tabrefs["studi-settoriali-download"] = "section3";
tabrefs["studi-settoriali"] = "section3";
tabrefs["prossimi-eventi"] = "section4";
tabrefs["eventi-precedenti"] = "section4";
//tabrefs["progetti-attuali"] = "section5";
//tabrefs["progetti-passati"] = "section5";
tabrefs["notizie"] = "section6";
tabrefs["elenco-soci"] = "section7";
tabrefs["richiesta-d-adesione"] = "section7";
//tabrefs["pubblicita"] = "section7";
tabrefs["member-to-member"] = "section7";
//tabrefs["candidature"] = "section7";
//tabrefs["studi-settoriali"] = "section7";
//tabrefs["studi-settoriali-html"] = "section7";
tabrefs["annunci-commerciali"] = "section8";
tabrefs["offerte-di-lavoro"] = "section8";
tabrefs["lavoro"] = "section8";
tabrefs["bacheca-cv"] = "section8";
//tabrefs["contatti"] = "section8";
tabrefs["indirizzi-utili"] = "section9";
//tabrefs["rappresentanze"] = "section11";
//tabrefs["links"] = "section10";
tabrefs["mappa-del-sito"] = "section11";
tabrefs["faq"] = "section12";
tabrefs["download"] = "section13";
tabrefs["attivita-e-servizi"] = "section14";
tabrefs["fondi-strutturali"] = "section14";
tabrefs["sportello-europeo-download"] = "section14";

var url = ""+document.location;
pos1 = url.lastIndexOf ("/")+1;
pos = url.indexOf(".", pos1);
url = url.substring(pos1,pos);
if (url == "RenderTable")
{
	var url = ""+document.location;
	pos1 = url.indexOf("TabRef=")+7;
	url = url.substring(pos1);
}

function menuAll()
{
	for (var i = 1; i <= 14; i++)
	{
		var obj = document.getElementById("section"+i);
		if (obj!=null)
			obj.style.display = (expandedAll) ? "none" : "block";
	}
	expandedAll = !expandedAll;
	if (!expandedAll)
		menuSection(url);
	
	document.getElementById("expandicon").src = (expandedAll) ? "images/button_menu_collapse.gif" : "images/button_menu_expand.gif";
}

function menuSection(tabref)
{
	var obj = document.getElementById(tabrefs[tabref]);
	if (obj!=null)
		obj.style.display = (obj.style.display=="none") ? "block" : "none";
}