var Block=new Array();
var Menu = new Array();
var id=-1;
var ids=-1;
var posi=window.location.href.lastIndexOf("/");
var posf=window.location.href.lastIndexOf("\?");
if (posf>-1){
	var pagina_act=window.location.href.substr(posi+1,posf-posi-1);
} else {
	posf=window.location.href.lastIndexOf("\#");
	if (posf>-1){
		var pagina_act=window.location.href.substr(posi+1,posf-posi-1);
	} else {
		var pagina_act=window.location.href.substr(posi+1,window.location.href.length-posi);
	}
}

Menu[0]=new Array();
Menu[0][0]="l'ajuntament";
Menu[0][1]= new Array();
Menu[0][1][0]="salutaci&oacute; de l'alcalde";
Menu[0][1][1]="salutacio.html";
Menu[0][1][2]="";
Menu[0][2]= new Array();
Menu[0][2][0]="equip de govern";
Menu[0][2][1]="equip.html";
Menu[0][2][2]="";
Menu[0][3]= new Array();
Menu[0][3][0]="oficines";
Menu[0][3][1]="oficines.html";
Menu[0][3][2]="";
Menu[0][4]= new Array();
Menu[0][4][0]="perfil del contractant";
Menu[0][4][1]="perfil_contractant.html";
Menu[0][4][2]="";

Menu[1]=new Array();
Menu[1][0]="el municipi";
Menu[1][1]= new Array();
Menu[1][1][0]="serveis";
Menu[1][1][1]="serveis.html";
Menu[1][1][2]="";
Menu[1][2]= new Array();
Menu[1][2][0]="entitats";
Menu[1][2][1]="entitats.html";
Menu[1][2][2]="";
Menu[1][3]= new Array();
Menu[1][3][0]="hist&ograve;ria";
Menu[1][3][1]="historia.html";
Menu[1][3][2]="";
Menu[1][4]= new Array();
Menu[1][4][0]="localitzaci&oacute;";
Menu[1][4][1]="localitzacio.html";
Menu[1][4][2]="";
Menu[1][5]= new Array();
Menu[1][5][0]="llocs d'inter&egrave;s";
Menu[1][5][1]="interes.html";
Menu[1][5][2]="";

if (pagina_act=="interes_poble.html"){
	id=1; ids=5;
}
if (pagina_act=="interes_rodalies.html"){
	id=1; ids=5;
}

Menu[1][6]= new Array();
Menu[1][6][0]="visita fotogr&agrave;fica";
Menu[1][6][1]="visita.html";
Menu[1][6][2]="";
Menu[1][7]= new Array();
Menu[1][7][0]="bibliografia";
Menu[1][7][1]="bibliografia.html";
Menu[1][7][2]="";
Menu[1][8]= new Array();
Menu[1][8][0]="meteorologia";
Menu[1][8][1]="meteorologia.php";
Menu[1][8][2]="";
if (pagina_act=="meteorologia_2004.html"){
	id=1; ids=8;
}
if (pagina_act=="meteorologia_2005.html"){
	id=1; ids=8;
}
if (pagina_act=="meteorologia_2006.html"){
	id=1; ids=8;
}
if (pagina_act=="meteorologia_2007.html"){
	id=1; ids=8;
}
if (pagina_act=="meteorologia_2008.html"){
	id=1; ids=8;
}
if (pagina_act=="meteorologia_2009.html"){
	id=1; ids=8;
}
if (pagina_act=="meteorologia_2010.html"){
	id=1; ids=8;
}
if (pagina_act=="meteorologia_2011.html"){
	id=1; ids=8;
}
if (pagina_act=="meteorologia_2012.html"){
	id=1; ids=8;
}
Menu[1][9]= new Array();
Menu[1][9][0]="les festes";
Menu[1][9][1]="lesfestes.html";
Menu[1][9][2]="";
Menu[1][10]= new Array();
Menu[1][10][0]="m&eacute;s informaci&oacute;";
Menu[1][10][1]="mesinfo.html";
Menu[1][10][2]="";
Menu[1][11]= new Array();
Menu[1][11][0]="l'Osorenc";
Menu[1][11][1]="osorenc.html";
Menu[1][11][2]="";
Menu[1][12]= new Array();
Menu[1][12][0]="AMPA escola La Vall";
Menu[1][12][1]="/ampa";
Menu[1][12][2]="extern";


