function desplegaMenu(mostra) {
var e = document.getElementById("fons_interman");
if (mostra == true) {
e.className = "menu_obert";
}
else {
e.className = "menu_tancat";	
}
}


function desplegaMenu_02(mostra) {
var e = document.getElementById("fons_interman_02");
if (mostra == true) {
e.className = "menu_obert_02";
}
else {
e.className = "menu_tancat_02";	
}
}


function desplegaMenu_03(mostra) {
var e = document.getElementById("fons_interman_03");
if (mostra == true) {
e.className = "menu_obert_03";
}
else {
e.className = "menu_tancat_03";	
}
}

function desplegaMenu_04(mostra) {
var e = document.getElementById("fons_interman_04");
if (mostra == true) {
e.className = "menu_obert_04";
}
else {
e.className = "menu_tancat_04";	
}
}


function confirmaEliminar(missatge,adreca){
var m = window.confirm(missatge)
	if (m==true){
	window.location = adreca
	}
}

function confirmaEliminar_submit(missatge,form){
var m = window.confirm(missatge)
	if (m==true){
	document.getElementById(form).submit();
	}
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


/* popup centrat */
function popup(url,windowname,width,height,features) { 
width=(width)?width:screen.width/2; 
height=(height)?height:screen.height/2; 
var screenX = (screen.width/2 - width/2); 
var screenY = (screen.height/2 - height/2); 
if (features) {
var features= "width=" + width + ",height=" + height + "," + features; 	
} 
else {
var features= "width=" + width + ",height=" + height +",scrollbars=yes,status=no,resizable=no"; 
}
features += ",screenX=" + screenX + ",left=" + screenX; 
features += ",screenY=" + screenY + ",top=" + screenY; 

var mywin=window.open(url, windowname, features); 
if (mywin) 
mywin.focus(); 
return mywin; 
} 