function InsertarComentario(intIdDestino){	var strValues = "opc=4&dest="+intIdDestino+"&txtComentario="+document.getElementById("txtComentario").value;	var div = document.getElementById("divComentarios")	var strFunction = "actualizarTotal()"	ajaxHTML("POST", "ajaxComentar.php", div, strValues, strFunction);}function borrarVideo(intIdVideo, intIdEvento) {	var div = document.getElementById("divVideos");	div.innerHTML = "<img src='images/ajax.gif'>";	simple_ajax("ajaxBorrarVideo.php", "POST","video=" + intIdVideo + "&id="+intIdEvento);}function borrarFoto(intIdFoto, intIdEvento) {	var div = document.getElementById("divFotos");	div.innerHTML = "<img src='images/ajax.gif'>";	simple_ajax("ajaxBorrarFoto.php", "POST","foto=" + intIdFoto + "&id="+intIdEvento);}function actualizarTotal() {	document.getElementById("totalComentarios").innerHTML = document.getElementById("hidTotalComentarios").value;}function votar(intVotos, intIdUsuario, intIdEvento) {	var strValues = "v=" + intVotos + "&idu=" + intIdUsuario + "&ide=" + intIdEvento;	var div = document.getElementById("divValoracion");	div.innerHTML = "<img src='images/working.gif'>";	ajaxHTML("POST", "ajaxVotar.php", div, strValues);}function votarVideo(intVotos, intIdUsuario, intIdEvento) {	var strValues = "v=" + intVotos + "&idu=" + intIdUsuario + "&ide=" + intIdEvento+"&t=3";	var div = document.getElementById("divValoracionVideo");	div.innerHTML = "<img src='images/working.gif'>";	ajaxHTML("POST", "ajaxVotar.php", div, strValues);}function grabar() {		var frm = document.formp;		var strError = '';		var objCheck = new check("formp");				/* Limpio los campos */				LimpiarCampo(frm.txttitulo, 'Título');		LimpiarCampo(frm.txtLugar, 'Lugar donde se realizará el evento');		LimpiarCampo(frm.txtDescripcion, 'Describe tu evento para que otros usuarios se interesen en participar de él...');		LimpiarCampo(frm.txtTags, 'Introduce tags separadas con comas');				frm.txtFecha.value = frm.dia.value + "/" + frm.mes.value + "/" + frm.ano.value;				objCheck.checkString("txttitulo", "título", 1, 100, false);		objCheck.checkDate("txtFecha", "fecha", false);		objCheck.checkFloat("txtKilometros", "kilómetros", 1, 10, true);		objCheck.checkString("txtLugar", "lugar", 1, 100, false);		objCheck.checkCombo("cmbActividades", "actividad", false);		objCheck.checkCombo("cmbProvincias", "provincia", false);		objCheck.checkString("txtDescripcion", "descripción", 1, 8000, true);		objCheck.checkString("txtTags", "tags", 1, 8000, true);						strError = objCheck.toString();				if (strError == "") {			if(document.getElementById("divImagen2").style.display=="block") {				frm.hidCambiarFoto.value = "1";				if(frm.txtImagen.value == "") {					if(!confirm("Si dejas el campo de fotografía en blanco, tu evento no tendrá una fotografía principal para mostrar, ¿estas seguro/a de seguir?")) {						return;					}				}				frm.hidEnviar.value = "1";				frm.submit();									} else {							frm.hidCambiarFoto.value = "0";				frm.hidEnviar.value = "1";				frm.submit();			}			}		else {			alert (strError);		}}function mostrarInvitar(){	if(document.getElementById("divInvitar").style.display == "none") {		document.getElementById("divInvitar").style.display = "block";		document.getElementById("divResultados").style.display = "block";	} else {		document.getElementById("divInvitar").style.display = "none";		document.getElementById("divResultados").style.display = "none";	}}function mostrarInvitar_(){	if(document.getElementById("divInvitar_").style.display == "none") {		document.getElementById("divInvitar_").style.display = "block";		document.getElementById("divResultados_").style.display = "block";	} else {		document.getElementById("divInvitar_").style.display = "none";		document.getElementById("divResultados_").style.display = "none";	}}function buscarInvitados(intIdEvento){	var frm = document.formp;		var strError = '';		var objCheck = new check("formp");				objCheck.checkString("txtBuscador", "tags", 4, 1000, false);				strError = objCheck.toString();		if(strError == "") {			var strValues = "ide="+intIdEvento+"&txtBuscador="+document.getElementById("txtBuscador").value;			var div = document.getElementById("divResultados");			div.style.display = "block";			div.innerHTML = "<img src='images/ajax.gif'>";			ajaxHTML("POST", "ajaxBuscarInvitadosEventos.php", div, strValues);		} else {			alert(strError);		}		}function verFotos(idUsuario){	var strValues = "id="+idUsuario;	var div = document.getElementById("divFotos");	if(div.innerHTML != "<img src='images/ajax.gif'>") {		div.innerHTML = "<img src='images/ajax.gif'>";	}	ajaxHTML("POST", "ajaxVerFotosEventos.php", div, strValues, "actualizarFotos()");}function actualizarFotos(){			$(document).ready(function(){				$('.#fotos').lightBox();			});}function verVideos(idUsuario){	var strValues = "id="+idUsuario;	var div = document.getElementById("divVideos");	if(div.innerHTML != "<img src='images/ajax.gif'>") {		div.innerHTML = "<img src='images/ajax.gif'>";	}	ajaxHTML("POST", "ajaxVerVideosEventos.php", div, strValues);}function verVideo(idUsuario, idVideo){	var strValues = "idu="+idUsuario+"&id="+idVideo;	var div = document.getElementById("divVideos");	div.innerHTML = "<img src='images/ajax.gif' >";	ajaxHTML("POST", "ajaxVerVideo.php", div, strValues);}function buscarInvitados_(intIdEvento){	var frm = document.formp;		var strError = '';		var objCheck = new check("formp");				objCheck.checkString("txtBuscador_", "tags", 4, 1000, false);				strError = objCheck.toString();		if(strError == "") {			var strValues = "ide="+intIdEvento+"&txtBuscador="+document.getElementById("txtBuscador_").value;			var div = document.getElementById("divResultados_");			div.style.display = "block";			div.innerHTML = "<img src='images/ajax.gif'>";			ajaxHTML("POST", "ajaxBuscarInvitadosEventos_.php", div, strValues);		} else {			alert(strError);		}		}function invitarUsuario(intIdEventoInvitar, intIdEvento){	document.getElementById("divInv1" + intIdEventoInvitar).innerHTML = "<img src='images/ajax.gif' height='16' width='16' >";	document.getElementById("divInv2" + intIdEventoInvitar).innerHTML = "";	simple_ajax("ajaxInvitarEvento.php", "POST", "idei=" + intIdEventoInvitar + "&ide=" + intIdEvento);}function invitarUsuario_(intIdUsuario, intIdEvento){	document.getElementById("divInv1_" + intIdUsuario).innerHTML = "<img src='images/ajax.gif' height='16' width='16' >";	document.getElementById("divInv2_" + intIdUsuario).innerHTML = "";	simple_ajax("ajaxInvitarEvento_.php", "POST", "idu=" + intIdUsuario + "&ide=" + intIdEvento);}function verSolicitudes(){	if(document.getElementById("divSolicitudes").style.display == "none") {		document.getElementById("divSolicitudes").style.display = "block";		document.getElementById("divSolicitudesPendientes").style.display = "none";	} else {		document.getElementById("divSolicitudes").style.display = "none";	}}function confirmarUsuario(intOperacion, intIdEventoEmisor, intIdEvento, tipo){	var strValues = "oper="+intOperacion+"&ide="+intIdEvento+"&idee="+intIdEventoEmisor;	document.getElementById("divSolicitudes").innerHTML = "<img src='images/ajax.gif'>";	var div = document.getElementById("divSolicitudes");	var strFunction = "actualizarTotalSolicitudes()";	if(tipo == 4) {			ajaxHTML("POST", "ajaxConfirmarSolicitudEvento.php", div, strValues, strFunction);	} else {		ajaxHTML("POST", "ajaxConfirmarSolicitudEventoUsuario.php", div, strValues, strFunction);	}}function actualizarTotalSolicitudes() {	document.getElementById("linkSolicitudes").innerHTML = document.getElementById("hidTotalSolicitudes").value;}function verAsistentes(idEvento){	var strValues = "id="+idEvento;	var div = document.getElementById("divasistentes");	div.innerHTML = "<img src='images/ajax.gif' >";	ajaxHTML("POST", "ajaxAsistentes.php", div, strValues);}function verEventos(idEvento){	var strValues = "id="+idEvento;	var div = document.getElementById("divEventosRelacionados");	div.innerHTML = "<img src='images/ajax.gif'  >";	ajaxHTML("POST", "ajaxEventosRelacionados.php", div, strValues);}function enviarApuntarme(intIdUsuario, intId){		var strError = '';	var frm = document.Form;	var objCheck = new check("Form");		objCheck.checkString("txtMensajeApuntarme", "mensaje", 1, 500, false);		strError = objCheck.toString();	if(strError == "") {		div = document.getElementById("divApuntarme");		var strMensaje = frm.txtMensajeApuntarme.value;		div.innerHTML = '<img class="ajx" src="images/ajax.gif"> Enviando mensaje...';		simple_ajax("ajaxApuntarme.php", "POST", "usuario=" + intIdUsuario + "&id=" + intId + "&mensaje=" + strMensaje);		} else {		alert(strError);	}}function verApuntarme() {	document.getElementById("divApuntarme").style.display ="block";}function ocultarApuntarme(){	document.getElementById("divApuntarme").style.display ="none";}function enviarInvitarAmigo(intIdEvento, intIdUsuario){	var strError = '';	var frm = document.Form;	var objCheck = new check("Form");	objCheck.checkEmail("txtEmail", "email", 1, 500, false);	objCheck.checkString("txtMensajeInvitarAmigo", "mensaje", 1, 500, false);	strError = objCheck.toString();	if(strError == "") {		div = document.getElementById("divInvitarAmigo");		var strMensaje = frm.txtMensajeInvitarAmigo.value;		var strEmail = frm.txtEmail.value;		div.innerHTML = '<img class="ajx" src="images/ajax.gif"> Enviando mensaje...';		ajaxHTML("POST", "ajaxInvitarAmigo.php", div, "email="+strEmail+"&evento=" + intIdEvento + "&id=" + intIdUsuario + "&mensaje=" + strMensaje);	} else {		alert(strError);	}}function mostrarInvitarAmigo() {	document.getElementById("divInvitarAmigo").style.display ="block";}function ocultarInvitarAmigo(){	document.getElementById("divInvitarAmigo").style.display ="none";}
