function parpadear() {
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function empezar() {
  if (document.all)
    setInterval("parpadear()",500)
}
window.onload = empezar;

function vaciarcampo(elque){
	document.getElementById(elque).value="";
}
function simularenter(obj, e)
{
	tecla = (document.all) ? e.keyCode : e.which;
	if (tecla == 13){
		document.getElementById("Conectar").submit();
	}
}
function atope(pagina){
	window.parent.location.href = "index.php?URL="+pagina;	
	//window.parent.location.href = "index.php?URL="+pagina;	
}
function mostraraviso(){
	window.parent.document.getElementById("Aviso").style.marginTop = "-100px";
	window.parent.document.getElementById("PChat").style.visibility = "visible";
	window.parent.document.getElementById("PChat").style.display = "inline";
}
function ocultaraviso(){
	window.parent.document.getElementById("Aviso").style.marginTop = "0px";
}
function abrirchat(){
	window.parent.document.getElementById("PChat").style.visibility = "visible";
	window.parent.document.getElementById("PChat").style.display = "inline";
	window.parent.document.getElementById("PChat").style.marginTop = "-380px";
	//window.parent.document.getElementById("PChat").style.zIndex = "2";
	//window.parent.document.getElementById("Pagina").style.zIndex = "1";
}
function cerrarpubli(){
	/*document.getElementById("Publicidad").style.visibility = "hidden";
	document.getElementById("Publicidad").style.display = "none";
	document.getElementById("Transparencia").style.visibility = "hidden";
	document.getElementById("Transparencia").style.display = "none";
	*/
	window.parent.document.getElementById("Publicidad").style.visibility = "hidden";
	window.parent.document.getElementById("Publicidad").style.display = "none";
	window.parent.document.getElementById("Transparencia").style.visibility = "hidden";
	window.parent.document.getElementById("Transparencia").style.display = "none";
	
}

function cerrarchat(){
	//window.parent.document.getElementById("PChat").style.visibility = "hidden";
	//window.parent.document.getElementById("PChat").style.display = "none";
	//window.parent.document.getElementById("PChat").style.zIndex = "1";
	//window.parent.document.getElementById("Pagina").style.zIndex = "2";
	window.parent.document.getElementById("PChat").style.marginTop = "0px";
}
function minimizarchat(){
	window.parent.document.getElementById("PChat").style.marginTop = "-30px";
}
function maximizarchat(){
	window.parent.document.getElementById("PChat").style.marginTop = "-380px";
}


function mostrarinv(){
	document.getElementById("Invita").style.visibility = "visible";
	document.getElementById("Invita").style.display = "inline";
}
function ocultarinv(){
	document.getElementById("Invita").style.visibility = "hidden";
	document.getElementById("Invita").style.display = "none";
}
function mostrarmen(cual){
	document.getElementById("Men"+cual).style.visibility = "visible";
	document.getElementById("Men"+cual).style.display = "inline";
}
function ocultarmen(cual){
	document.getElementById("Men"+cual).style.visibility = "hidden";
	document.getElementById("Men"+cual).style.display = "none";
}
function mostrarmenu(cual){
	document.getElementById("Sub"+cual).style.visibility = "visible";
	document.getElementById("Sub"+cual).style.display = "inline";
}
function ocultarmenu(cual){
	document.getElementById("Sub"+cual).style.visibility = "hidden";
	document.getElementById("Sub"+cual).style.display = "none";
}
function cambiarestilo(i,cual){
	if (i==1){
		document.getElementById("submenu"+cual).className="submenu";
	}else{
		document.getElementById("submenu"+cual).className="submenu2";
	}	
}
function cambiarestilog(i,cual){
	if (i==1){
		document.getElementById("submenu"+cual).className="submenug";
	}else{
		document.getElementById("submenu"+cual).className="submenug2";
	}
	
}
function mostrarreg(cual){
	document.getElementById("Reg"+cual).style.visibility = "visible";
	document.getElementById("Reg"+cual).style.display = "inline";
}
function ocultarreg(cual){
	document.getElementById("Reg"+cual).style.visibility = "hidden";
	document.getElementById("Reg"+cual).style.display = "none";
}
function enviarcontactar(){
	campos=["Nombre","Email","Comentario"];
	if (camposvacios(campos) &&  emailcorrecto("Email")){
		document.getElementById("Email").value=document.getElementById("Email").value.replace(" ","");
		document.formulario.submit();
	}
}
function enviar(){
	campos=["AliasB","Email","ClaveB","DiaN","MesN","AnoN","Pais","Provincia","Localidad","Sexualidad","Edad1","Edad2"];
	if (correo10min("Email") && apodonumero ("AliasB") && aliasmas4("AliasB") && solocaracteres("AliasB") && eligesexo() && camposvacios(campos) && edadlogica() && fechacorrecta() && emailcorrecto("Email") &&  claveigual() && emailigual() && conformidad()){
		document.getElementById("Email").value=document.getElementById("Email").value.replace(" ","");
		document.getElementById("Alias").value=document.getElementById("Alias").value.replace(" ","")
		document.Registro.submit();
	}
}
function correo10min(email){
	if (document.getElementById(email).value.indexOf("@klzlk.com")>-1){
		alert(Correoklzlk);
		return false;
	}else{		
		return true;		
	}
}
function aliasmas4(campo){
	dato =  document.getElementById(campo).value;
	if (dato.length<4 || dato.length>20){
		alert(CaracteristicasAlias);
		document.getElementById(campo).focus();
		return false;	
	}
	else 
		return true;
}
function apodonumero(campo){
	var letras = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz";
	dato =  document.getElementById(campo).value;
	allValid = true;
	var ch = dato.charAt(0);
	var j=0;
	var encontrado=false;
	while ((j < letras.length) && !encontrado){
			if (ch == letras.charAt(j))
				encontrado=true;
		j++;
	}
	if (j == letras.length) {
			allValid = false;
	}
	if (!allValid) {
		alert(AliasLetra);
		document.getElementById(campo).focus();
		return false;
	}
	else
		return true;
}

function solocaracteres(campo){
	var letras = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "_";
	dato =  document.getElementById(campo).value;
	allValid = true;
	i=0;
	while ((i < dato.length) && allValid) {
		var ch = dato.charAt(i);
		var j=0;
		var encontrado=false;
		while ((j < letras.length) && !encontrado){
			if (ch == letras.charAt(j))
				encontrado=true;
		j++;
		}
		if (j == letras.length) {
			allValid = false;
		}
	i++;
	}
	if (!allValid) {
		alert(EscribirCaracteres);
		document.getElementById(campo).focus();
		return false;
	}
	else
		return true;
}

function eligesexo(){
	if (! document.getElementById("Sexo1").checked && ! document.getElementById("Sexo2").checked){
		document.getElementById("Sexo1").focus();
		alert(EsHombreoMujer);
		return false;	
	}
	else
		return true;
}
function camposvacios(campos){
	for(var i=0;i<campos.length;i++){
			obj=document.getElementById(campos[i]);
			if (obj.value ==""){
				obj.focus();
				obj.style.background="#FF7777";
				alert(RellenarCamposObligatorios);
				return false;
			}
			else{
				obj.style.background="#FFFFFF";
			}
	}

	return true;
}
function conformidad(){
	if (! document.getElementById("Conformidad").checked){
		document.getElementById("Conformidad").focus();
		alert(EsMayordeEdad);
		return false;	
	}
	else
		return true;
}
function edadlogica(){
	if(parseInt(document.Registro.Edad1.value) > parseInt(document.Registro.Edad2.value)){
		document.Registro.Edad1.focus();
		alert(LasEdadesIncorrectas);	
		return false;
	}
	else
		return true	;
}
function emailcorrecto(email){
	var email = document.getElementById(email).value;
	var verif = /^[\w\W]*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	//var verif = /^\w+([\.-])*\w+@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	//var verif = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	if (verif.exec(email) == null)	{
		//document.getElementById("Email").focus();
		alert(EmailEsIncorrecto);
		return false;
	}
	else
		return true;
}
function emailcorrecto2(email){

	var email = document.getElementById(email).value;
	var verif = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
	if (verif.exec(email) == null)
	{
		//document.getElementById(email).focus();
		alert(EmailEsIncorrecto);
		return false;
	}
	else
		return true;
}
function fechacorrecta(){
	ano = document.Registro.AnoN.options[document.Registro.AnoN.selectedIndex].value;
	mes = document.Registro.MesN.options[document.Registro.MesN.selectedIndex].value;
	dia = document.Registro.DiaN.options[document.Registro.DiaN.selectedIndex].value;

	if ( mes31(mes,dia) || mes30(mes,dia) || mes29(mes,dia,ano))
		return true;
	else{
		document.Registro.DiaN.focus();
		alert(LaFechaesIncorrecta);
		return false;
	}
		
}
function mes31(mes,dia){
	return (mes == 1 || mes == 3 || mes == 5 || mes == 7 || mes == 8 || mes == 10 || mes == 12) && dia >= 1 && dia <= 31;   
}
function mes30(mes,dia){
	return (mes == 4 || mes == 6 || mes == 9 || mes == 11 ) && dia >=1 && dia <=30;
}
function mes29(mes,dia,ano){
	return (mes==2 && dia >= 1 && dia <= (28 + bisiesto(ano)));
}
function bisiesto(ano){
	if ( ((ano % 4 == 0) && (ano % 100 != 0)) || (ano % 400 ==0) )
		return true;
	else
		return false;
}
function claveigual(){
	if (document.Registro.ClaveB.value == document.Registro.Claverep.value)
		return true;
	else{
		document.Registro.ClaveB.focus();
		alert(LasClavesnoIguales);
		return false;
	}
}

