<!--
//Documento JavaScript por Moisés D. Busanya

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//Funciones HOMEPAGE
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//

// Función de cambio de fondo dependiendo de la promo

function f_cambia_fondo(v_promo) {
		var v_capa = document.getElementById("fondo");
		var v_fondo = "edge_trailer/edge_trailer_fondo_"+v_promo+".jpg"+ "?id=" + new Date().getTime();
		v_capa.style.backgroundImage = "url(" + v_fondo + ")";
}

// Función de cambio de fondo de menú

function f_menu(v_imagen,v_capa_id) {
		var v_capa = document.getElementById(v_capa_id);
		v_capa.style.backgroundImage = "url(" + v_imagen + ")";
		 if (navigator.appName=="Netscape") {
			v_capa.style.cursor='pointer';
		} else {
			v_capa.style.cursor='hand';
		}
}

// Función de votación por estrellas

function f_estrellas(v_capa_id,v_estrella) {
		var v_capa_1 = document.getElementById(v_capa_id+"_1");
		var v_capa_2 = document.getElementById(v_capa_id+"_2");
		var v_capa_3 = document.getElementById(v_capa_id+"_3");
		var v_capa_4 = document.getElementById(v_capa_id+"_4");
		var v_capa_5 = document.getElementById(v_capa_id+"_5");
		
		v_capa_1.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		v_capa_2.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		v_capa_3.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		v_capa_4.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		v_capa_5.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		
		if (v_estrella==1)
		{
			
			v_capa_1.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
		
		}
		
		if (v_estrella==2)
		{
			
			v_capa_1.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_2.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
		
		}
		
		if (v_estrella==3)
		{
			
			v_capa_1.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_2.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_3.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
		
		}
		
		if (v_estrella==4)
		{
			
			v_capa_1.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_2.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_3.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_4.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
		
		}
		
		if (v_estrella==5)
		{
			
			v_capa_1.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_2.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_3.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_4.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
			v_capa_5.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_on.jpg)";
		
		}
}

// Función de votación por estrellas (APAGADO)

function f_estrellas_apaga(v_capa_id) {
		var v_capa_1 = document.getElementById(v_capa_id+"_1");
		var v_capa_2 = document.getElementById(v_capa_id+"_2");
		var v_capa_3 = document.getElementById(v_capa_id+"_3");
		var v_capa_4 = document.getElementById(v_capa_id+"_4");
		var v_capa_5 = document.getElementById(v_capa_id+"_5");
		
		v_capa_1.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		v_capa_2.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		v_capa_3.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		v_capa_4.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
		v_capa_5.style.backgroundImage = "url(edge_public/img_edge/edge_star_user_off.jpg)";
}

// Mostrar ocultar combos registro

function mostrar_ocultar(valor) {
 	document.getElementById('v_provincia_s').style.display="none";
 	document.getElementById('v_provincia_f').style.display="none";
 	document.getElementById('v_provincia_u').style.display="none";
 	document.getElementById('v_provincia_i').style.display="none";
	if (valor.value == "Spain") {
		document.getElementById('v_provincia_s').style.display="block";
	} else {
		if (valor.value == "France") {
			document.getElementById('v_provincia_f').style.display="block";
		} else {
		
			if (valor.value == "United States") {
				document.getElementById('v_provincia_u').style.display="block";
			} else {
				document.getElementById('v_provincia_i').style.display="block";
		}
		}
	}
}

function mostrar_ocultar_b(valor) {
 	document.getElementById('v_provincia_s_b').style.display="none";
 	document.getElementById('v_provincia_f_b').style.display="none";
 	document.getElementById('v_provincia_u_b').style.display="none";
 	document.getElementById('v_provincia_i_b').style.display="none";
	if (valor.value == "Spain") {
		document.getElementById('v_provincia_s_b').style.display="block";
	} else {
		if (valor.value == "France") {
			document.getElementById('v_provincia_f_b').style.display="block";
		} else {
		
			if (valor.value == "United States") {
				document.getElementById('v_provincia_u_b').style.display="block";
			} else {
				document.getElementById('v_provincia_i_b').style.display="block";
		}
		}
	}
}

// Valida registro

