function canviarImg(nom)
{
	if (nom == 'hotel')
		imatge = 'capsalera1';
	else if (nom == 'serveis')
		imatge = 'capsalera_serveis';
	else if (nom == 'activitats')
		imatge = 'capsalera_activitats';
	else if (nom == 'entorn')
		imatge = 'capsalera_entorn';
	else if (nom == 'comArribar')
		imatge = 'capsalera_comarribar';
	else if (nom == 'contacte')
		imatge = 'capsalera_contacte';
	else if (nom == 'nota')
		imatge = 'capsalera_nota';
	else if (nom == 'mapa')
		imatge = 'capsalera_mapa';
	else
		imatge = 'capsalera_galeria';

	document.getElementById('capsalera_dre').style.background="url(/imgfiles/imgs/"+imatge+".jpg)";
}

function dates()
{

	var dataE = '';
	var dataS = '';
	dataE = document.getElementById('date1').value;
	dataS = document.getElementById('date2').value;

	if ((dataS == '') && (dataE != ''))
	{
		dataS = quinDia(dataE);
	}

	var lang= (document.getElementById('lang').value).substring(0,2);
	window.location.href='https://www.vectork.net/serhshotels/sorradaurada/reserves.asp?id=' + lang + '&entrada=' + dataE + '&sortida=' + dataS;
	//window.location.href='http://localhost/sorradaurada/reserves.asp?id=' + lang + '&entrada=' + dataE + '&sortida=' + dataS;

}

function quinDia(dia)
{
	var res = dia.split('/');

	var dia = parseInt(res[0]);
	var mes = parseInt(res[1]);
	var any = parseInt(res[2]);

	if (mes == 2)
	{
		if (dia < 27)
			dia = dia + 2;
		else
		{

			mes = mes + 1;
			dia = 1;
		}
	}
	else if (mes == 12)
	{
		if (dia < 30)
			dia = dia + 2;
		else
		{
			mes = 1;
			dia = 1;
			any = any + 1;
		}
	}
	else
	{
		if (dia < 30)
			dia = dia + 2;
		else
		{
			mes = mes + 1;
			dia = 1;
		}
	}

	var resultat = '';
	resultat = (dia).toString();
	resultat = resultat + '/' + (mes).toString();
	resultat = resultat + '/' + (any).toString();

	return (resultat);
}

function ofertes()
{
	var lang= (document.getElementById('lang').value).substring(0,2);
	window.location.href='https://www.vectork.net/serhshotels/sorradaurada/ofertes.asp?id=' + lang;
	//window.location.href='http://localhost/sorradaurada/ofertes.asp?id=' + lang;
}

function reserves()
{
	var lang= (document.getElementById('lang').value).substring(0,2);
	window.location.href='https://www.vectork.net/serhshotels/sorradaurada/reserves.asp?id=' + lang;
	//window.location.href='http://localhost/sorradaurada/reserves.asp?id=' + lang;
}