Menu[2]=new Array();
Menu[2][0]="l'entorn";
Menu[2][1]= new Array();
Menu[2][1][0]="rieres";
Menu[2][1][1]="rieres.html";
Menu[2][1][2]="";
Menu[2][2]= new Array();
Menu[2][2][0]="flora";
Menu[2][2][1]="flora.html";
Menu[2][2][2]="";
Menu[2][3]= new Array();
Menu[2][3][0]="fauna";
Menu[2][3][1]="fauna.html";
Menu[2][3][2]="";

Menu[3]=new Array();
Menu[3][0]="activitats";
Menu[3][1]= new Array();
Menu[3][1][0]="senderisme";
Menu[3][1][1]="senderisme.html";
Menu[3][1][2]="";
Menu[3][2]= new Array();
Menu[3][2][0]="la pesca";
Menu[3][2][1]="pesca.html";
Menu[3][2][2]="";
//Menu[3][3]= new Array();
//Menu[3][3][0]="la cacera";
//Menu[3][3][1]="cacera.html";
//Menu[3][3][2]="";

//Menu[3][3]= new Array();
//Menu[3][3][0]="astronomia";
//Menu[3][3][1]="astronomia.html";
//Menu[3][3][2]="";

Menu[4]=new Array();
Menu[4][0]="empreses i professionals";
Menu[4][1]= new Array();
Menu[4][1][0]="restaurants";
Menu[4][1][1]="restaurants.html";
Menu[4][1][2]="";
Menu[4][2]= new Array();
Menu[4][2][0]="turisme i lleure";
Menu[4][2][1]="turisme.html";
Menu[4][2][2]="";
Menu[4][3]= new Array();
Menu[4][3][0]="alimentaci&oacute;";
Menu[4][3][1]="alimentacio.html";
Menu[4][3][2]="";
Menu[4][4]= new Array();
Menu[4][4][0]="la fusta";
Menu[4][4][1]="fusta.html";
Menu[4][4][2]="";
Menu[4][5]= new Array();
Menu[4][5][0]="altres";
Menu[4][5][1]="altres.html";
Menu[4][5][2]="";

Menu[5]=new Array();
Menu[5][0]="especials";
Menu[5][1]= new Array();
Menu[5][1][0]="el ball del ciri";
Menu[5][1][1]="ball.html";
Menu[5][1][2]="";
Menu[5][2]= new Array();
Menu[5][2][0]="la fira del senglar";
Menu[5][2][1]="senglar.html";
Menu[5][2][2]="";
//Menu[5][3]= new Array();
//Menu[5][3][0]="tancament mines";
//Menu[5][3][1]="noticies_exposicio_mines.html";
//Menu[5][3][2]="";
//Menu[5][2]= new Array();
//Menu[5][2][0]="postals virtuals";
//Menu[5][2][1]="postals.html";
//Menu[5][2][2]="";
//Menu[5][3]= new Array();
//Menu[5][3][0]="agenda de nadal";
//Menu[5][3][1]="noticies_nadal.html";
//Menu[5][3][2]="";


if (pagina_act=="postals.php"){
	id=5; ids=2;
}



avui=new Date();
var an=avui.getFullYear();
var me=avui.getMonth()*1;
var de=avui.getDate()*1;
me++;
if (me<10) me ="0"+me;
if (de<10) de ="0"+de;
var fe=an+""+me+""+de;
Menu[6]=new Array();
Menu[6][0]="";
Menu[6][1]= new Array();
Menu[6][1][0]="<center><img src=osorenc/img/darrer.gif border=0 alt=\"Darrer número de l'Osorenc\" title=\"Darrer número de l'Osorenc\" width=125 height=175></center>";
Menu[6][1][1]="osorenc.html";
Menu[6][1][2]="nomarge";
//Menu[6][1][0]="<center><img src=img/noticies/casal.jpg border=0 alt=\"Casal d'estiu\" title=\"Casal d'estiu\" width=125 height=174></center>";
//Menu[6][1][1]="noticies_casal_2009.html";
//Menu[6][1][2]="nomarge";
//Menu[6][1][0]="<center><img src=img/firasenglar/fira7.gif border=0 alt=\"Fira del Senglar\" title=\"Fira del Senglar\"><br>JA S'ACOSTA LA FIRA DEL SENGLAR!!!</center>";
//Menu[6][1][0]="<center><img src=img/firasenglar/fira7.gif border=0 alt=\"Fira del Senglar\" title=\"Fira del Senglar\"></center>";
//Menu[6][1][1]="senglar.html";
//Menu[6][1][2]="nomarge";




