////////////////////////////////////
// WHADS-ACCENT, S.L
// www.whads.com


//fondoCab = new Image();
//fondoCab.src = "img/fondo_grupo_menu.gif";

	
function menuCab() {
	var st='';
	var i;

	st+='<table cellspacing="5" cellpadding="0" border="0">';
	st+='<tr>';
	for (i in ps) {
		if (i!='_nom' && i!='plat') {
		st+='<td class="a11bl" nowrap>';
			if (i!=blocs[0]) {
				st+='&nbsp;|&nbsp;&nbsp;<a href="'+ i + '_' + primerObj(ps[i]) +'.htm" class="linkCAP" rel="section">'+ps[i]._nom;+'</a>';
			}else{
				st+='&nbsp;|&nbsp;&nbsp;'+ps[i]._nom + '';
			}
		st+='</td>';
		}
	}
	st+='<td class="a11bl" nowrap>&nbsp;|&nbsp;&nbsp;<a href="mailto:comunicacio@tercersector.cat?subject=07" class="linkCAP">Contacta</a></td>'
	st+='<td class="a11bl" nowrap>&nbsp;|&nbsp;&nbsp;<a href="default.htm" class="linkCAP" rel="start" accesskey="0">Inici</a>&nbsp;&nbsp;|&nbsp;</td>'
	st+='</tr>';
	st+='</table>';
	return st;
}

function menu() {
	var st='';
	var i,j;
	
	st += '<img src="img/cp.gif" alt="" width="1" height="15" border="0"><br>'; 
	st += '<table width="100%" cellspacing="0" cellpadding="2" border="0" summary="submenús">';
	for (i in ps) {
		if (i!='_nom') {
			if (i==blocs[0]){
				st += '<td width="1%" class="a14ne"><img src="img/cp.gif" alt="" width="5" height="1" border="0"></td>';
				st += '<td width="1%"class="a14ne"><img src="img/cp.gif" alt="" width="5" height="1" border="0"></td>'; 
				st += '<td width="99%" class="a14ne"><h2>'+ps[i]._nom;+'</h2></td>';
				var obj = ps[i]
				if (j!='_nom') {
					lobj = 'ps.' + blocs[0]
					var obj = eval(lobj);
					for (i in obj) {
						st += '<tr>';
						if (i!='_nom') {
							if (blocs[1]!=i) {
								st += '<td class="a14ne"><img src="img/cp.gif" alt="" width="5" height="1" border="0"></td>';
								st += '<td class="a11ne" valign="top"><img src="img/mnu_fletxa_off.gif" border="0"></td>'; 
								st += '<td class="a11ne"><a href="'+blocs[0]+'_'+i+'.htm" class="linkMENU" rel="chapter">'+eval(lobj + '.' + i + '._nom') + '</a></td>';
							}else{
								st += '<td class="a14ne"><img src="img/cp.gif" alt="" width="5" height="1" border="0"></td>';
								st += '<td class="a11ne" valign="top"><img src="img/mnu_fletxa_on.gif" border="0"></td>'; 
								st += '<td class="a11vl"><h3>'+eval(lobj + '.' + i + '._nom') + '</h3></td>';
							}
						}
						st += '</tr>';
					}					
				}
			}
		}
	}
	st += '</table>';
	st += '<br>';
	return(st);
}

function primerObj(obj) {
	var i
	for (i in obj) {
		if (i!='_nom') return i;
	}
}


var docName;
var blocs= new Array();
var maxArray = 8
var nOps = 0;

function getBlocs(url,blocsArray,pillaUltim) {
	var i,j;
	var doc='';
	var pu=0,su=0;

	doc = url + '';
	if (doc.indexOf('?')!=-1) doc = doc.substring(0,doc.indexOf('?'));
	for(i=0;i<maxArray;i++) blocsArray[i]='';
	pu=doc.lastIndexOf('/');
	if (pu<0) pu=doc.lastIndexOf('\\');
	nOps=0;
	su=doc.indexOf("_",pu+1);
	while (su>=0) {
		blocsArray[nOps]=doc.substring(pu+1,su);
		pu=su;
		nOps++;
		su=doc.indexOf("_",pu+1);
	}
	if (pillaUltim)	{
		su=doc.indexOf(".",pu+1)
		blocsArray[nOps++]=doc.substring(pu+1,su);
	}
	for (j=nOps;j<maxArray;j++) blocsArray[j]='';
}

getBlocs(document.location.href,blocs,true);