function emailigual(){
	if (document.Registro.Email.value == document.Registro.Emailrep.value)
		return true;
	else{
		document.Registro.Email.focus();
		alert(LosEmailsnoIguales);
		return false;
	}
}

function enviarcodigo(){
	document.PerfilBasico.submit();	
}
function enviarbaja(){
		document.DarseBaja.submit();
}
function enviarrecordatorio(){
		if (document.getElementById("email").value != ""){
			if (emailcorrecto("email"))
				document.Recordatorio.submit();
		}
		else
			alert(EmailEsIncorrecto);
}

function enviardescripcion(){
		document.Descripcion.submit();
}
function enviarintereses(){
		document.Intereses.submit();
}

// Anuncio

function enviaranuncio(){
		document.FormuAnuncio.submit();
}

function calCarFaltan( formulario ) {   
  
   var maxLongitud = 800   
   libres = 800      //si cambia este valor, debe modificarse en el atributo value de campo numero   
  
   if ( FormuAnuncio.Anuncio.value.length > maxLongitud ) {   
  
      FormuAnuncio.Anuncio.value = FormuAnuncio.Anuncio.value.substring(0,maxLongitud)   
      libres = 0   
      alert(SuperacionDelLimite + maxLongitud + " "+SuperacionDelLimite2)   
   } else {   
      libres = maxLongitud - FormuAnuncio.Anuncio.value.length  
   }   
      
   FormuAnuncio.Caracteres.value = libres   
}
function calCarFaltan2( formulario ) {   
  
   var maxLongitud = 140   
   libres = 140      //si cambia este valor, debe modificarse en el atributo value de campo numero   
  
   if ( FEstado.Eslogan.value.length > maxLongitud ) {   
  
      FEstado.Eslogan.value = FEstado.Eslogan.value.substring(0,maxLongitud)   
      libres = 0   
      alert(SuperacionDelLimite + maxLongitud + " "+SuperacionDelLimite2)   
   } else {   
      libres = maxLongitud - FEstado.Eslogan.value.length  
   }   
      
   FEstado.Caracteres.value = libres   
}  
function calCarFaltan3( formulario ) {   
  
   var maxLongitud = 100   
   libres = 100      //si cambia este valor, debe modificarse en el atributo value de campo numero   
  
   if ( PublicarAnuncio.Texto.value.length > maxLongitud ) {   
  
      PublicarAnuncio.Texto.value = PublicarAnuncio.Texto.value.substring(0,maxLongitud)   
      libres = 0   
      alert(SuperacionDelLimite + maxLongitud + " "+SuperacionDelLimite2)   
   } else {   
      libres = maxLongitud - PublicarAnuncio.Texto.value.length  
   }   
      
   PublicarAnuncio.Caracteres.value = libres   
}
function calCarFaltan4( formulario ) {   
  
   var maxLongitud = 75   
   libres = 75      //si cambia este valor, debe modificarse en el atributo value de campo numero   
  
   if ( PublicarAnuncio.Texto.value.length > maxLongitud ) {   
  
      PublicarAnuncio.Texto.value = PublicarAnuncio.Texto.value.substring(0,maxLongitud)   
      libres = 0   
      alert(SuperacionDelLimite + maxLongitud + " "+SuperacionDelLimite2)   
   } else {   
      libres = maxLongitud - PublicarAnuncio.Texto.value.length  
   }   
      
   PublicarAnuncio.Caracteres.value = libres   
}
function marcarregalo(regalo){
	document.getElementById("Regalo"+regalo).checked=true;	
	
}
function enviarfotografia(){
	document.Fotografia.submit();
}

