function validate_formNewUser(existe)
{
	var ko         = 0;
	var nick       = document.getElementById('nick');
	var password   = document.getElementById('password');
	var password2  = document.getElementById('password2');

	if (existe=="nick") {
		ko = 1;
		alert(TXT['user_exists']);
		login.focus();
		return false;
	}
	if (existe=="email") {
		ko = 1;
		alert(TXT['mail_exists']);
		email.focus();
		return false;
	}
	if (fnacimiento.value == '') {
		ko = 1;
		alert(TXT['write_obligatory_field']);
		fnacimiento.focus();
	}

	/*
	if (login.value == '') {
		ko = 1;
		alert(TXT['write_obligatory_field']);
		login.focus();
	}*/
	if ((password.value != '') && (password.value != password2.value)) {
		ko = 1;
		alert(TXT['error_repeat_pass']);
		login.focus();
	}
	if (ko == 1) {
		return false;
	} else {
		return document.formregistro.submit();
	}
}

function checkLoginMail()
{
 var nick      = document.getElementById('nick');
 var email     = document.getElementById('email');
 var iduser    = document.getElementById('iduser');
 oculto.location='/miscelany/checkLoginMail.php?nick='+ nick.value +'&email='+ email.value +'&iduser='+ iduser.value;
}

function cambiar_imgback(id, img){
   var obj = document.getElementById(id);
   obj.style.background="url("+img+") center no-repeat";
}

function open_popup(pagina,ancho,alto)
{
 var danch = (screen.availWidth / 2)-(ancho/2);
 var dalt = (screen.availHeight / 2)-(alto/2);
 poput=window.open(pagina,'ventana','menubar=no,location=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,width='+ ancho +',height='+ alto +',top='+ dalt +',left='+ danch)
}

function agregar(alias){
   if ((navigator.appName=="Microsoft Internet Explorer") &&
         (parseInt(navigator.appVersion)>=4)) {
      var url="http://www.AfroditaX.com/";
      if (alias != 'afroditax') {
      	url = url + '?alias=' + alias;
      }
      var titulo="AfroditaX: Mujeres Amateur con Webcam, Sexo por Webcam con Tarjeta de Credito y 803. Totalmente Amateur";
      window.external.AddFavorite(url,titulo);
   } else {
      if(navigator.appName == "Netscape")
         alert("Presione Crtl+D para agregar este sitio en sus Marcadores");
   }
}

function validar()
{
	var ko=0;
	var email   = document.getElementById('email');
	if (email.value == '') {
		ko = 1;
		alert('Introduzca su email');
		email.focus();
		return false;
	}

	return true;

}

function validar_contact()
{
	var ko      = 0;
	var asunto  = document.getElementById('asunto');
	var mensaje = document.getElementById('mensaje');
	var email   = document.getElementById('email');
	if (asunto.value == '') {
		ko = 1;
		alert("Indicanos el asunto del mensaje, por favor");
		asunto.focus();
		return false;
	}
	if (mensaje.value == '') {
		ko = 1;
		alert("Necesitamos saber cual es el problema, no has escrito nada");
		mensaje.focus();
		return false;
	}
	if (email.value == '') {
		ko = 1;
		alert("Necesitamos tu email para poder responderte");
		email.focus();
		return false;
	}
	if (ko == 1) {
		return false;
	} else {
		//form.submit();
		return true;
	}
}