function buit(){;}

function redirecciona(url){
	window.location = url;
}

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 popup(url,windowname,width,height,scrollbars,features) {
	width=(width)?width:screen.width/2;
	height=(height)?height:screen.height/2;
	scrollbars=(scrollbars)?scrollbars:'no';
	var screenX = (screen.width/2 - width/2);
	var screenY = (screen.height/2 - height/2);
	var features= "width=" + width + ",height=" + height +",scrollbars=" + scrollbars + ",status=no";
	features += ",screenX=" + screenX + ",left=" + screenX;
	features += ",screenY=" + screenY + ",top=" + screenY;
	
	var mywin=window.open(url, windowname, features);
	if (mywin)
	mywin.focus();
	return mywin;
}

function actionform(action,formulari){
	var f=document.getElementById(formulari);
	f.action=action;
	f.submit();
}

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();
	}
}

/*confirma eliminació de grup*/
function confirmEliminacioGrup(idGrup, lloc){
	if ( confirm("Segur que vols eliminar el grup?") ){
		window.location = lloc;
	} else {
		history.back();
	}
}

/*tancarActualitzar*/	
function tancarActualitzar() {
	opener.window.location.reload();
	self.close();
	return false;
}

function substitueix_arxiu2(nom_in,fitxer_original) {
	var d= document.getElementById(''+nom_in+'');
	d.innerHTML = "<div style='width:300px;'><input type='hidden' name='tipus_fitxer_" + nom_in + "' value='foto'><input type='hidden' name='eliminar" + nom_in + "' value='"+fitxer_original+"'><input name='"+ nom_in +"' type='file' class='camps'></div>";
}

function eliminar_arxiu2(nom_in,fitxer_original,missatge) {
	var d= document.getElementById(''+nom_in+'');
	d.innerHTML = "<input type='hidden' name='eliminar" + nom_in + "' value='"+fitxer_original+"'><h3 style='color:red;'>" + missatge + "</h3>";
}

/*funcio que envia el formulari de grup depenent de dues opcions*/
function enviaForm(grup){

	if ( grup != "no" ) {
		if ( grup == "index.php?contingut=37&apartat=nou_grup" ) {
			window.location = grup;
		} else {
			document.formulari_az.action = "index.php?contingut=37&apartat=afegir_al_grup&pest=2";
			document.formulari_az.submit();
		}
	}

}