Menu[7]=new Array();
Menu[7][0]="i a la tardor ...";
Menu[7][1]= new Array();
Menu[7][1][0]="els bolets";
Menu[7][1][1]="http://www.gencat.net/mediamb/pn/bosc/guia_bolets.htm";
Menu[7][1][2]="nomarge_extern";

Menu[8]=new Array();
Menu[8][0]="properament...";
Menu[8][1]= new Array();
 Menu[8][1][0]="la cacera";
 Menu[8][1][1]="alert('En preparació')";
Menu[8][1][2]="javascript";
Menu[8][2]= new Array();
 Menu[8][2][0]="la pesca";
 Menu[8][2][1]="alert('En preparació')";
Menu[8][2][2]="javascript";

Menu[9]=new Array();
Menu[9][0]="El temps a Osor";
Menu[9][1]= new Array();
Menu[9][1][0]="/meteo/meteo.swf?"+Math.random();
Menu[9][1][1]="meteorologia.php";
Menu[9][1][2]="flash";


Menu[10]=new Array();
Menu[10][0]="internet";
Menu[10][1]= new Array();
Menu[10][1][0]="/internet.swf";
Menu[10][1][1]="noticies_internet.html";
Menu[10][1][2]="flash";

// Perque aparegui el titol de noticies en les noticies penjades directament
// a la pagina principal. Aquestes han de tenir aquest id. Aixi no s'ilumina
// cap caixa del lateral 
Menu[11]=new Array();
Menu[11][0]="Carnestoltes";
Menu[11][1]= new Array();
Menu[11][1][0]="<center><img src='img/noticies/carnestoltes_lat_2009.jpg' border=0 alt=\"Carnestoltes 2009\" title=\"Carnestoltes 2009\" width=125 height=177></center>";
Menu[11][1][1]="noticies_carnestoltes_2009.html";
Menu[11][1][2]="nomarge";

Menu[12]=new Array();
Menu[12][0]="Festa del Ter&ccedil;";
Menu[12][1]= new Array();
Menu[12][1][0]="/lateral_terc2009.swf";
Menu[12][1][1]="noticies_terc2009.html";
Menu[12][1][2]="flash";

Menu[13]=new Array();
Menu[13][0]="";
Menu[13][1]= new Array();
Menu[13][1][0]="<center><img src=img/noticies/cartell_truja.gif border=0 alt=\"Teatre a Osor\" title=\"Teatre a Osor\" width=125 height=155></center>";
Menu[13][1][1]="noticies_teatre2.html";
Menu[13][1][2]="nomarge";

if (pagina_act=="copy.html"){
	id=900; ids=1;
}
if (pagina_act=="buscahtml.cgi"){
	id=-2; ids=1;
}

Block[0]=0;
jj=1;
if (fe*1<=20090921){
	Block[jj]=12;
	jj++;
}
if (fe*1<=20100830){
	Block[jj]=6;
	jj++;
}
Block[jj]=1;
jj++;
Block[jj]=9;
jj++;
Block[jj]=2;
jj++;
Block[jj]=5;
jj++;
Block[jj]=3;
jj++;
Block[jj]=4;


//Block[8]=8;
//Block[7]=7;

var colors_menus="#006666";
var colors_fons_menus="#EEEECC";
var colors_menus_actius="#990000";
if (typeof paraules == "undefined") {
	var paraules="";
}
if (id == -1){
	for (var kk=0;kk<Menu.length;kk++){
		for (var kkk=0;kkk<Menu[kk].length;kkk++){
			if (Menu[kk][kkk][1]==pagina_act){
				id=kk;
				ids=kkk;
			}
		}
	}
}
// La pagina no existeix o no necessita els id
if ((pagina_act!="index.php")&&(pagina_act!="")&&(id==-1)){
	id=901; ids=1;
}
if (id==900){
	id=Menu.length;
	ids=1;
	Menu[id]=new Array();
	Menu[id][0]="-1";
	Menu[id][1]=new Array();
	Menu[id][1][0]="Nota ";
	Menu[id][1][1]="copy.html";
	Menu[id][1][2]="";
}
if (id==901){
	id=Menu.length;
	ids=1;
	Menu[id]=new Array();
	Menu[id][0]="-1";
	Menu[id][1]=new Array();
	Menu[id][1][0]="Error";
	Menu[id][1][1]="titerror";
	Menu[id][1][2]="";
}

