function enviarComentario(idFoto){
	if (document.frmLibroVisitas.nombre.value && document.frmLibroVisitas.comentario.value && document.frmLibroVisitas.nombre.value!='Nombre' && document.frmLibroVisitas.comentario.value!='Comentario') {
		var param= 'nombreLibro=' + document.frmLibroVisitas.nombre.value + '&comentarioLibro=' + document.frmLibroVisitas.comentario.value + '&idFoto=' + idFoto;
		var myAjax = new Ajax.Updater('agregaComentarioLibroVisitas', '/fotolog/inc/agregaComentario.asp', {method: 'post', parameters: param});	
	//	FAjax('/fotolog/inc/agregaComentario.asp','agregaComentarioLibroVisitas',param);
		cargaDatosLibroVisitas('capaCargaLibroVisitas',idFoto);
		document.frmLibroVisitas.nombre.value='';
		document.frmLibroVisitas.comentario.value='';
		
	//	window.location.href= 'index.asp?foto_id=' + idFoto;
	//	window.location=unescape(window.location);
	}else{
		alert('Debe ingresar su nombre y un comentario');
	}
}

function fotoAnterior(url){
	window.location.href = url;
}

function fotoSiguiente(url){
	window.location.href = url;
}

function mostrarFotos(opc){
	

	if(opc == 1){
		//Oculto el boton VER TODAS y habilito el de VER LIBRO DE VISITAS
		document.getElementById('boton-ver-libro').style.display= "";
		document.getElementById('boton-ver-todas').style.display= "none";

		document.getElementById('contenedor-bottom').style.display= "none";
		document.getElementById('capaTodasLasFotos').style.display= "";
	}else{
		//Oculto el boton VER LIBRO DE VISITAS y habilito el de VER TODAS
		document.getElementById('boton-ver-todas').style.display= "";
		document.getElementById('boton-ver-libro').style.display= "none";
		
		document.getElementById('contenedor-bottom').style.display= "";
		document.getElementById('capaTodasLasFotos').style.display= "none";
	}
}

function cargaDatosLibroVisitas(capa,idFoto){
	var param= 'idFoto=' + idFoto
	var myAjax = new Ajax.Updater(capa, '/fotolog/inc/datosLibroVisita.asp', {method: 'post', parameters: param});	
	//FAjax('/fotolog/inc/datosLibroVisita.asp',capa,param);
}