function f_valida_registro() {
 
 	errores="";
	
	var v_reg_edad=document.frm_registro.v_reg_edad.value;
	var v_fecha_js = new Date();
	mes=v_reg_edad.split("/")[0];
	dia=v_reg_edad.split("/")[1];
	anyo=v_reg_edad.split("/")[2];
		
	if (v_reg_edad.length>0) {
		if( (isNaN(dia)==true) || (isNaN(mes)==true) || (isNaN(anyo)==true) )
		{
			errores="The date of birth entered is incorrect.";
			document.getElementById('v_reg_edad').focus();
		}
		if(anyoBisiesto(anyo))
			febrero=29;
		else
			febrero=28;
		
		if ((mes<1) || (mes>12))
		{
			errores= "The month entered in the date of birth is not valid. Please enter the correct month.";
			document.getElementById('v_reg_edad').focus();
		}
		
		if ((mes==2) && ((dia<1) || (dia>febrero)))
		{
			errores= "The day entered in the date of birth is not valid. Please enter the correct day.";
			document.getElementById('v_reg_edad').focus();
		}
		
		if (((mes==1) || (mes==3) || (mes==5) || (mes==7) || (mes==8) || (mes==10) || (mes==12)) && ((dia<1) || (dia>31)))
		{
			errores= "The day entered in the date of birth is not valid. Please enter the correct day.";
			document.getElementById('v_reg_edad').focus();
		
		}
		
		if (((mes==4) || (mes==6) || (mes==9) || (mes==11)) && ((dia<1) || (dia>30)))
		{
		errores= "The day entered in the date of birth is not valid. Please enter the correct day.";
		document.getElementById('v_reg_edad').focus();
		
		}
		
		if ((anyo<1900) || (anyo>2020))
		{
		errores= "The year entered in the date of birth is not valid. Please enter a year between 1900 and 2020.";
		document.getElementById('v_reg_edad').focus();
		
		}
		
		if ((v_fecha_js.getFullYear()-anyo)<12)
		{
		errores= "You must be 12 years old to register as a user in Fantasy Flight Games.";
		document.getElementById('v_reg_edad').focus();
		
		}
	}
	   
	if (document.frm_registro.v_reg_clave.value != document.frm_registro.v_reg_clave_2.value){
	
		errores="The password you have entered doesn't match.";
		document.getElementById('v_reg_clave').focus();
	
	}
		
	if (document.frm_registro.v_reg_email.value != document.frm_registro.v_reg_email_2.value){
	
		errores="The email address you have entered doesn't match.";
		document.getElementById('v_reg_email').focus();
		
	}
		
	if (document.frm_registro.v_reg_nickname.value.length<3){
	
		errores="The player name must be at least three characters long.";
		document.getElementById('v_reg_nickname').focus();
		
	}
		
	if (document.frm_registro.v_reg_clave.value.length<6){
	
		errores="The password must be at least six characters long.";
		document.getElementById('v_reg_clave').focus();
		
	}
		
	var filter=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;

	if (!(filter.test(document.frm_registro.v_reg_email.value))){
		errores="The email address is incorrect.";
		document.getElementById('v_reg_email').focus();
	}
		
	if (document.frm_registro.v_reg_nickname.value == "" || document.frm_registro.v_reg_clave.value == "" || document.frm_registro.v_reg_clave_2.value == "" || document.frm_registro.v_reg_email.value == "" || document.frm_registro.v_reg_email_2.value == "" || document.frm_registro.v_reg_nombre.value == "" || document.frm_registro.v_reg_apellidos.value == "" || document.frm_registro.v_reg_pais.value == "0" || document.frm_registro.v_reg_seguridad.value == "" || document.frm_registro.v_reg_edad.value == "" || (document.frm_registro.v_provincia_i.value == "" && document.frm_registro.v_provincia_s.value == "" && document.frm_registro.v_provincia_f.value == ""))
	   errores= "You can't leave a required field blank.";
	   
 	if (errores=="")
	{
		document.frm_registro.submit();
	}
	else
	{
	 	errores="\nFantasy Flight Games warns:\n\n"+errores;
		alert(errores);
	}
					

}