function overTD(nom,color){
	var obj = document.getElementById(nom);
	obj.style.cursor='hand';
	obj.style.borderColor=color;
}
function clickTD(nom){
	var obj = document.getElementById(nom);
	window.document.location.href=obj.getElementsByTagName("A")[0].href;
}
function clickTD_ext(url){
	window.open(url);
}
function posa_taula(ample,classe,titol,posicio,nom,tipus){
	if (typeof posicio == "undefined"){
		posicio=0;
	}
	var a2=ample-2;
	var a3=a2-4;
	if (typeof nom == "undefined"){
		document.write('<TABLE cellpadding=0 cellspacing=0 border=0 style="height:10px;width:'+ample+'px">\n');
	} else {
		document.write('<TABLE cellpadding=0 cellspacing=0 border=0 style="height:10px;width:'+ample+'px" id="'+nom+'" style="'+tipus+'">\n');
	}
	document.write('<TR valign="top">\n');
	document.write('	<TD colspan=5 class="'+classe+'"><img src="img/trans.gif" width='+ample+' height=1 border=0></TD>\n');
	if (posicio == "0"){
		document.write('</TR><TR valign="top">\n');
		document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
		document.write('	<TD colspan=3><img src="img/trans.gif" width='+a2+' height=2 border=0></TD>\n');
		document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
		document.write('</TR><TR valign="middle">\n');
		document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
		document.write('	<TD><img src="img/trans.gif" width=2 height=2 border=0></TD>\n');
		document.write('	<TD align=center style="width:'+a3+'px;height:18px" class="'+classe+'"><span class="titol_menu_prin">'+titol+'</span></TD>\n');
		document.write('	<TD><img src="img/trans.gif" width=2 height=2 border=0></TD>\n');
		document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
	}
	document.write('</TR><TR valign="top">\n');
	document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
	document.write('	<TD colspan=3><img src="img/trans.gif" width='+a2+' height=2 border=0></TD>\n');
	document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
	document.write('</TR><TR valign="top">\n');
	document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
	document.write('	<TD><img src="img/trans.gif" width=2 height=2 border=0></TD>\n');
	document.write('	<TD style="width:'+a3+'px;height:5px" align=center>');
}
function tanca_taula(ample,classe,titol,posicio,sublinia,mare){
	if (typeof sublinia == "undefined"){
		sublinia="";
	}
	if (typeof mare == "undefined"){
		mare=0;
	}
	if (typeof posicio == "undefined"){
		posicio=-1;
	}
	var a2=ample-1;
	var a3=a2-4;
	document.write('	</TD>\n');
	document.write('	<TD><img src="img/trans.gif" width=2 height=2 border=0></TD>\n');
	document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
	document.write('</TR><TR valign="middle">\n');
	if (posicio == "0"){
		document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
		document.write('	<TD><img src="img/trans.gif" width=2 height=2 border=0></TD>\n');
		document.write('	<TD style="width:'+a3+'px;height:18px" class="'+classe+'"><span class="titol_foto" style="width:'+a3+'px">'+titol+'</span>');
		if (sublinia != ""){
			if (mare == 0){
				document.write('<span class="peu_foto"><A class=texte_blanc href="copy.html">'+sublinia+'</A></span>');
			} else {
				document.write('<span class="peu_foto"><A class=texte_blanc href="#" OnClick="opener.location.href=\'/copy.html\';self.close()">'+sublinia+'</A></span>');
			}
		}
		document.write('</TD>\n');
		document.write('	<TD><img src="img/trans.gif" width=2 height=2 border=0></TD>\n');
		document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
		document.write('</TR><TR valign="top">\n');
		document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
		document.write('	<TD colspan=3><img src="img/trans.gif" width='+a2+' height=2 border=0></TD>\n');
		document.write('	<TD class="'+classe+'"><img src="img/trans.gif" width=1 height=2 border=0></TD>\n');
		document.write('</TR><TR valign="top">\n');
	} 
	document.write('	<TD colspan=5 class="'+classe+'"><img src="img/trans.gif" width='+ample+' height=1 border=0></TD>\n');
	document.write('</TR></TABLE>');
}


