/* Función para validación de formularios */
function miniest(nombre) {
   	if (nombre.value.length ==0) {
		alert ('Ingrese el nick del personaje');
		nombre.focus();
		return false;
	}
	
	  	var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZ" + "abcdefghijklmnñopqrstuvwxyz ";
  		var checkStr = nombre.value;
  		var allValid = true; 
  			for (i = 0; i < checkStr.length; i++) {
    			ch = checkStr.charAt(i); 
    			for (j = 0; j < checkOK.length; j++)
      				if (ch == checkOK.charAt(j))
       			 	break;
    				if (j == checkOK.length) { 
      				allValid = false; 
      			break; 
    			}
  			}
  		if (!allValid) { 
   		alert("El personaje no existe."); 
   		nombre.focus(); 
    	return (false); 
  		} 
}
/*----------------------------------------*/
function recu(formulario) {

if (formulario.nick.value.length < 1) {
    alert("Por favor ingrese un \"Nick\".");
    formulario.nick.focus();
    return (false);
  }


  var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZ" + "abcdefghijklmnñopqrstuvwxyz ";
  var checkStr = formulario.nick.value;
  var allValid = true; 
  for (i = 0; i < checkStr.length; i++) {
    ch = checkStr.charAt(i); 
    for (j = 0; j < checkOK.length; j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length) { 
      allValid = false; 
      break; 
    }
  }
  if (!allValid) { 
    alert("El personaje no existe."); 
    formulario.nick.focus(); 
    return (false); 
  } 
  if ((formulario.mail.value.indexOf ('@', 0) == -1)||(formulario.mail.value.indexOf ('.', 0) == -1)) { 
    alert("Escriba una dirección de correo válida en el campo \"Email\"."); 
	formulario.mail.focus()
    return (false); 
  }
  return (true); 
}

function borrar(campo) {
campo.value='';
}

function panel(form) {
   	if (form.nick_p.value.length ==0) {
		alert ('Ingrese el nick del personaje');
		form.nick_p.focus();
		return false;
	}
	
	  	var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZ" + "abcdefghijklmnñopqrstuvwxyz ";
  		var checkStr = form.nick_p.value;
  		var allValid = true; 
  			for (i = 0; i < checkStr.length; i++) {
    			ch = checkStr.charAt(i); 
    			for (j = 0; j < checkOK.length; j++)
      				if (ch == checkOK.charAt(j))
       			 	break;
    				if (j == checkOK.length) { 
      				allValid = false; 
      			break; 
    			}
  			}
  		if (!allValid) { 
   		alert("El personaje no existe."); 
   		form.nick_p.focus(); 
    	return (false); 
  		} 
	return true;
}

function verimagen_noticias(url) {
	var theTop = 30;
	var imagen = document.getElementById('imagengrande');
   	imagen.innerHTML='<img src="'+url+'"  title="Click aquí para cerrar la imagen" border="1"/>';
	imagen.style.display = 'block';
  
    if (window.innerHeight) {
			 pos = window.pageYOffset
	} else if (document.documentElement && document.documentElement.scrollTop) {
			pos = document.documentElement.scrollTop
	} else if (document.body) {
			 pos = document.body.scrollTop
	}
	
	if (pos < theTop)
		pos = theTop;
	else
		pos += 30;
	
	imagen.style.top = pos + 'px';
	return false;
	
}

function ocultar() {
	document.getElementById('imagengrande').style.display="none";
}