//Año bisiesto
function anyoBisiesto(anyo)
{
	if (anyo < 100)
	var fin = anyo + 1900;
	else
	var fin = anyo ;
	
	
	if (fin % 4 != 0)
	return false;
	else
	{
	if (fin % 100 == 0)
	{
	
	if (fin % 400 == 0)
	{
	return true;
	}
	
	else
	{
	return false;
	}
	}
	
	else
	{
	return true;
	}
	}
}

// Valida Configuracion perfil

function f_valida_cfg() {
 
 	errores="";
		   
	if (document.frm_registro.v_reg_clave.value != document.frm_registro.v_reg_clave_2.value){
	
		errores="The password you have entered doesn't match.";
		document.getElementById('v_reg_clave').focus();
	
	}
		
	if (document.frm_registro.v_reg_clave.value.length<6 && document.frm_registro.v_reg_clave_2.value!=""){
	
		errores="The password must be at least six characters long.";
		document.getElementById('v_reg_clave').focus();
		
	}
	
	if (document.frm_registro.v_email.value != document.frm_registro.v_email_2.value){
	
		errores="The email addresses you have entered doesn't match.";
		document.getElementById('v_email').focus();
		
	}
	
	var filter=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;

	if (!(filter.test(document.frm_registro.v_email.value))){
		errores="The email address is incorrect.";
		document.getElementById('v_email').focus();
	}
		
	if (document.frm_registro.v_reg_clave_act.value == "")
	   errores= "You must enter your password to make changes.";
	   
 	if (errores=="")
	{
		document.frm_registro.submit();
	}
	else
	{
	 	errores="\nFantasy Flight Games warns:\n\n"+errores;
		alert(errores);
	}
					

}

// Valida perfil

function f_valida_edita_perfil() {
 
 	errores="";
	
	fckEditor1val = FCKeditorAPI.__Instances['v_firma'].GetHTML();		
	document.getElementById('v_firma').value = fckEditor1val;
		
	if (document.frm_registro.v_reg_pais.value==0 || (document.frm_registro.v_provincia_i.value=="" && document.frm_registro.v_provincia_s.value==0 && document.frm_registro.v_provincia_f.value==0)){
	
		errores="You must enter the country and state.";
		document.getElementById('v_reg_pais').focus();
		
	}
	   
 	if (errores=="")
	{
		document.frm_registro.submit();
	}
	else
	{
	 	errores="\nFantasy Flight Games warns:\n\n"+errores;
		alert(errores);
	}
					

}

// Valida ludoteca

function f_valida_edita_ludoteca() {
 
	errores="";
	
	if (document.frm_registro.v_top_1.value==document.frm_registro.v_top_2.value || document.frm_registro.v_top_1.value==document.frm_registro.v_top_3.value || document.frm_registro.v_top_1.value==document.frm_registro.v_top_4.value || document.frm_registro.v_top_1.value==document.frm_registro.v_top_5.value){
	
		if (document.frm_registro.v_top_2.value>0 || document.frm_registro.v_top_3.value>0 || document.frm_registro.v_top_4.value>0 || document.frm_registro.v_top_5.value>0){
		
		errores="Two Tops can't be the same.";
		
		}
		
	}
	
	if (document.frm_registro.v_top_2.value==document.frm_registro.v_top_3.value || document.frm_registro.v_top_2.value==document.frm_registro.v_top_4.value || document.frm_registro.v_top_2.value==document.frm_registro.v_top_5.value){
	
		if (document.frm_registro.v_top_3.value>0 || document.frm_registro.v_top_4.value>0 || document.frm_registro.v_top_5.value>0){
		
		errores="Two Tops can’t be the same.";
		
		}
		
	}
	
	if (document.frm_registro.v_top_3.value==document.frm_registro.v_top_4.value || document.frm_registro.v_top_3.value==document.frm_registro.v_top_5.value){
	
		if (document.frm_registro.v_top_4.value>0 || document.frm_registro.v_top_5.value>0){
		
		errores="Two Tops can’t be the same.";
		
		}
		
	}
	
	if (document.frm_registro.v_top_4.value==document.frm_registro.v_top_5.value){
	
		if (document.frm_registro.v_top_5.value>0){
		
		errores="Two Tops can’t be the same.";
		
		}
		
	}
		
	if (document.frm_registro.v_top_1.value==0 && (document.frm_registro.v_top_2.value>0 || document.frm_registro.v_top_3.value>0 || document.frm_registro.v_top_4.value>0 || document.frm_registro.v_top_5.value>0)){
	
		errores="You can’t add a Top greater than Top 1 without defining Top 1 first.";
		
	}
	
	if (document.frm_registro.v_top_2.value==0 && (document.frm_registro.v_top_3.value>0 || document.frm_registro.v_top_4.value>0 || document.frm_registro.v_top_5.value>0)){
	
		errores="You can’t add a Top greater than Top 2 without defining Top 2 first.";
		
	}
	
	if (document.frm_registro.v_top_3.value==0 && (document.frm_registro.v_top_4.value>0 || document.frm_registro.v_top_5.value>0)){
	
		errores="You can’t add a Top greater than Top 3 without defining Top 3 first.";
		
	}
	
	if (document.frm_registro.v_top_4.value==0 && (document.frm_registro.v_top_5.value>0)){
	
		errores="You can’t add a Top greater than Top 4 without defining Top 4 first.";
		
	}
	
	if (document.frm_registro.v_top_1.value==0 && document.frm_registro.v_top_2.value==0 && document.frm_registro.v_top_3.value==0 && document.frm_registro.v_top_4.value==0 && document.frm_registro.v_top_5.value==0){
	
		errores="";
		
	}
	   
 	if (errores=="")
	{
		document.frm_registro.submit();
	}
	else
	{
	 	errores="\nFantasy Flight Games warns:\n\n"+errores;
		alert(errores);
	}

}