function posa_navegador(quin,ample,classe){
		document.write('<table width="100%" cellpadding=0 border=0 cellspacing=0><TR>\n');
		document.write('<TD><img src="img/trans.gif" width=4 height=5 border=0></TD>\n');

		document.write('<TD><img src="img/trans.gif" width=1 height=5 border=0>');
		posa_taula(ample,classe,"",-1);
		document.write('<table width="100%" cellpadding=0 cellspacing=2>\n');
		if ((quin == "0")||(quin=="2")){
			document.write('	<TR valign=middle style="height:15px" class="fons_menu">\n');
			document.write('		<TD id="pagprin" class="fons_opcio_menu" OnMouseOver="overTD(\'pagprin\',\''+colors_menus+'\');window.status=\'Tornar a la pàgina principal\';return true;" OnMouseOut="overTD(\'pagprin\',\''+colors_fons_menus+'\');window.status=\'\';return true;" OnClick="clickTD(\'pagprin\');"><A href="/index.php" class="opcio_menu_prin">inici</A></TD>\n');
			document.write('	</TR>');
		}
		if ((quin == "1")||(quin=="2")){
			document.write('	<TR valign=middle style="height:15px" class="fons_menu">\n');
			document.write('		<TD id="enrere" class="fons_opcio_menu" OnMouseOver="overTD(\'enrere\',\''+colors_menus+'\');window.status=\'Tornar a la pàgina anterior\';return true;" OnMouseOut="overTD(\'enrere\',\''+colors_fons_menus+'\');window.status=\'\';return true;" OnClick="clickTD(\'enrere\');"><A href="javascript:window.history.go(-1)" class="opcio_menu_prin">enrere</A></TD>\n');
			document.write('	</TR>');
		}
		document.write('	</TABLE>\n');
		tanca_taula(ample,classe,"",-1);
		document.write('</TD></TR></TABLE>');
}

function posa_menu(i,classe){
	if (Menu[i][0]==""){
		posa_taula(152,classe,Menu[i][0],-1);
	} else {
		posa_taula(152,classe,Menu[i][0]);
	}
	document.write('<table width="100%" cellpadding=0 cellspacing=0>\n');
	for (var j=1;j<Menu[i].length ;j++ ){
		if ((i==id)&&(j==ids)) {
			classeb="fons_opcio_menu_actiu";
			colo=colors_menus_actius;
		} else {
			classeb="fons_opcio_menu";
			colo=colors_fons_menus;
		}
		re=/\'/gi;
		ri=/\"/gi;
		var texte2=Menu[i][j][0].replace(re, "\\\'");
		document.write('	<TR valign=middle style="height:15px">\n');
		if (Menu[i][j][2] != "") {
			switch (Menu[i][j][2]) {
				case "javascript":
				document.write('		<TD id="link'+i+''+j+'" class="'+classeb+'" OnMouseOver="overTD(\'link'+i+''+j+'\',\''+colors_menus+'\');window.status=\''+texte2+'\';return true;" OnMouseOut="overTD(\'link'+i+''+j+'\',\''+colo+'\');window.status=\'\';return true;" OnClick="'+Menu[i][j][1]+'"><A href="#" class="opcio_menu_prin">'+Menu[i][j][0]+'</A></TD>\n');
				break;
				
				case "flash":
				document.write('		<TD align=center id="link'+i+''+j+'" class="'+classeb+'" OnMouseOver="overTD(\'link'+i+''+j+'\',\''+colors_menus+'\');window.status=\''+texte2+'\';return true;" OnMouseOut="overTD(\'link'+i+''+j+'\',\''+colo+'\');window.status=\'\';return true;">');
				document.write('<center><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="140" height="175" id="muflons" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+Menu[i][j][0]+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#EEEECC" /><embed src="'+Menu[i][j][0]+'" quality="high" wmode="transparent" bgcolor="#EEEECC" width="140" height="175" name="muflons" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></center>');
				document.write('</TD>\n');
				break;
				
				case "nomarge":
				document.write('		<TD id="link'+i+''+j+'" class="'+classeb+'" OnMouseOver="window.status=\'\';return true;" OnMouseOut="window.status=\'\';return true;" OnClick="clickTD(\'link'+i+''+j+'\');"><A href="'+Menu[i][j][1]+'"  class="opcio_menu_prin">'+Menu[i][j][0]+'</A></TD>\n');
				break;

				case "noenllac":
				document.write('		<TD class="'+classeb+'"><span class="peu"><span class="bold">'+Menu[i][j][0]+'</span></span></TD>\n');
				break;

				case "nomarge_extern":
				document.write('		<TD id="link'+i+''+j+'" class="'+classeb+'" OnMouseOver="window.status=\'\';return true;" OnMouseOut="window.status=\'\';return true;" OnClick="clickTD_ext(\''+Menu[i][j][1]+'\');"><A href="#"  class="opcio_menu_prin">'+Menu[i][j][0]+'</A></TD>\n');
				break;

				default:
				document.write('		<TD id="link'+i+''+j+'" class="'+classeb+'" OnMouseOver="overTD(\'link'+i+''+j+'\',\''+colors_menus+'\');window.status=\''+texte2+'\';return true;" OnMouseOut="overTD(\'link'+i+''+j+'\',\''+colo+'\');window.status=\'\';return true;" OnClick="clickTD_ext(\''+Menu[i][j][1]+'\');"><A href="#" class="opcio_menu_prin">'+Menu[i][j][0]+'</A></TD>\n');
				break;
			}
		} else {
			document.write('		<TD id="link'+i+''+j+'" class="'+classeb+'" OnMouseOver="overTD(\'link'+i+''+j+'\',\''+colors_menus+'\');window.status=\''+texte2+'\';return true;" OnMouseOut="overTD(\'link'+i+''+j+'\',\''+colo+'\');window.status=\'\';return true;" OnClick="clickTD(\'link'+i+''+j+'\');"><A href="'+Menu[i][j][1]+'" class="opcio_menu_prin">'+Menu[i][j][0]+'</A></TD>\n');
		}
		document.write('	</TR>');
		document.write('</TR><TR valign=top class="fons_manu">\n');
		document.write('	<TD><img src="img/trans.gif" width=1 height=1 border=0></TD>\n');
		document.write('</TR>');
	}
	document.write('	</TABLE>\n');
	tanca_taula(152,classe);
}

