var arrayMenu=new Array();

arrayMenu[0]= new omplaMenuDalt("inicio","home",70,"index.php");
arrayMenu[1]= new omplaMenuDalt("¿cómo llegar?","how to arrive?",125,"get.php");
arrayMenu[2]= new omplaMenuDalt("servicios","services",85,"serveis.php");
arrayMenu[3]= new omplaMenuDalt("barcos","boats",80,"carac.php");
arrayMenu[4]= new omplaMenuDalt("reservas","booking",90,"reserves.php");
arrayMenu[5]= new omplaMenuDalt("tarifas","rates",80,"tarifes.php");
arrayMenu[6]= new omplaMenuDalt("contactar","contact",200,"contacte.php");
arrayMenu[7]= new omplaMenuDalt("mapa web","site map",120,"mapa.php");
arrayMenu[8]= new omplaMenuDalt("zona privada","private zone",120,"login.php");
arrayMenu[9]= new omplaMenuDalt("castellano","castellano",100,"es");
arrayMenu[10]= new omplaMenuDalt("english","english",100,"en");



function omplaMenuDalt(nom0,nom1,ampla,enllas)
{
	this.nom0=nom0
	this.nom1=nom1
	this.ampla=ampla
	this.enllas=enllas
}

function escriureAnunci(p)
{
	
	var prof=""
	for (i=0;i<p;i++)
		prof=prof+"../"

	var negreta=Math.round(Math.random()*9)
	
	var perEscriure='<table cellpadding="0" cellspacing="0" border="0" align="center">'+
						'<tr>'+
							'<td class="texteAnunci">'+
								tituloFrases +
							'</td>'+
						'</tr>'+
						'<tr><td class="texteAnunci">&nbsp;</td></tr>'+
						'<tr>'+
							'<td class="texteAnunci">'+
								'<img src="'+prof+'img/puntLlista.jpg"> <b>'+arrayFrases[negreta]+'</b>'+
							'</td>'+
						'</tr>'+
					'</table>'
		
	document.getElementById('tdAnunci').innerHTML=perEscriure;
}

function escriurePeuPagina(p,idioma,nota)
{
	
	var prof=""
	for (i=0;i<p;i++)
		prof=prof+"../"
	var con=0;

	var perEscriure='<table cellpadding="2" cellspacing="0" border="0" align="center">'+
						'<tr>'
	for (i=0;i<arrayMenu.length;i++)
	{
		if (i<9)
		{
			perEscriure=perEscriure+'<td class="peuPagina" align="left" nowrap>'
			if (i!=0)
				perEscriure=perEscriure+'&nbsp;|&nbsp;'
			perEscriure=perEscriure+'<a href="'+prof+''+arrayMenu[i].enllas+'">'+eval('arrayMenu[i].nom'+idioma)
			con++
		}
	}
	perEscriure=perEscriure+'</td>'+
			'</tr>'+
			'<tr><td class="peuPagina" colspan="'+con+'" align="center">&nbsp;<a href="JavaScript:obraFinestraContracte(\'AvisLegal\',\'\')">'+nota+'</a>&nbsp;&copy; 2006 Original Flat Barcelona.'+
			'</td></tr>'+
		'</table>'
		
	document.getElementById('tdPeuPagina').innerHTML=perEscriure;
}


function escriureMenu(onEstic,idioma,p)
{
	var prof=""
	for (i=0;i<p;i++)
		prof=prof+"../"
		
	var perEscriure="<table cellpadding='0' cellspacing='0' border='0' width='100%'><tr>"
	
	for (i=0;i<arrayMenu.length;i++)
	{
		if (i==0)
		{
			perEscriure=perEscriure+'<td width="'+arrayMenu[i].ampla+'" align="left"style="padding-left:4px; background:url('+prof+'img/fonsSupEsq.gif) fixed top left no-repeat">'
			if (i==onEstic) perEscriure=perEscriure+'<span class="book">&nbsp;<img src="'+prof+'img/puntLlista.jpg">&nbsp;<a href="'+prof+''+arrayMenu[onEstic].enllas+'" class="cos"><b>'+eval('arrayMenu[i].nom'+idioma)+'</b></a></td>'
			else
				perEscriure=perEscriure+'<span class="book">&nbsp;<img src="'+prof+'img/puntLlista.jpg">&nbsp;<a href="'+prof+''+arrayMenu[i].enllas+'" class="cos">'+eval('arrayMenu[i].nom'+idioma)+'</a></td>'
		}
		else if ((i==9)||(i==10))  //idiomes
		{
			if (i!=9+idioma)
			{
				
				perEscriure=perEscriure+'<td width="'+arrayMenu[i].ampla+'" align="left"style="padding-left:4px; background:url('+prof+'img/fonsSupDre.gif) fixed top right no-repeat">'
				if (onEstic>=0) perEscriure=perEscriure+'<span class="book">&nbsp;<img src="'+prof+'img/puntLlista.jpg">&nbsp;<a href="/establirIdioma.php?page='+arrayMenu[onEstic].enllas+'&idioma='+arrayMenu[i].enllas+'" class="cos"><b>'+eval('arrayMenu[i].nom'+idioma)+'</b></a></td>';
			}
		}
		else if ((i!=7)&&(i!=8))  //no es zona privada ni mapa web
		{
			perEscriure=perEscriure+'<td width="'+arrayMenu[i].ampla+'" align="left">'
			if (i==onEstic)
				perEscriure=perEscriure+'<span class="book">&nbsp;<img src="'+prof+'img/puntLlista.jpg">&nbsp;<a href="'+prof+''+arrayMenu[onEstic].enllas+'" class="cos"><b>'+eval('arrayMenu[i].nom'+idioma)+'</b></a></td>'
			else
				perEscriure=perEscriure+'<span class="book">&nbsp;<img src="'+prof+'img/puntLlista.jpg">&nbsp;<a href="'+prof+''+arrayMenu[i].enllas+'" class="cos">'+eval('arrayMenu[i].nom'+idioma)+'</a></td>'
		}
	}
	perEscriure=perEscriure+'</tr></table>'
	
	document.getElementById('tdMenu').innerHTML=perEscriure;
}

function obraFinestraContracte(quin,idioma)
{
    var ah = screen.availHeight/2-600/2;
    var aw = screen.availWidth/2-400/2;

	var vent=window.open("finestra"+quin+"_"+idioma+".php",quin,"width=400, height=600, scrollbars=1,resizable=1,status=no,menubar=no,location=no,left="+aw+",top="+ah+"");
}