// Valida Buscador amigos

function f_busca_amigos() {
 
 	errores="";
		
	if (document.frm_registro.v_buscar_ami_j.value=="" && document.frm_registro.v_buscar_ami_c.value=="" && document.frm_registro.v_buscar_ami_p.value==""){
	
		errores="You must enter a concrete concept for the search.";
		
	}
	   
 	if (errores=="")
	{
		document.frm_registro.submit();
	}
	else
	{
	 	errores="\nFantasy Flight Games warns:\n\n"+errores;
		alert(errores);
	}
					

}

// Valida Aceptar amigos

function f_valida_amigos() {
 
 	errores="";
		
	
	   
 	if (errores=="")
	{
		document.frm_registro.submit();
	}
	else
	{
	 	errores="\nFantasy Flight Games warns:\n\n"+errores;
		alert(errores);
	}
					

}

// Valida tema foro

function f_valida_tema() {
	
	var errores="";
	
	fckEditor1val = FCKeditorAPI.__Instances['v_texto'].GetHTML();		
	document.getElementById('v_texto').value = fckEditor1val;
	
	if ((document.frm_crear_tema.v_titulo_tema.value == "")||(document.frm_crear_tema.v_texto.value == "")) {
		errores="The Post of Topic can’t be left blank.";
	 }
	 
	 if (document.frm_crear_tema.v_texto.value.length < 25) {
		errores="The post is too short to be published.";
	 }
	 
	 if (errores=="")
	{
				
		document.frm_crear_tema.submit();
	}
	else
	{
		
	 	document.getElementById('v_envio').value = 0;
		errores="\nError in the form:\n\n"+errores;
		alert(errores);
	}

}

// Valida respuesta foro

function f_valida_respuesta() {
	
	var errores="";
	
	fckEditor1val = FCKeditorAPI.__Instances['v_texto'].GetHTML();		
	document.getElementById('v_texto').value = fckEditor1val;
	
	if (document.frm_crear_tema.v_texto.value == "") {
		errores="The Message can’t be left blank.";
	 }
	 
	 if (document.frm_crear_tema.v_texto.value.length < 25) {
		errores="The post is too short to be published.";
	 }
	 
	 if (errores=="")
	{
				
		document.frm_crear_tema.submit();
	}
	else
	{
		
	 	document.getElementById('v_envio').value = 0;
		errores="\nError in the form:\n\n"+errores;
		alert(errores);
	}

}

// Valida reporte foro