function posa_menus(classe, classe_activa){
	var menu_actiu=id;
	
//	for (var i=0;i<Menu.length ;i++ ){
	for (var k=0;k<Block.length ;k++ ){
		var i=Block[k];
		if (Menu[i][0] != "-1"){
			document.write('<TR valign=top class="fons_menu">\n');
			document.write('	<TD align=center>');
			if (i==menu_actiu){
				posa_menu(i,classe_activa);
			} else {
				posa_menu(i,classe);
			}
			document.write('	</TD>\n');
			document.write('</TR><TR valign=top classs="fons_menu">\n');
			document.write('	<TD><img src="img/trans.gif" width=165 height=5 border=0></TD>\n');
			document.write('</TR>');
		}
	}
	document.write('</TR><TR valign=top class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<A href="/noticies_joventut.php"><img src="img/joventut2.gif" width=149 height=72 alt="Servei de noticies del departament de joventut" title="Servei de noticies del departament de joventut" border=0></A></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center><img src="/img/trans.gif" height=2></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<A href="/noticies_ter_brugent.html"><img src="img/mancomunitat.gif" width=149 height=72 alt="Notícies de la Mancomunitat Ter Brugent" title="Notícies de la Mancomunitat Ter Brugent" border=0></A></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center><img src="/img/trans.gif" height=5></TD>');
	document.write('</TR><TR valign=top class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<A href="noticies_hotspot.html"><img src="img/hotspotosor.jpg" width=150 height=122 alt="Hotspot d\'Osor" title="Hotspot d\'Osor" border=0></A></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center><img src="/img/trans.gif" height=10></TD>');
	document.write('</TR><TR valign=top class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<A href="http://www.selvatributs.cat/entitats/entitats.php?id_muni=14" target="_blank"><img src="img/tributs.jpg" width=149 height=72 alt="Gestió Tributària" title="Gestió Tributària" border=0></A></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center><img src="/img/trans.gif" height=10></TD>');
	//document.write('</TR><TR valign=top class="fons_menu">\n');
	//document.write('	<TD align=center>');
	//document.write('<A href="/astronomia.html"><img src="img/astro.gif" width=152 height=42 alt="Astronomia" title="Astronomia" border=0></A></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center><img src="/img/trans.gif" height=10></TD>');
	document.write('</TR><TR valign=top class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<A href="http://www.stacks.es/esalus/LoginCitaAPIAS.aspx" target="_blank"><img src="img/aprimaria.gif" width=152 height=54 alt="Demanar cita prèvia a Atenció Primària" title="Demanar cita prèvia a Atenció Primària" border=0></A></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center><img src="/img/trans.gif" height=1></TD>');
	document.write('</TR><TR valign=top class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<A href="http://www.ias.scs.es/convocatoria/citaweb.pdf" target="_blank"><img src="img/aprimariapdf.gif" width=152 height=49 alt="Manual per demanar cita prèvia a Atenció Primària" title="Manual per demanar cita prèvia a Atenció Primària" border=0></A></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center><img src="/img/trans.gif" height=10></TD>');
	document.write('</TR><TR valign=top class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<A href="http://www.selva.compartir.org" target="_blank"><img src="img/cotxe.gif" width=152 height=42 alt="Compartir cotxe" title="Compartir cotxe" border=0></A></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center>&nbsp;</TD>');
	document.write('</TR><TR valign=top class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<A href="copy.html" class="texte_negre"><img src="img/catmeteo.gif" border=0 usemap="#informacio" ALT="Informació General" TITLE="Informació General"></A>');
	document.write('<map name="informacio">');
	document.write('<area shape="rect" coords="0,0,61,36" alt="Catalunya Informació" title="Catalunya Informació" href="http://www.catalunyainformacio.cat/pnoticies/notComarques.jsp?seccio=CSELVA" target="_blank">');
	document.write('<area shape="rect" coords="89,0,140,36" alt="Previsió Meteorològica" title="Previsió Meteorològica" href="http://www.meteocat.com" target="_blank">');
	document.write('<area shape="default" ALT="Informació General" TITLE="Informació General" nohref></map></TD>');
	document.write('</TR><TR valign=top  class="fons_menu">\n');
	document.write('	<TD align=center>&nbsp;</TD>');
	document.write('</TR><TR valign=top  style="height:100%" class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<span class="texte"><A href="copy.html" class="texte_negre">AVÍS LEGAL</A></span></TD>');
	//document.write('</TR><TR valign=top style="height:100%" class="fons_menu">\n');
	//document.write('	<TD align=center>');
	//document.write('<span class="texte"><A href="javascript:popup_1(\'http://www.osor.cat/dinastats2/dinastats.pl?output=main&lang=ca\')" class="texte_negre">estadístiques</a></span></TD>');
	//document.write('</TR><TR valign=top style="height:100%" class="fons_menu">\n');
	//document.write('	<TD align=center><hr width=100>');
	//document.write('<span class="peu_foto_negre"><A href="http://www.webviva.com" target="_blank" class="texte_negre">Web creada gratu&iuml;tament per<br>Web Viva</a></span></TD>');
	document.write('</TR>');
}
function obre_continguts(titol,nom,tipus){
	document.write('	</TR><TR valign=top>\n');
	document.write('		<TD align=center colspan=2>\n');
	posa_taula(525,"fons_taula_menu",titol,0,nom,tipus);
}
function tanca_continguts(){
	tanca_taula(525,"fons_taula_menu");
	document.write('		</TD>\n');
	document.write('	</TR>\n');
}
function separacio_continguts(){
	document.write('	<TR valign=top>\n');
	document.write('		<TD align=center colspan=2>&nbsp;</TD>\n');
}
function Obre_Pagina(titol){
	avui=new Date();
	var an=avui.getFullYear();
	var me=avui.getMonth()*1;
	var de=avui.getDate()*1;
	me++;
	if (me<10) me ="0"+me;
	if (de<10) de ="0"+de;
	var fe=an+""+me+""+de;
	if ((fe*1<20100111)&&(fe*1>20091209)){
		document.write('<div id="flash" style="position:absolute;top:0px;left:50%;width:700px;margin-left: -350px"><center><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"  WIDTH="700" HEIGHT="75" id="nadal" ALIGN=""> <PARAM NAME=movie VALUE="/nadal2009.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="/nadal2009.swf" quality=high wmode=transparent bgcolor=#FFFFFF  WIDTH="700" HEIGHT="75" NAME="nadal" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></center></div>');
	}
	if (typeof titol=="undefined") titol="";
	document.write('<center>\n');
	document.write('<TABLE cellpadding=0 cellspacing=0 style="width:700px;height:100%"  border=0 class="principal">\n');
	document.write('<TR valign=top>\n');
	document.write('	<TD><TABLE cellpadding=0 cellspacing=0 border=0 style="width:165px;height:100%" class="fons_menu">\n');
	document.write('	<TR valign=top>\n');
	document.write('		<TD class="cap"><img src="img/titol.gif" width=165 height=75 border=0></TD>\n');
	document.write('	</TR><TR valign=top>\n');
	document.write('		<TD class="fons_menu"><img src="img/trans.gif" width=165 height=2 border=0></TD>\n');
	document.write('	</TR>\n');
	document.write('<form method="POST" action="/cgi-osor/buscahtml/buscahtml.cgi"><TR valign=bottom class="fons_menu">\n');
	document.write('	<TD align=center>');
	document.write('<input type=text name=palabras value="'+paraules+'" style="width:120px;height:18px;font-size:12px"><input alt="Recerca per paraula clau" title="Recerca per paraula clau" type=image src="img/cercar.gif" width=17 height=17>');
	document.write('	</TD>\n');
	document.write('</TR></form>');
	document.write('	</TR><TR valign=top>\n');
	document.write('		<TD class="fons_menu" align=center><img src="img/trans.gif" width=165 height=2 border=0></TD>\n');
	document.write('	</TR>\n');
	posa_menus("fons_taula_menu","fons_taula_menu_actiu");
	document.write('	</TABLE></TD>\n');
	document.write('	<TD width=535 class="fons_menu"><table border=0 style="height=54px;width:100%" cellspacing=0 cellpadding=0 class="fons_menu">\n');
	//document.write('	<TR valign=top><td width=165 align=left background="img/terc1.gif" style="cursor:hand" OnClick="window.location.href=\'noticies_terc2005.html\'"">\n');
	document.write('	<TR valign=top><td width=165 align=left>\n');
	if (id>-1){
		posa_navegador(2,75,"fons_taula_menu");
	} else {
		document.write('		&nbsp;');
	}
	document.write('		</td>\n');
	if (id==-1)	{
		imatge="benvinguts";
	} else {
		if (id == -2){
			imatge="cercador";
		} else {
			if (id == 999999){
				imatge="gracies";
			} else {
				tempo=Menu[id][ids][1].split("\_");
				tempo=tempo[0].split("\.");
				imatge=tempo[0];
			}
		}
	}
	//document.write('		<TD align=right width=370 background="img/terc2.gif" style="cursor:hand" OnClick="window.location.href=\'noticies_terc2005.html\'"><img src="img/'+imatge+'.gif" width=270 height=54 border=0 ALT="Festa del Terç 2005" Title="Festa del Terç 2005"></TD>\n');
	document.write('		<TD align=right width=370><img src="img/'+imatge+'.gif" width=270 height=54></TD>\n');
	obre_continguts(titol);
}