function anadirgaleria(){
	if (document.getElementById("Nombre").value !="" )
		document.Galeria.submit();
	else
		alert(CrearNuevaGaleria);
}
function anadiryoutube(){
	if (document.getElementById("Titulo").value !="" && document.getElementById("Codigo").value !="")
		document.VideoYoutube.submit();
	else
		alert(CrearNuevaGaleria);
}

function anadirfoto(){
	if (document.getElementById("AnadirFoto").value.length >5){
		document.getElementById("SubirFoto").submit();
	}
	else
		alert(ElegirUnaFotografia);
}
function actualizargaleria(){
		document.getElementById("G1").action= "privadoperfil5mas.php";
		document.getElementById("G1").submit();	
}
function actualizaryoutube(){
		document.getElementById("Y1").action= "privadoperfil5youtube.php";
		document.getElementById("Y1").submit();	
}
function votar30(numero, video){
	if (confirm("Esta seguro que desea votar el video: '"+video+"'")){
		document.getElementById("Votare"+numero).value="S";
		document.getElementById("Votado"+numero).submit();
	}
	
}
function actualizartitulovideo(numero){
		document.getElementById("TV"+numero).submit();
	
}
function editargaleria(galeria){
		window.location="privadoperfil5mas.php?NGaleria="+galeria;	
}
function editaryoutube(galeria){
		window.location="privadoperfil5youtube.php?NVideo="+galeria;	
}
function eliminargaleria(nombre, num){
	if (confirm(EliminarGaleriaLlamada+nombre+"'?"))
		document.getElementById("G"+num).submit();
}
function eliminaryoutube(nombre, num){
	if (confirm(EliminarVideoTitulado+"'"+nombre+"'?"))
		document.getElementById("Y"+num).submit();
}
function eliminarfotoprincipal(cual){
	if (confirm(DeseaEliminarFotoPrincipal+cual+"?"))
		window.location="privadoperfil5.php?opcion=borrarfotop";
}
function eliminarfotografia(cual,num,ngaleria){
	if (confirm(DeseaEliminarLaFoto+num+"?"))
		window.location="privadoperfil5mas.php?opcion=borrarfoto&elque="+cual+"&NGaleria="+ngaleria;
}
function eliminarvideo(numero,nombre){
	if (confirm(EliminarVideoTitulado+nombre+"?"))
		document.getElementById("EV"+numero).submit();
}
function anadircomentario(){
	opinion=document.getElementById("Opinion").value;
	principal=document.getElementById("Principal").value;
	idfoto=document.getElementById("IdFoto").value;
	idusuario=document.getElementById("IdUsuario").value;
	idgaleria=document.getElementById("IdGaleria").value;
	if (opinion!=""){
		elemento = document.getElementById('Opiniones');
		ajax=objetoAjax();
		ajax.open("GET", "opinionfoto.php?Opinion="+opinion+"&IdFoto="+idfoto+"&Principal="+principal+"&IdUsuario="+idusuario+"&IdGaleria="+idgaleria+"&nocache"+Math.random(),false);
		ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
		ajax.send(null);
		if((ajax.readyState == 4) && (ajax.status == 200)){
			elemento.innerHTML = ajax.responseText;
			document.getElementById("Opinion").value="";
		}
	}
}
function anadircomentarioyo(){
	document.getElementById("FOpinion").submit();
}
function cerrarfotoamp(){
	elemento = document.getElementById('FotoAmp2');
	elemento.innerHTML="";
}
function fotoamp(idfoto,mostrarcomentarios, quienescribe,estaenamigos,tipofoto){
	elemento = document.getElementById('FotoAmp');
	ajax=objetoAjax();
	ajax.open("GET", "fotoamp.php?FotoAmp="+idfoto+"&MostrarComentarios="+mostrarcomentarios+"&QuienEscribe="+quienescribe+"&EstaEnAmigos="+estaenamigos+"&TipoFoto="+tipofoto+"&nocache"+Math.random(),true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	window.scrollBy(0,500);
	elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";
		ajax.onreadystatechange = function(){
			 if(ajax.readyState==1){ 
				elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";			
			 }else if (ajax.readyState==4) {
				 if(ajax.status==200){ 
				 	elemento.innerHTML = ajax.responseText;
					window.scrollBy(0,500);
				 }
			 }				
		}
		ajax.send(null);
}
function fotoamp2(idfoto,mostrarcomentarios, quienescribe,estaenamigos,tipofoto){
	elemento = document.getElementById('FotoAmp2');
	document.getElementById('ElPerfil').innerHTML="";
	ajax=objetoAjax();
	ajax.open("GET", "fotoamp.php?FotoAmp="+idfoto+"&MostrarComentarios="+mostrarcomentarios+"&QuienEscribe="+quienescribe+"&EstaEnAmigos="+estaenamigos+"&TipoFoto="+tipofoto+"&Cerrar=1&nocache"+Math.random(),true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	window.scrollBy(0,500);
	elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";
		ajax.onreadystatechange = function(){
			 if(ajax.readyState==1){ 
				elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";			
			 }else if (ajax.readyState==4) {
				 if(ajax.status==200){ 
				 	elemento.innerHTML = ajax.responseText;
					window.scrollBy(0,500);
				 }
			 }				
		}
		ajax.send(null);
}
function cargarperfil(id,web){
	
	elemento = document.getElementById('ElPerfil');
	ajax=objetoAjax();
	ajax.open("POST",web+"t.php", true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	window.scrollBy(0,500);
	elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";
		ajax.onreadystatechange = function(){
			 if(ajax.readyState==1){ 
				elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";			
			 }else if (ajax.readyState==4) {
				 if(ajax.status==200){ 
				 	elemento.innerHTML = ajax.responseText;
					window.scrollBy(0,500);
				 }
			 }				
		}
		ajax.send("idalias="+id);
		document.getElementById('FotoAmp2').innerHTML="";
}
function cargargalerias(id,pagactual){
	
	elemento = document.getElementById('ElPerfil');
	ajax=objetoAjax();
	ajax.open("POST","perfil4t.php", true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	window.scrollBy(0,500);
	elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";
		ajax.onreadystatechange = function(){
			 if(ajax.readyState==1){ 
				elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";			
			 }else if (ajax.readyState==4) {
				 if(ajax.status==200){ 
				 	elemento.innerHTML = ajax.responseText;
					window.scrollBy(0,500);
				 }
			 }				
		}
		ajax.send("idalias="+id+"&pagactual="+pagactual);
}
function cargargaleria(id,ngaleria){
	
	elemento = document.getElementById('ElPerfil');
	ajax=objetoAjax();
	ajax.open("POST","perfilgaleriat.php", true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";
		ajax.onreadystatechange = function(){
			 if(ajax.readyState==1){ 
				elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";			
			 }else if (ajax.readyState==4) {
				 if(ajax.status==200){ 
				 	elemento.innerHTML = ajax.responseText;					
				 }
			 }				
		}
		ajax.send("idalias="+id+"&NGaleria="+ngaleria);
}
function anadircomentariox(){
	if (document.getElementById("Opinion").value!="")
		document.getElementById("FOpinion").submit();
}
function borrarseleccionadas(){
	//alert("Debe de sealar al menos una fotografa");
	if (confirm(DeseaBorrarFotosSeleccionadas))
		document.getElementById("TG").submit();
}
function borrarcomentariostodos(){
	//alert("Debe de sealar al menos una fotografa");
	if (confirm(BorrarComentariosSeleccionados))
		document.getElementById("OpiBorra").submit();
}
//Videos
function subirvideo(){
	if (document.getElementById("Video").value.length >5){		
			document.getElementById("Videos").submit();
		
	}
	else
		alert("Elige un video");
}


function deshabilitarclave(field) {
	deshabilitar(document.getElementById("Clave"), field);
	document.getElementById("Clave").value="";
}
function habilitarclave(field){
	habilitar(document.getElementById("Clave"), field);
	
}
function habilitar(field, causer) {
	if (causer.checked) {
		field.disabled = false;
	}
	else {

		field.checked = false;
		field.disabled = true;
	}
}
function deshabilitar(field, causer) {
	if (causer.checked) {
		field.checked = false;
		field.disabled = true;
	}
	else {
		field.disabled = false;
		
	}
}
//Conectarse
function conectarse(){
	Conectar.submit();	
}
function actualizardatosbasicos(){
	campos=["Email","ClaveB","DiaN","MesN","AnoN","Pais","Provincia","Localidad"];
	if (edadlogica() && camposvacios(campos) && fechacorrecta() && emailcorrecto("Email") &&  claveigual() && emailigual())
		Registro.submit();	
}

function actualizardescripcion(){
	Descripcion.submit();	
}
function actualizarintereses(){
	Intereses.submit();	
}
function actualizaranuncio(){
	FormuAnuncio.submit();	
}
function actualizarfotoperfil(){
	if (document.getElementById("Foto").value.length > 0 )
		Fotografia.submit();
	else
		alert(AgregarFotografiaPrincipal);
}
function seleccionarprovincia(pais, cual, modo){
	elemento = document.getElementById('ProvinciaCapa');
	ajax=objetoAjax();
	ajax.open("GET", "provincia.php?Pais="+pais+"&Cual="+cual+"&Modo="+modo,false);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	ajax.send(null);
	if((ajax.readyState == 4) && (ajax.status == 200))
	elemento.innerHTML = ajax.responseText;
	seleccionarlocalidad("",cual,modo);
}
function seleccionarlocalidad(provincia,cual,modo){
	pais=document.getElementById('Pais').value;
	elemento = document.getElementById('LocalidadCapa');
	ajax=objetoAjax();
	ajax.open("GET", "localidad.php?Pais="+pais+"&Provincia="+provincia+"&Cual="+cual+"&Modo="+modo,false);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");

	ajax.send("");
	if((ajax.readyState == 4) && (ajax.status == 200))
	elemento.innerHTML = ajax.responseText;
}

//DISCO
function seleccionarprovinciadisco(pais){
	elemento = document.getElementById('ProvinciaCapa');
	ajax=objetoAjax();
	ajax.open("GET", "provinciadisco.php?Pais="+pais,false);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	ajax.send(null);
	if((ajax.readyState == 4) && (ajax.status == 200))
	elemento.innerHTML = ajax.responseText;
	seleccionarlocalidaddisco("");
	seleccionardisco(pais,"","");
}
function seleccionarlocalidaddisco(provincia){
	pais=document.getElementById('Pais').value;
	elemento = document.getElementById('LocalidadCapa');
	ajax=objetoAjax();
	ajax.open("GET", "localidaddisco.php?Pais="+pais+"&Provincia="+provincia,false);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");

	ajax.send("");
	if((ajax.readyState == 4) && (ajax.status == 200))
	elemento.innerHTML = ajax.responseText;
	seleccionardisco(pais,provincia,"");
}
function seleccionardisco(pais,provincia,localidad){
	pais=document.getElementById('Pais').value;
	elemento = document.getElementById('DiscoCapa');
	ajax=objetoAjax();
	ajax.open("GET", "discos.php?Pais="+pais+"&Provincia="+provincia+"&Localidad="+localidad,false);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");

	ajax.send("");
	if((ajax.readyState == 4) && (ajax.status == 200))
	elemento.innerHTML = ajax.responseText;
}
function objetoAjax(){
	var xmlhttp=false;	
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}
// Abril Web

var ventana
var cont=0
function abrir(cual,ancho,alto,titulo){
	if(ancho==null){
		ancho=500
	}
	if(alto==null){
		ancho=500
	}
	ventana=open(cual,"","toolbar=no,directories=no,scrollbars=no,menubar=no,status=no,width="+ancho+",height="+alto);
	ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2); //centra la ventana.
}
function buscar(){
	Busqueda.submit();	
}
function nuevabusqueda(){
	document.getElementById("Online").checked=false;
	document.getElementById("Foto").checked=false;
	document.getElementById("Nick").value="";
	document.getElementById("Relacion").selectedIndex=0;
	document.getElementById("Pais").selectedIndex=0;
	document.getElementById("Edad1").selectedIndex=0;
	document.getElementById("Edad2").selectedIndex=32;
	seleccionarprovincia("","","Buscar");
}
function enviarbusqueda(pagina){
	document.getElementById("paginaoculta").innerHTML="<input type='hidden' id='pagactual' name='pagactual' value='"+pagina+"'>";
	Busqueda.submit();	
}
function modobus(modo,pagina){
	document.getElementById("paginaoculta").innerHTML="<input type='hidden' id='pagactual' name='pagactual' value='"+pagina+"'>";
	document.getElementById('ModoBus').value=modo;
	Busqueda.submit();	
}
function avisos(opcion,usuario,yo,nombre){
		if (mensajeopciones(opcion,nombre)){	
			elemento = document.getElementById('MeterAviso');
			ajax=objetoAjax();
			ajax.open("POST", "avisos.php",false);
			ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
			ajax.send("opcion="+opcion+"&usuario="+usuario+"&yo="+yo);
			if((ajax.readyState == 4) && (ajax.status == 200))
				elemento.innerHTML = ajax.responseText;
				
				if (opcion=="amigos2" || opcion=="quitaramigo"){
					window.location="privadoamigos2.php";
				}
				if (opcion=="amigos4" || opcion=="amigos3s" || opcion=="quitarsolicitudamigo"){
					window.location="privadoamigos3.php";
				}
				if (opcion=="listanegra2" || opcion=="listanegra3s"){
					window.location="privadokamgoo5.php";
				}
				if (opcion=="fotosprivadas2x"){
					window.location="privadokamgoo6.php";
				}
				if (opcion=="fotosprivadasx" || opcion=="solprivadas2x"){
					window.location="privadokamgoo6b.php";
				}
				if (opcion=="favoritos2" || opcion=="favoritos3s"){
					window.location="privadofavoritos.php";
				}
				
		}

}
function paginadocargar(web,pagactual,ModoMundo,ModoSexo){
		elemento = document.getElementById('Paginado');
		foco=window.parent.document.getElementById("Foco").value;
		ajax=objetoAjax();
		ajax.open("POST", web+"t.php",true);
		ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
		elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";		
		ajax.onreadystatechange = function(){
			 if(ajax.readyState==1){ 
				elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";			
			 }else if (ajax.readyState==4) {
				 if(ajax.status==200){ 
				 	elemento.innerHTML = ajax.responseText;					 
				 }
			 }				
		}
		ajax.send("pagactual="+pagactual+"&ModoMundo="+ModoMundo+"&ModoSexo="+ModoSexo+"&Foco="+foco);
		
}
function paginadobuscargar(pagactual,ModoBus){
		elemento = document.getElementById('Paginado');
		foco=window.parent.document.getElementById("Foco").value;
		ajax=objetoAjax();
		ajax.open("POST", "privadobusquedat.php",true);
		ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
		elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";
		ajax.onreadystatechange = function(){
			 if(ajax.readyState==1){ 
				elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";			
			 }else if (ajax.readyState==4) {
				 if(ajax.status==200){ 
				 	elemento.innerHTML = ajax.responseText;					 
				 }
			 }				
		}
		ajax.send("pagactual="+pagactual+"&ModoBus="+ModoBus+"&Foco="+foco);
		
}
function ColocaFoco(){
//window.focus()
document.getElementById("chat").focus();
}

function mensajeopciones(opcion,usuario){
	switch(opcion){
		//case "rompehielos":	return confirm(EnviarUnRompehielos+usuario+"?");break;
		case "favoritos":	return confirm(AgregarAFavoritos+usuario+" a favoritos?");break;
		case "favoritos2":	return confirm(EliminarDeFavoritos+usuario+EliminarDeFavoritos2);break;
		case "listanegra":	return confirm(AgregarAListaNegra+usuario+AgregarAListaNegra2);break;
		case "listanegra2":	return confirm(EliminarDeListaNegra+usuario+EliminarDeListaNegra2);break;
		case "solpriv":	return confirm(AgregarAFotosPrivadas+usuario+AgregarAFotosPrivadas2);break;
		case "fotosprivadas2":	return confirm(EliminarDeFotosPrivadas+usuario+EliminarDeFotosPrivadas2);break;
		case "quitaramigo":	return confirm(EliminarAmigo+usuario+EliminarAmigo2);break;
		default: return true;
	}
	
}
/*function apareceraviso(){
	var navegador = navigator.appName 
	elemento = document.getElementById('Aviso');
	if (navegador == "Microsoft Internet Explorer"){
		opaco(elemento,"20",100);opaco(elemento,"40",150);opaco(elemento,"60",200);opaco(elemento,"80",250);
		opaco(elemento,"100",300);opaco(elemento,"80",3300);opaco(elemento,"60",3350);opaco(elemento,"40",3400);
		opaco(elemento,"20",3450);opaco(elemento,"0",3500);
	}
	else {
		opaco2(elemento,".20",100);opaco2(elemento,".40",150);opaco2(elemento,".60",200);opaco2(elemento,".80",250);
		opaco2(elemento,".99",300);opaco2(elemento,".80",3300);opaco2(elemento,".60",3350);opaco2(elemento,".40",3400);
		opaco2(elemento,".20",3450);opaco2(elemento,".0",3500);
	}
	
}
function opaco(elemento,por,ms){
	setTimeout("elemento.style.filter='alpha(opacity="+por+")'",ms);

}
function opaco2(elemento,por,ms){
	setTimeout("elemento.style.opacity='"+por+"'",ms);

}*/
/*function scrollea(){
	document.getElementById('Aviso').style.marginTop=document.body.scrollTop-100;
}
function scrollup(){
	document.getElementById('Aviso').style.marginTop=-100;
}*/
function barraestado(){
	setInterval ("window.status = ''",10); 	
}
function enviaremail(){	
	if (document.getElementById("Asunto").value !="" && document.getElementById("Para").value !="")
		document.getElementById("Escribir").submit();
	else
		alert(FaltaRellenarCampoObligatorio);
}
function seleccionadosemails(){
	if (confirm(BorrarLosEmailsSeleccionados))
		document.getElementById("Correos").submit();
	
}
function seleccionartodos(total){
	if (document.getElementById("STodos").checked)
		caso=true;
	else
		caso=false;
	for (i=1;i<=total;i++){
		document.getElementById("S"+i).checked=caso;		
	}
	
}
function borraremail(){
	if (confirm(BorrarEsteEmail))
		document.getElementById("Correo").submit();
}

function irgaleria(i){
	document.getElementById("G"+i).submit();
	
}
function chatear(url){
	var ventana;
	ventana=window.open(url,'ventana','fullscreen=no,resizable=no,scrollbars=no,width=600,height=500,status=yes');
	ventana.focus();
	ventana.moveTo((screen.width-600)/2,(screen.height-500)/2);
}
function mostraraccion(nombre){
	document.getElementById(nombre).style.visibility = "visible";
	//document.getElementById("Invita").style.display = "inline";
}
function ocultaraccion(nombre){
	document.getElementById(nombre).style.visibility = "hidden";
	//document.getElementById(nombre).style.display = "none";
}


//FOTOGRAFIAS AMPLIADAS Y CONTACTO

var ventana;
function abreventana(pagina,ancho,alto){
	var ventana;
	ventana=open(pagina,"","resizable=no,scrollbars=yes,width="+ancho+",height="+alto+",status=no");
	//ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2;
}
var radio;
function abreradio(pagina,ancho,alto){
	var radio;
	radio=open(pagina,"","resizable=no,scrollbars=no,width="+ancho+",height="+alto+",status=no");
	//radio.moveTo((screen.width-ancho)/2,(screen.height-alto)/2;
}
var cont=0
var titulopordefecto = "Kamgoo" //texto por defecto a mostrar en la barra de ttulo en caso de omitir el argumento titulo

function abrefoto(cual,titulo){
	if(cont==1){
		ventana.close();
		ventana=null;
	}
	if(titulo==null)
		titulo=titulopordefecto;

	ventana=window.open('','ventana','resizable=no,scrollbars=no,width=20,height=20,status=no');
	ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)">');
	ventana.document.close();
	cont++;
}
function redimensionar(ancho,alto){
	ventana.resizeTo(ancho,alto+50)
	ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2) //centra la ventana. Eliminar si no se quiere centrar el popup
}
function ocultarpruebas(){
	document.getElementById("Pruebas").style.visibility = "hidden";
	document.getElementById("Pruebas").style.display = "none";	
}

// Traductor 
function cambiar(){
	temp = document.getElementById("dstLang").selectedIndex;
	document.getElementById("dstLang").selectedIndex = document.getElementById("srcLang").selectedIndex;
	document.getElementById("srcLang").selectedIndex=temp;
}

function Traducelo(){  // obtenemos el texto y los idiomas origen y destino
var text    = document.getElementById("Cescribir").value;
var srcLang = document.getElementById("srcLang").value;
var dstLang = document.getElementById("dstLang").value;  // llamada al traductor
google.language.translate(text, srcLang, dstLang, function(result){
     if (!result.error){
	    var resultado = document.getElementById("Traduccion");
		resultado.innerHTML = result.translation;
	 }
	 else alert(result.error.message);
	 });
 
}
function Traducelo2(){  // obtenemos el texto y los idiomas origen y destino
var text    = document.getElementById("Cescribir").value;
var srcLang = document.getElementById("srcLang").value;
var dstLang = document.getElementById("dstLang").value;  // llamada al traductor
translateElement(srcLang, dstLang, text); 
}
function translateElement(srcLang, dstLang, text ){
	Microsoft.Translator.translate(text, srcLang, dstLang, function(translation) {
		var resultado = document.getElementById("Traduccion");
		resultado.innerHTML = translation; 
	}); 
}

function Traduceloemailenviar(){  // obtenemos el texto y los idiomas origen y destino
var text    = document.getElementById("Cuerpo").value;
var text2    = document.getElementById("Asunto").value;
var srcLang = document.getElementById("srcLang").value;
var dstLang = document.getElementById("dstLang").value;  // llamada al traductor
google.language.translate(text, srcLang, dstLang, function(result){
     if (!result.error){
	    var resultado = document.getElementById("Cuerpo");
		resultado.value = result.translation;
	 }
	 else alert(result.error.message);
	 });
google.language.translate(text2, srcLang, dstLang, function(result){
     if (!result.error){
	    var resultado = document.getElementById("Asunto");
		resultado.value = result.translation;
	 }
	 else alert(result.error.message);
	 });
}
function darsedebaja(){
	if(confirm(SeguroDarseDeBaja))
		window.location="darsedebaja.php";
}
function fiestapatton(cual){
		var fo = new SWFObject("fiestas/fiestas.swf?cache="+Math.random(), "presentacion", "100%", "100%", "8", "#181818");		
				
		//Optional Configuration
		//fo.addVariable("langOpenImage", "Open Image in New Window");
		//fo.addVariable("langAbout", "About");	
		fo.addVariable("xmlURL", "fiestas.php");
		fo.addVariable("Galeria", cual);
		fo.write("flashcontent");
		document.getElementById("flashcontent").style.visibility = "visible";
		document.getElementById("flashcontent").style.display = "inline";
		document.getElementById("encabezado").style.visibility = "hidden";
		document.getElementById("encabezado").style.display = "none";
		document.getElementById("cuerpo").style.visibility = "hidden";
		document.getElementById("cuerpo").style.display = "none";
}
function fiestas(fiesta){
		var fo = new SWFObject("disco/fiestas/fiestas.swf?cache="+Math.random(), "presentacion", "100%", "100%", "8", "#181818");		
				
		//Optional Configuration
		//fo.addVariable("langOpenImage", "Open Image in New Window");
		//fo.addVariable("langAbout", "About");	
		fo.addVariable("xmlURL", "disco/fiestas/fiestas.php?Fiesta="+fiesta);
		
		fo.write("flashcontent");
		document.getElementById("flashcontent").style.visibility = "visible";
		document.getElementById("flashcontent").style.display = "inline";
		document.getElementById("encabezado").style.visibility = "hidden";
		document.getElementById("encabezado").style.display = "none";
		document.getElementById("cuerpo").style.visibility = "hidden";
		document.getElementById("cuerpo").style.display = "none";
}
function presentacion(usuario,galeria, nochat){
		var fo = new SWFObject("presentacion/presentacion.swf?cache="+Math.random(), "presentacion", "100%", "100%", "8", "#181818");		
				
		//Optional Configuration
		//fo.addVariable("langOpenImage", "Open Image in New Window");
		//fo.addVariable("langAbout", "About");	
		fo.addVariable("xmlURL", "presentacion/fotografias.php");
		fo.addVariable("Usuario", usuario);
		fo.addVariable("Galeria", galeria);
		
		fo.write("flashcontent");
		document.getElementById("flashcontent").style.visibility = "visible";
		document.getElementById("flashcontent").style.display = "inline";
		document.getElementById("encabezado").style.visibility = "hidden";
		document.getElementById("encabezado").style.display = "none";
		//if (nochat=="1"){
			document.getElementById("cuerpo").style.visibility = "hidden";
			document.getElementById("cuerpo").style.display = "none"
		//}
}
function ocultarpresentacion(){
	document.getElementById("flashcontent").style.visibility = "hidden";
	document.getElementById("flashcontent").style.display = "none";
	document.getElementById("encabezado").style.visibility = "visible";
	document.getElementById("encabezado").style.display = "inline";
	document.getElementById("cuerpo").style.visibility = "visible";
	document.getElementById("cuerpo").style.display = "inline";
}
function multiplesfotos(){
	var elemento;
	var elemento2;
	var navegador = navigator.appName;
	document.getElementById("Multiples").style.visibility = "visible";
	elemento = document.getElementById('cuerpo');
	elemento2 = document.getElementById('encabezado');
	if (navegador == "Microsoft Internet Explorer"){
		elemento.style.filter="alpha(opacity=50)";
		elemento2.style.filter="alpha(opacity=50)";
	}
	else{
		elemento.style.opacity=".50";
		elemento2.style.opacity=".50";
	}
		
}
function ocultarmultiplesfotos(){
	var navegador = navigator.appName;
	var elemento;
	var elemento2;
	elemento = document.getElementById('cuerpo');
	elemento2 = document.getElementById('encabezado');
	document.getElementById("Multiples").style.visibility ="hidden";
	
	if (navegador == "Microsoft Internet Explorer"){
		elemento.style.filter="alpha(opacity=100)";
		elemento2.style.filter="alpha(opacity=100)";
	}
	else{
		elemento.style.opacity=".99";
		elemento2.style.opacity=".99";
	}

}
function actualizarabono(){
	document.getElementById("Pago").action= "privadoabonos2b.php";
	document.getElementById("Pago").submit();

}
function abrirpantalla(numero,idioma){
	var elemento;
	var elemento2;
	var navegador = navigator.appName;
	document.getElementById("Info").style.visibility = "visible";
	elemento = document.getElementById('cuerpo');
	elemento2 = document.getElementById('encabezado');
	document.getElementById("KamgooVar").value="Kamgoo"+numero;
	switch(numero){
	case 1:document.getElementById("Info").style.backgroundImage="url(idiomas/"+idioma+"/imagenes/primerasposiciones.gif)";break;
	case 2:document.getElementById("Info").style.backgroundImage="url(idiomas/"+idioma+"/imagenes/subirvideos.gif)";break;
	case 3:document.getElementById("Info").style.backgroundImage="url(idiomas/"+idioma+"/imagenes/votarvideos.gif)";break;
	case 4:document.getElementById("Info").style.backgroundImage="url(idiomas/"+idioma+"/imagenes/invisibilidadsms.gif)";break;
	}
	if (navegador == "Microsoft Internet Explorer"){
		elemento.style.filter="alpha(opacity=50)";
		elemento2.style.filter="alpha(opacity=50)";
	}
	else{
		elemento.style.opacity=".50";
		elemento2.style.opacity=".50";
	}
}
function abrirdenuncia(){
	var elemento;
	var elemento2;
	var navegador = navigator.appName;
	document.getElementById("Denuncia").style.visibility = "visible";
	elemento = document.getElementById('cuerpo');
	elemento2 = document.getElementById('encabezado');
	if (navegador == "Microsoft Internet Explorer"){
		elemento.style.filter="alpha(opacity=50)";
		elemento2.style.filter="alpha(opacity=50)";
	}
	else{
		elemento.style.opacity=".50";
		elemento2.style.opacity=".50";
	}
}
function enviardenuncia(de,para){
	if(!document.getElementById("Denuncias1").checked && !document.getElementById("Denuncias2").checked && !document.getElementById("Denuncias3").checked && !document.getElementById("Denuncias4").checked && !document.getElementById("Denuncias5").checked){
		alert(ElijaDenuncia);	
	}else{
		observaciones=document.getElementById("Observaciones").value;
		if (observaciones!="" && observaciones!=null){
			if 	(document.getElementById("Denuncias1").checked)
				tipo=document.getElementById("Denuncias1").value;
			if 	(document.getElementById("Denuncias2").checked)
				tipo=document.getElementById("Denuncias2").value;
			if 	(document.getElementById("Denuncias3").checked)
				tipo=document.getElementById("Denuncias3").value;
			if 	(document.getElementById("Denuncias4").checked)
				tipo=document.getElementById("Denuncias4").value;
			if 	(document.getElementById("Denuncias5").checked)
				tipo=document.getElementById("Denuncias5").value;
			elemento = document.getElementById("PonerDenuncia");
			ajax=objetoAjax();
			ajax.open("POST", "denuncias.php",false);
			ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
			ajax.send("Tipo="+tipo+"&Observaciones="+observaciones+"&De="+de+"&Para="+para);
			if((ajax.readyState == 4) && (ajax.status == 200))
				elemento.innerHTML = ajax.responseText;
		}else{
			alert(RellenarCamposObligatorios);		
		}
	}
}
function cerrarpantalla(cual){
	var navegador = navigator.appName;
	var elemento;
	var elemento2;
	elemento = document.getElementById('cuerpo');
	elemento2 = document.getElementById('encabezado');
	document.getElementById(cual).style.visibility ="hidden";
	
	if (navegador == "Microsoft Internet Explorer"){
		elemento.style.filter="alpha(opacity=100)";
		elemento2.style.filter="alpha(opacity=100)";
	}
	else{
		elemento.style.opacity=".99";
		elemento2.style.opacity=".99";
	}
}
function ponerinv(usuario,opcion){
			elemento = document.getElementById('MeterAviso');
			ajax=objetoAjax();
			ajax.open("POST", "cargar/hacerteinvisible.php",false);
			ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
			ajax.send("opcion="+opcion+"&usuario="+usuario);
			if((ajax.readyState == 4) && (ajax.status == 200))
				elemento.innerHTML = ajax.responseText;
			/*if (opcion=="1"){
				document.getElementById("marco").PInvi.GotoFrame(2);
			}else{
				document.getElementById("marco").PInvi.GotoFrame(1);
			}*/
}
function editarestado(){
	document.getElementById("CEstado").style.visibility = "visible";
	document.getElementById("CEstado").style.display = "inline";
}
function cancelarestado(){
	document.getElementById("CEstado").style.visibility = "hidden";
	document.getElementById("CEstado").style.display = "none";
}
function guardarestado(){
	document.getElementById("FEstado").submit();
}
function anunciate(usuario,idioma){
	/*elemento = document.getElementById('Anunciate');
	texto="";
	while (texto=="")
		texto=prompt(MeterAnuncio,'').substring(0,100);*/
	abrir("insertamensaje.php?Poder=3&Id_Usuario="+usuario+"&Idioma="+idioma,"420","510","Anunciate");
	/*ajax=objetoAjax();
	ajax.open("POST", "anunciate.php",false);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	ajax.send("Id_Usuario="+usuario+"&Texto="+texto);
	if((ajax.readyState == 4) && (ajax.status == 200))
		elemento.innerHTML = ajax.responseText;*/
}
function actanunciate(usuario){
	elemento = document.getElementById('Anunciate');
	ajax=objetoAjax();
	ajax.open("POST", "anunciate.php",false);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	ajax.send("Id_Usuario="+usuario);
	if((ajax.readyState == 4) && (ajax.status == 200))
		elemento.innerHTML = ajax.responseText;
}
function publicaranuncio(){
campos=["Texto"];
	if (camposvacios(campos))
		PublicarAnuncio.submit();		
}
function publicarregalo(){
campos=["Texto"];
	if (camposvacios(campos))
		PublicarRegalo.submit();		
}
function cambiarsexy(poner, usuario){
		elemento = document.getElementById('ParteSexy');
		ajax=objetoAjax();
		ajax.open("POST", "cambiarsexy.php",false);
		ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
		ajax.send("Id_Usuario="+usuario+"&Poner="+poner);
		if((ajax.readyState == 4) && (ajax.status == 200))
			elemento.innerHTML = ajax.responseText;
		window.location="privadokamgoo.php";
	
}
function buscarsexy(voto){
	elemento = document.getElementById('EncontradoSexy');
	idfoto=document.getElementById('IdFoto').value;
	soy = document.getElementById('Soy2x').value;
	pais = document.getElementById('Pais').value;
	sexualidad= document.getElementById('Sexualidad').value;
	edad1 = document.getElementById('Edad1x').value;
	edad2 = document.getElementById('Edad2x').value;
	ajax=objetoAjax();
	ajax.open("GET", "buscarsexy.php?Voto="+voto+"&IdFoto="+idfoto+"&Soy="+soy+"&Pais="+pais+"&Sexualidad="+sexualidad+"&Edad1="+edad1+"&Edad2="+edad2+"&nocache="+Math.random(),true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.setRequestHeader("Accept-Charset", "iso-8859-1");  
	
	elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";		
		ajax.onreadystatechange = function(){
			 if(ajax.readyState==1){ 
				elemento.innerHTML = "<div style='text-align:center;width:100%;margin-top:100px; margin-bottom:50px;'><br><br><br><img src='idiomas/imagenes/cargando.gif'></div><br><br><br>";			
			 }else if (ajax.readyState==4) {
				 if(ajax.status==200){ 
				 	elemento.innerHTML = ajax.responseText;					 
				 }
			 }				
		}
	ajax.send(null);
	
}
