// definim els estats dels menu

var Mestat = new Array(0,0,0,0,0,0,0,0);
var detect = navigator.userAgent.toLowerCase();
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function Obre(me)
{
		x = document.getElementById('m'+me).style;
		k = document.getElementById('m'+me);
		Mestat[me-1] = 1;
		
		if (checkIt('msie')) x.height = "0px";
		else x.height = "auto";
		
			
		parent.document.getElementById('lm'+me).href="javascript:Tanca('"+me+"')";
		parent.document.getElementById('imgm'+me).src = "imatges/nov01.gif";
		
}

function Tanca(me)
{
		x = document.getElementById('m'+me).style;
		x.height = "1px";
		Mestat[me-1] = 0;
		parent.document.getElementById('lm'+me).href="javascript:Obre('"+me+"')";
		parent.document.getElementById('imgm'+me).src = "imatges/nov.gif";
}

function SendUrl(url)
{
		// acabem de composar la url
		url += '&mestat='+Mestat.toString();
		document.location.href = url;
		
}