function f_valida_reporte() {
	
	var errores="";
	
	fckEditor1val = FCKeditorAPI.__Instances['v_texto'].GetHTML();		
	document.getElementById('v_texto').value = fckEditor1val;
	
	if (document.frm_crear_tema.v_texto.value == "") {
		errores="The Message can’t be left blank.";
	 }
	 
	 if (errores=="")
	{
				
		document.frm_crear_tema.submit();
	}
	else
	{
		
	 	document.getElementById('v_reportar').value = 0;
		errores="\nError in the form:\n\n"+errores;
		alert(errores);
	}

}

// Valida mover tema foro

function f_valida_mover() {
	
	var errores="";
	 
	 if (document.frm_mover_tema.v_foro_final.value == 0) {
		errores="Choose the Forum you want.";
	 }
	 
	 if (errores=="")
	{
				
		document.frm_mover_tema.submit();
	}
	else
	{
		
		errores="\nError in the form:\n\n"+errores;
		alert(errores);
	}

}

//Contador de caracteres

function f_contador (campo, cuentacampo, limite) {
if (campo.value.length > limite) campo.value = campo.value.substring(0, limite);
else cuentacampo.value = limite - campo.value.length;
}

//Redimensiona pagina de perfil

function f_redimensiona(altura,capa){
	
	var valor = document.getElementById(capa).offsetHeight;
	
	if (valor<altura){
		
		document.getElementById(capa).style.height="730px";
	
	}
	
}

//Recalcula carrito

function f_recalcula(){
	
	var errores="";
	
	var elementos = document.frm_carrito.elements.length;
		
	for (v_i=0;v_i<=elementos-1;v_i++) {
		
		if (isNaN(document.frm_carrito.elements[v_i].value)) errores="Some of the amounts entered are not a number.";
		
	}
	
	 if (errores=="") {
				
		document.frm_carrito.action="edge_tienda_carrito.asp?etacc=3";
		document.frm_carrito.submit();
		
	}
	else
	{
		errores="\nError in the form:\n\n"+errores;
		alert(errores);
	}
	
}

//Formaliza carrito

function f_formaliza(){
	
	var errores="";
	
	var elementos = document.frm_carrito.elements.length;
		
	for (v_i=0;v_i<=elementos-1;v_i++) {
		
		if (isNaN(document.frm_carrito.elements[v_i].value)) errores="Some of the amounts entered are not a number.";
		
	}
	
	 if (errores=="") {
				
		document.frm_carrito.action="edge_tienda_st_1.asp";
		document.frm_carrito.submit();
		
	}
	else
	{
		errores="\nError in the form:\n\n"+errores;
		alert(errores);
	}
	
}

//Valida Pedidos Tienda
function f_valida_pedido() {
    var errores="";
	
	var filter=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

	if (!(filter.test(document.frm_carrito.v_email.value))){
		errores="The email address is incorrect.";
		document.getElementById('v_email').focus();
	}
	
	if (document.frm_carrito.v_pago.value == 0) {
		
	   		errores= "You must indicate the Method of Payment.";
		
	 }
	
	if (document.frm_carrito.v_zona.value == 0) {
		
	   		errores= "The Zone can’t be left blank.";
		
	 }
	
	if (document.frm_carrito.v_nombre.value == "" || document.frm_carrito.v_apellidos.value == "" || document.frm_carrito.v_telefono.value == "" || document.frm_carrito.v_dni.value == "" || document.frm_carrito.v_pais.value == 0 || (document.frm_carrito.v_provincia_s.value == 0 && document.frm_carrito.v_pais.value == "Spain") || (document.frm_carrito.v_provincia_f.value == 0 && document.frm_carrito.v_pais.value == "France") || (document.frm_carrito.v_provincia_i.value == "" && (document.frm_carrito.v_pais.value != "Spain" && document.frm_carrito.v_pais.value != "France")) || document.frm_carrito.v_localidad.value == "" || document.frm_carrito.v_direccion.value == "" || document.frm_carrito.v_codigo.value == "" || document.frm_carrito.v_email.value == "") {
		
	   		errores= "You can't leave a required field blank.";
		
	 }
	 
	 //Comprobamos DNI si es de España
	 
	  if (document.frm_carrito.v_pais.value == "Spain" && ! nif(document.frm_carrito.v_dni.value)) {
		
	   		errores= "El DNI no es un DNI correcto.";
		
	 }
	 
	 //Comprobamos que no deje el campo de país de envío en blanco si rellena al menos el nombre de dirección de envío
	 
	 if (document.frm_carrito.v_nombre_b.value != "" && document.frm_carrito.v_pais_b.value == 0) {
		
	   		errores= "Indica el país del destinatario o deja todo el apartado de destinatario en blanco.";
		
	 }
	 
	 //Contrareembolso solo en España
	 
	 if (document.frm_carrito.v_pago.value==3 && document.frm_carrito.v_zona.value!=1) {
		 
		 errores="Pay on Delivery orders are only accepted for continental Spain and the Balearic Islands."
		 
	} 
	
	 if (errores=="")
	{
				
		document.frm_carrito.action="edge_tienda_st_2.asp";
		document.frm_carrito.submit();
		
	}
	else
	{
		
	 	errores="\nError in the form:\n\n"+errores;
		
		alert(errores);
	}
}