function Tanca_Pagina(){
	tanca_continguts();
	document.write('	</TABLE>\n');
	document.write('	<img src="img/trans.gif" width=165 height=5 border=0></TD>\n');
	document.write('</TR>\n');
	document.write('<TR><td colspan=2>&nbsp;</td></TR>\n');
	document.write('</TABLE>\n');
}
function Tanca_Pagina_principal(){
	tanca_continguts();
	document.write('	</TABLE>\n');
	document.write('	<img src="img/trans.gif" width=165 height=5 border=0></TD>\n');
	document.write('</TR>\n');
}
function Posa_opcions_interes(){
	document.write('<center>');
	document.write('<table width="200" cellpadding=0 cellspacing=2>');
	document.write('<TR valign=middle style="height:15px">');
	document.write('<TD align=center id="alpo" class="fons_opcio_menu" OnMouseOver="overTD(\'alpo\',\''+colors_menus+'\');window.status=\'Al poble\';return true;" OnMouseOut="overTD(\'alpo\',\''+colors_fons_menus+'\');window.status=\'\';return true;" OnClick="clickTD(\'alpo\')"><A href="interes_poble.html" class="opcio_menu_prin">Al poble</A></TD>');
	document.write("</TR><TR>");
	document.write('<TD align=center id="alesr" class="fons_opcio_menu" OnMouseOver="overTD(\'alesr\',\''+colors_menus+'\');window.status=\'A les rodalies\';return true;" OnMouseOut="overTD(\'alesr\',\''+colors_fons_menus+'\');window.status=\'\';return true;" OnClick="clickTD(\'alesr\')"><A href="interes_rodalies.html" class="opcio_menu_prin">A les rodalies</A></TD>');
	document.write('</TR>');
	document.write('</TABLE>');
	document.write('</center>');
}
function popup_1(pagina){
	var finestra=window.open(pagina,'','width=800,height=600,scrollbars=yes,resizable=yes');
}
