function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//variant, de les funcions java d'en Guillem
var xCoord;
var yCoord;

function checkwhere(e) {
	if (document.all){
	xCoord = event.x +document.body.scrollLeft+340;
	yCoord = event.y +document.body.scrollTop+215;
	}
	else if (document.getElementById && navigator.userAgent.indexOf('Safari')==-1){
		xCoord = e.clientX+ window.scrollX;
		yCoord = e.clientY+ window.scrollY;
	}
	else if (document.getElementById) {
		xCoord = e.clientX;
		yCoord = e.clientY;
	}
}
function mesInfo(ElementId,ContingutId,lang,data,hora,local,preu,places,lliures,text,punt){
	if (lang=='cat') {
		document.getElementById(ContingutId).innerHTML = "<strong>"+ data +"</strong><br><strong>Hora: </strong>"+ hora +"<br><br><strong>Activitat: </strong>"+ text +"<br><strong>Lloc Activitat: </strong>"+ local +"<br><strong>Punt de Trobada: </strong>"+ punt +"<br><br><strong>Preu: </strong>"+ preu +"<br><strong>Places: </strong>"+ places +" (lliures: " + lliures +")<br><br>[<a href='#' onclick=\"MM_showHideLayers('idContacte','','show','idMesInfo','','hide');mesSortida('idContacte','idSortida','"+ lang +"','"+ data +"','"+ text +"')\">m&eacute;s informaci&oacute; i reserves</a>]";
	} else {
		document.getElementById(ContingutId).innerHTML = "<strong>"+ data +"</strong><br><strong>Hora: </strong>"+ hora +"<br><br><strong>Actividad: </strong>"+ text +"<br><strong>Lugar Actividad: </strong>"+ local +"<br><strong>Punto de Encuentro: </strong>"+ punt +"<br><br><strong>Precio: </strong>"+ preu +"<br><strong>Plazas: </strong>"+ places +" (libres: " + lliures +")<br><br>[<a href='#' onclick=\"MM_showHideLayers('idContacte','','show','idMesInfo','','hide');mesSortida('idContacte','idSortida','"+ lang +"','"+ data +"','"+ text +"')\">m&aacute;s informaci&oacute;n y reservas</a>]";		
	}
}
function mesInfoResr(ElementId,ContingutId,lang,data,hora,local,preu,places,lliures,text,punt,id){
	if (lang=='cat') {
		document.getElementById(ContingutId).innerHTML = "<strong>"+ data +"</strong><br><strong>Hora: </strong>"+ hora +"<br><br><strong>Activitat: </strong>"+ text +"<br><strong>Lloc Activitat: </strong>"+ local +"<br><strong>Punt de Trobada: </strong>"+ punt +"<br><br><strong>Preu: </strong>"+ preu +"<br><strong>Places: </strong>"+ places +" (lliures: " + lliures +")<br><br>[<a href='pagament.php?lleng=cat&act="+ id +"'>RESERVAR ACTIVITAT</a>]<br /><br /><img src='img/targetes.gif' height='30' width='100' border='0' />";
	} else {
		document.getElementById(ContingutId).innerHTML = "<strong>"+ data +"</strong><br><strong>Hora: </strong>"+ hora +"<br><br><strong>Actividad: </strong>"+ text +"<br><strong>Lugar Actividad: </strong>"+ local +"<br><strong>Punto de Encuentro: </strong>"+ punt +"<br><br><strong>Precio: </strong>"+ preu +"<br><strong>Plazas: </strong>"+ places +" (libres: " + lliures +")<br><br>[<a href='pagament.php?lleng=cas&act="+ id +"'>RESERVAR ACTIVIDAD</a>]<br /><br /><img src='img/targetes.gif' height='30' width='100' border='0' />";		
	}
}
function mesInfoResrPassat(ElementId,ContingutId,lang,data,hora,local,preu,places,lliures,text,punt,id){
	if (lang=='cat') {
		document.getElementById(ContingutId).innerHTML = "<strong>"+ data +"</strong><br><strong>Hora: </strong>"+ hora +"<br><br><strong>Activitat: </strong>"+ text +"<br><strong>Lloc Activitat: </strong>"+ local +"<br><strong>Punt de Trobada: </strong>"+ punt +"<br><br><strong>Preu: </strong>"+ preu +"<br><strong>Places: </strong>"+ places +" (lliures: " + lliures +")<br><br>NO ES POT RESERVAR L ACTIVITAT";
	} else {
		document.getElementById(ContingutId).innerHTML = "<strong>"+ data +"</strong><br><strong>Hora: </strong>"+ hora +"<br><br><strong>Actividad: </strong>"+ text +"<br><strong>Lugar Actividad: </strong>"+ local +"<br><strong>Punto de Encuentro: </strong>"+ punt +"<br><br><strong>Precio: </strong>"+ preu +"<br><strong>Plazas: </strong>"+ places +" (libres: " + lliures +")<br><br>NO SE PUEDE RESERVAR LA ACTIVIDAD";		
	}
}
function mesSortida(ElementId,ContingutId,lang,data,text){
	if (lang=='cat') {
		document.getElementById(ContingutId).innerHTML = "<strong>Vull rebre m&eacute;s informaci&oacute;</strong><br><br><strong>"+ data +"</strong><br><strong>Activitat: </strong>"+ text +"<br>&nbsp;<input type='hidden' name='FormId' value='"+ data +" "+ text +"'>";
	} else {
		document.getElementById(ContingutId).innerHTML = "<strong>Quiero recibir m&aacute;s informaci&oacute;n</strong><br><br><strong>"+ data +"</strong><br><strong>Actividad: </strong>"+ text +"<br>&nbsp;<input type='hidden' name='FormId' value='"+ data +" "+ text +"'>";		
	}
}
function illumina(id,fons,contorn,texte,e){
	/*
	if (b){a.style.borderColor = c;}
	if (c){a.style.backgroundColor= b;	}
	if (d){a.style.cursor = d;}
	if (e){a.style.color= e;}
	*/
	document.getElementById(id).style.backgroundColor = fons;
	document.getElementById(id).style.color = texte;
}

function CalculImport(quant,preu){
	var resultat = quant*preu;
	document.ForReserva.ForImport.value=resultat.toFixed(2); 
}

//document.onmousemove = checkwhere;