//Valida cambia categoría noticias
function f_cambia_categoria() {
	
	if(document.getElementById('news_cat').value!="0"){
			
		window.location.href="edge_news.asp?etyn=1&ecan="+document.getElementById('news_cat').value+"&epn=0";
		
	}
	
}

//Atencion Jugador

function f_atencion(){
	
	var errores="";
	
	if (document.frm_registro.v_nombre.value=="" || document.frm_registro.v_email.value=="" || document.frm_registro.v_mensaje.value=="" || document.frm_registro.v_asunto.value==0) {
		
			errores="You can't leave a required field blank."
		
	}
	
	var filter=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

	if (!(filter.test(document.frm_registro.v_email.value))){
		errores="The email address is incorrect.";
		document.getElementById('v_email').focus();
	}
	
	 if (errores=="") {
				
		document.frm_registro.action="edge_atencion.asp";
		document.frm_registro.submit();
		
	}
	else
	{
		errores="\nError in the form:\n\n"+errores;
		alert(errores);
	}
	
}

// Valida mensajeria privada

function f_valida_envia_mail() {
 
 	errores="";
		
	if (document.frm_mensajes.v_mensaje.value==""){
	
		errores="The content of the email can’t be left blank.";
		document.getElementById('v_mensaje').focus();
		
	}
	   
 	if (errores=="")
	{
		document.frm_mensajes.submit();
	}
	else
	{
	 	errores="\nFantasy Flight Games warns:\n\n"+errores;
		alert(errores);
	}
					

}

function nif(dni) {
  numero = dni.substr(0,dni.length-1);
  let = dni.substr(dni.length-1,1);
  numero = numero % 23;
  letra='TRWAGMYFPDXBNJZSQVHLCKET';
  letra=letra.substring(numero,numero+1);
  if (letra!=let) {
    return false;
  }else{
    return true;
  }
}

//+++++++++++++++++++++++++++++++++++++++++++//
//Estas funciones son de AJAX
//+++++++++++++++++++++++++++++++++++++++++++//

function llamada (url, id_contenedor)
{
    var pagina_requerida = false;
	//alert(url);
    if (window.XMLHttpRequest)
    {
        //Si es Mozilla, Safari etc
        pagina_requerida = new XMLHttpRequest ();
    } else if (window.ActiveXObject)
    {
        //pero si es IE
        try 
        {
            pagina_requerida = new ActiveXObject ("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            //en caso que sea una versión antigua
            try
            {
                pagina_requerida = new ActiveXObject ("Microsoft.XMLHTTP");
            }
            catch (e)
            {
            }
        }
    } 
    else
    return false;
    pagina_requerida.onreadystatechange = function ()
    {
        //función de respuesta
        cargarpagina (pagina_requerida, id_contenedor);
    }
    pagina_requerida.open ('GET', url, true); //asignamos los métodos open y send
    pagina_requerida.send (null);
}
//Todo es correcto y ha llegado el momento de poner la información requerida
//en su sitio en la pagina xhtml
function cargarpagina (pagina_requerida, id_contenedor)
{
    if (pagina_requerida.readyState == 4 && (pagina_requerida.status == 200 || window.location.href.indexOf ("http") == - 1))
    document.getElementById (id_contenedor).innerHTML = pagina_requerida.responseText;
}

//-->
