/* ======================================================================
volver
========================================================================= */
function volverInicio() {
	window.location = '../index.html';
}
function cambiofondo()
{
var bucle=0;
for (bucle; bucle<10; bucle++ )
{
document.bgColor="silver";
document.bgColor="lightslategray";
document.bgColor="lightgreen";
document.bgColor="lightblue";
document.bgColor="white";
document.bgColor="yellow";
document.bgColor="blue";
document.bgColor="black";
document.bgColor="white";
}
}
function cambiar_framedcha(parametro) {
	alert("Voy a llevarte a la pantalla " + parametro);
	window.parent.frames["principal"].location=parametro;
}
function aparecer(msg){
  mitabla.style.display = 'block';
  document.forms["miformulario"].mensaje.value=msg;
  document.forms["miformulario"].mensaje.style.color='red';
  window.status=msg;
}
 function desaparecer(){
  mitabla.style.display = 'none';
  document.forms["miformulario"].mensaje.value="";
}
function evaluar() {
}
/* ======================================================================
Variables globales que necesitamos
=========================================================================*/ 
var navegador = navigator.appName;
var longMaximaPalabra = 0; //longitud Maxima de la palabra
var arrayPreguntas;
var lenArrayPreguntas;

var arrayRespuestas;
var lenArrayRespuestas;
var n=0; //nº intentos;
var cuenta=0;
var porc=0;
var nota=0;

var strTituloPagina = "";
var strPreguntas = "";
var strRespuestas ="";
var juego="";
var strMensajeAbandonar="Seguro que quieres abandonar este juego ??";
var ayudaRespuestas="";
/* ======================================================================
funciones visibilidad
=========================================================================*/
function AparecerAyuda(){
	//ayuda.style.display='block';
	var texto="<h6>¡¡ NO ESTÁ BIEN !!</h6> " +
	"<p>Inténtalo de nuevo";
	pintarAyuda(texto);
}
function AparecerOtra(){
	//Otra.style.display='block';
	var texto="<h6>¡¡ TAMPOCO ESTABA BIEN !!</h6> " +
	"<p>Inténtalo de nuevo";
	pintarAyuda(texto);
}
function AparecerBien(){
	//Bien.style.display='block';
	//alert("en bien");
		var texto="<h6>¡¡ MUY BIEN !!</h6> " +
"<p>Fenómeno, sigue así.<br>";
//"Llevas un <label id='porcentaje'>0</label>% del total</p>";
	pintarAyuda(texto);
}
function AparecerFin(){
	//Fin.style.display='block';
	//nota=(num_aciertos*10/lenArrayRespuestas)-(num_fallos/10);
  //alert("num_aciertos " + num_aciertos);
 nota=(num_aciertos*10/lenArrayRespuestas)-(num_intentos-lenArrayRespuestas)*10/lenArrayRespuestas;
//var valorAcierto
//nota=(num_aciertos*(lenArrayRespuestas/10))-(num_fallos*(lenArrayRespuestas/10));
//alert(nota);
	nota=nota.toFixed(2);
	if (nota<0) {
		nota=0;
	} else if (nota>10) {
    nota=10;
	}
	msg="";
	if (nota>=5) {
		if (nota>=9) {
			if (nota==10) {
				msg="<p align='center'>Muy Muy Muuy bien CAMPEÓN, TIENES <br> LA NOTA MÁXIMA <br><br> ¡¡ SOBRESALIENTE !!<br>";
			} else {
				msg="<p>Muy Muy Muuy bien CAMPEÓN, tienes un<br> SOBRESALIENTE !<br>";
			}
		} else if (nota>=7 && nota<9) {
			msg="<p>Muy bien CAMPEÓN, tienes un NOTABLE !<br>";
		} else {
			msg="<p>Muy bien CAMPEÓN, tienes un BIEN !<br>";
		}
	} else {
		msg="<p>UPSS, tienes que repasar un poquito esta lección !<br>";
	}
	var texto="<h6>¡¡ FIN !!</h6> " + msg +
	"<p>Has sacado un <label id='notafinal'>" + nota + "</label><p>";
	pintarAyuda(texto);
	return;
}
function DesaparecerAyuda(){
	//ayuda.style.display='none';
	return;
}
function DesaparecerOtra(){
	//Otra.style.display='none';
	return;
}
function DesaparecerBien(){
	//Bien.style.display='none';
	return;
}

function DesaparecerFin(){
	//Fin.style.display='none';
	return;
}
/* ======================================================================
funciones comprobar
=========================================================================*/ 
var valor_old="";
function comprobar_nueva(fila) {
	nombreCampo = "txt_palabra" + fila;
	nombreImagen = "txt_img" + fila;
	objCampo = document.getElementById(nombreCampo);
	objImagen = document.getElementById(nombreImagen);
	nombreCampoSiguiente = "txt_palabra" + parseInt(fila+1);
	objCampoSiguiente = document.getElementById(nombreCampoSiguiente);
	pregunta = arrayRespuestas[fila];
	valor =  objCampo.value;
	//si hay onchange
	if (valor!=""){
		valor_old=valor;
		var respuesta_correcta = comprobar(pregunta, valor, objCampo, objCampoSiguiente, objImagen);
		return respuesta_correcta;
	}
}
var num_intentos =0;
var num_fallos =0;
var num_aciertos =0;
function incrementarIntentos(){
var objContador = document.getElementById("intentos");
var num = parseInt(objContador.innerHTML);
num++;
objContador.innerHTML = num;
num_intentos = num;
var objContador ="";
}
function incrementarFallos() {
var objContador= document.getElementById("fallos");
var num = parseInt(objContador.innerHTML);
num++;
objContador.innerHTML = num;
num_fallos = num;
}
function incrementarAciertos() {
var objContador = document.getElementById("aciertos");
var num = parseInt(objContador.innerHTML);
if (num<lenArrayRespuestas) {
num++;
objContador.innerHTML = num;
num_aciertos =num;
}
}
/* ======================================================================
comprobar
=========================================================================*/
function comprobar(pregunta, respuesta, obj, objSiguiente,objImagen) {
	rdo=false;
	var pregunta = pregunta.toUpperCase();
	var respuesta = respuesta.toUpperCase();
	//alert("comprobando " + pregunta + ":" + pregunta.length + " contra " + respuesta + ":" + respuesta.length);
	if (pregunta.lastIndexOf("'")!=-1) {
		pregunta = respuesta.replace("'","\'");
	}
	incrementarIntentos();
	if (pregunta==respuesta) {
		cuenta++;
		incrementarAciertos();
		obj.className="classAcierto";
		AparecerBien();
		//porc=num_aciertos*100/lenArrayRespuestas;
		//porcentaje.innerHTML = porc.toFixed(2);
		objImagen.src = '../../../elabueloeduca_img/ok.gif';
		objImagen.alt = 'Respuesta correcta!!!';
		n=0;
		if (objSiguiente!=null) {
			objSiguiente.focus();
		}
		DesaparecerAyuda();
		DesaparecerOtra();
		rdo=true;
	} else {
		objImagen.src = '../../../elabueloeduca_img/error.png';
		objImagen.alt = 'Pulsa para ver la respuesta correcta';
		//if (n == 0) { contamos los intentos...
	  obj.className="classFallo";
		incrementarFallos();
		cuenta++;
		DesaparecerAyuda();
		//AparecerOtra();
		AparecerAyuda();
		rdo=false;
	}
	//==========================
	//Si se han contestado todas calculamos la nota
	//========================
	if (finalizado()) {
		AparecerFin();
		//alert("len= "+lenArrayRespuestas+" acie= "+num_aciertos);
		DesaparecerBien();
		DesaparecerAyuda();
		DesaparecerOtra();
	}
	return rdo;
}
function resolver(nomObj,pregunta) {
	obj = document.getElementById(nomObj);
	if (obj!=null) {
		incrementarIntentos();
	  incrementarAciertos();
		obj.value = pregunta;
		obj.className="classAcierto";
		objImagen.src = '../../../elabueloeduca_img/ok.gif';
		objImagen.alt = 'Respuesta correcta!!!';
		DesaparecerAyuda();
	}
}
function comprobar_todas(fila) {
	DesaparecerBien();
	DesaparecerAyuda();
	DesaparecerOtra();
	DesaparecerFin();
	for (i=0;i<lenArrayPreguntas;i++) {
		nombreCampo = "txt_palabra" + i;
		objCampo = document.getElementById(nombreCampo);
		pregunta = arrayRespuestas[i];
		valor =  objCampo.value;
		//alert(pregunta + " contra " + objCampo.value );
		compro(pregunta, valor, objCampo);

		nombreImagen = "txt_img" + i;
		objImagen = document.getElementById(nombreImagen);
		objCampo.className="classAcierto";
		objImagen.src = '../../../elabueloeduca_img/ok.gif';
		objImagen.alt = 'Respuesta correcta!!!';
	}
	AparecerFin()
}

/* para comprobar_todas ====================*/

function compro(pregunta, respuesta, obj) {
	var pregunta = pregunta.toUpperCase();
	var respuesta = respuesta.toUpperCase();
	//alert("comprobando " + pregunta + ":" + pregunta.length + " contra " + respuesta + ":" + respuesta.length);
	//incrementarIntentos();
	if (pregunta==respuesta) {
		incrementarAciertos();
		obj.className="correcto";
	}	else {
		obj.className="error";
		obj.value=pregunta
		var num_fallos = parseInt(fallos.innerHTML);
		num_fallos++;
		fallos.innerHTML = num_fallos;
	}
}
function dameLongitudMaxima(objArray) {
	len = objArray.length;
	for (i=0;i<len;i++) {
		lenPalabra = objArray[i].length;
		if (longMaximaPalabra<=lenPalabra) {
			longMaximaPalabra=lenPalabra;
		}
	}
	longMaximaPalabra=longMaximaPalabra+8;
}
/* ======================================================================
funciones pintar
======================================================================*/
function pintarPreguntas(arrayPreguntas) {
	var strFilas="";
	//rowspan=lenArrayPreguntas+1;
	rowspan=lenArrayPreguntas*2;
	//strFilas+="<tr><td colspan='3'></td><td rowspan=" + rowspan + "><div id='panelAyuda'></div><img id='imgDuda' src='../../../elabueloeduca_img/duda.gif'/ style='display:none'/></td></tr>";
	str="<tr><td colspan='2' align='right' onclick='javascript:ocultarAR()' style='cursor:pointer'><h6>Cerrar</h6></td>";
	for (i=0;i<lenArrayPreguntas;i++) {
		pregunta = arrayPreguntas[i];
		respuesta = arrayRespuestas[i];

		nombreCampo = "txt_palabra" + i;
		nombreImagen = "txt_img" + i;
		//strFilas+="  <tr ><td><label id='lbl_palabra1' onMouseOver=\"javascript:verMapa('" + pregunta + "')\"  onMouseOut=\"javascript:quitarMapa()\">" + pregunta + "</label></td>" +
		strFilas+="<tr><td class='nr'><label id='lbl_palabra1' onClick=\"javascript:verMapa('" + pregunta + "','" + nombreCampo + "')\">" + pregunta + "&nbsp;</label></td>" +
		"<td class='nr'><img src='../../../elabueloeduca_img/validar.gif' alt='Pulsa aquí para comprobar tu respuesta'><input type='text' id='" + nombreCampo + "' value='' onchange='javascript:return comprobar_nueva(" + i + ")' size='" + longMaximaPalabra +  "' class='classCaja' onfocus=\"javascript:comprobarFoco('" + nombreCampo + "')\">&nbsp;<img id='" + nombreImagen + "' src='../../../elabueloeduca_img/nada.gif' onclick=\"javascript:resolver('" + nombreCampo + "','" + respuesta + "')\"/></td>" +
		"</tr>";
		str+="<tr><td class='nr'><b>" +arrayPreguntas[i]+"</b></td><td class='nr'>" +arrayRespuestas[i]+"</td>";
	}
	ayudaRespuestas="<table><colgroup><col class='bold'></col><col></col></colgroup>"+str+"</table>";

	strFilas+="<tr><td colspan='2'>&nbsp;</td></tr>";
	strFilas+="<tr><td><img src='../../../elabueloeduca_img/pdf.jpg' alt='Generar documento pdf para impresión. Es posible que tengas que mantener la tecla Ctr pulsada para permitir que se abra otra ventana.' onclick='javascript:toPDF()' style='cursor:pointer'></td>";
	strFilas+="<td><a href='javascript:toPDF()' class='ini pdf'>Pulsa aquí si quieres generar un documento<br>para imprimir el ejercicio.</a></td></tr>";
	
	var strDocumento=pintarPanelAciertos();
	strDocumento+="<div id='divRespuestas' style='position:absolute;visibility:hidden;z-index:90'></div>";
	strDocumento+="<div id='tablaTotal'><div id='colIzq'>";
	//strDocumento+="<table id='tablaPreguntas' border=1 cellspacing='2' cellpadding='0' class='classFondo center' width='400px'>";
	strDocumento+="<table id='tablaPreguntas' border=0 cellspacing='2' cellpadding='0' class='classFondo center' align='center'>";
	strDocumento+=strFilas;
	strDocumento+="</table></div>";
//Sacamos el muñeco de la tabla
	strDocumento+="<div id='colDcha'><div id='panelAyuda'></div><img id='imgDuda' src='../../../elabueloeduca_img/duda.gif'/ style='display:none'/></div></div>";	
	
	var obj = document.getElementById("panelMostrar");
	if (obj!=null) {
		obj.style.display='block';
		obj.innerHTML=strDocumento;
	} else {
		alert("No se ha encontrado el objeto panelMostrar");
	}
	obj = document.getElementById("divPubliV");
	if (obj!=null) {
		obj.innerHTML='';
	}
	obj = document.getElementById("divPubliH");
	if (obj!=null) {
		obj.innerHTML='';
	}
	obj = document.getElementById("txt_palabra0");
	if (obj!=null) {
		obj.focus();
	}
	//return strFilas;
}
function cargarArrays(strPreguntas,strRespuestas) {
	arrayPreguntas = strPreguntas.split("|");
	lenArrayPreguntas = arrayPreguntas.length;
	arrayRespuestas = strRespuestas.split("|");
	lenArrayRespuestas = arrayRespuestas.length;

	//==================================
	//Obtenemos el valor de la longitud maxima de la palabra
	//que modificará la variable global 'longMaximaPalabra'
	dameLongitudMaxima(arrayRespuestas);
}
function iniciar(strPreguntas,strRespuestas,strTituloPagina){
	cargarArrays(strPreguntas,strRespuestas) ;
	pintarPreguntas(arrayPreguntas);
	cargarAyudas();
	iniciaContadores();
	var tituloPagina = document.getElementById("tituloPagina");
	if (tituloPagina!=null) {
		tituloPagina.innerHTML=strTituloPagina;
	}
	var t = 0;
	var caja = document.getElementById("txt_palabra"+t);
	if (caja !=null) {
		caja.focus();
	} else {
		alert("no funciona  " + pregunta + respuesta );
	}
}
function iniciaContadores() {
longMaximaPalabra = 0;
n=0; //nº intentos;
cuenta=0;
porc=0;
nota=0;
document.getElementById("intentos").innerHTML=0;
document.getElementById("aciertos").innerHTML=0;
document.getElementById("fallos").innerHTML=0;
num_fallos=0;
num_aciertos=0;
num_intentos =0;
}
function cargarAyudas() {

}
function cambiarFondo(clase) {
	/**obj = window.parent.frames['principal'].document.getElementById("tablaPreguntas");
	if (obj!=null) obj.className = clase;
	window.document.body.className = clase;
	window.parent.frames['principal'].document.body.className=clase;*/
	//document.className=clase;
}
/*============
mostrar ejercicios
========================================================================= */
function mostrarEjercicioIngles(opcion) {
	if (!juegoCompletado()) {
		if (!eval(confirm(strMensajeAbandonar))) {
			return;
		}
	}
	strTituloPagina="";
	var textoAyuda="";
	switch (opcion) {

	case 'W1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés los siguientes números?<br>How would you write in English the following numbers?";
		strPreguntas = "7|15|40|9|8|12|13|30|5|14|11|16|90|4|50";
		strRespuestas = "Seven|Fifteen|Forty|Nine|Eight|Twelve|Thirteen|Thirty|Five|Fourteen|Eleven|Sixteen|Ninety|Four|Fifty";
		break;		
	case 'W2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés los siguientes números?<br>How would you write in English the following numbers?";
		strPreguntas = "18|80|800|500|5.000|400|4.000.000|4.000|19|900|1|100|1.000.000|1.000|17";
		strRespuestas = "Eighteen|Eighty|Eight hundred|Five hundred|Five thousand|Four hundred|Four million|Four thousand|Nineteen|Nine hundred|One|One hundred|One million|One thousand|Seventeen";
		break;
	case 'W3':
		strTituloPagina = "(3) ¿Cómo escribirías en Inglés los siguientes números?<br>How would you write in English the following numbers?";
		strPreguntas = "70|700|6|600|60|10|3|300|3.000.000|3.000|20|2|200|2.000.000|2.000";
		strRespuestas = "Seventy|Seven hundred|Six|Six hundred|Sixty|Ten|Three|Three hundred|Three million|Three thousand|Twenty|Two|Two hundred|Two million|Two thousand";
		break;		
	case 'W31':
		strTituloPagina = "(4) ¿Cómo escribirías en Inglés los siguientes números?<br>How would you write in English the following numbers?";
		strPreguntas = "608|224|407|443|309|1.207|7.432|3.564|6.006|101|789|912|532|222|579|976";
		strRespuestas = "six hundred and eight|two hundred and twenty four|four hundred and seven|four hundred and forty three|three hundred and nine|one thousand two hundred and seven|seven thousand four hundred and thirty two|three thousand five hundred and sixty four|six thousand and six|one hundred and one|seven hundred and eighty nine|nine hundred and twelve|five hundred and thirty two|two hundred and twenty two|five hundred and seventy nine|nine hundred and seventy six";
		break;
	case 'W4':
		strTituloPagina = "(5) ¿Cómo escribirías con cifras los siguientes números?<br>How would you write with digits the following numbers?";
		strRespuestas = "7|15|40|9|8|12|13|30|5|14|11|16|90|4|50";
		strPreguntas = "Seven|Fifteen|Forty|Nine|Eight|Twelve|Thirteen|Thirty|Five|Fourteen|Eleven|Sixteen|Ninety|Four|Fifty";
		break;		
	case 'W5':
		strTituloPagina = "(6) ¿Cómo escribirías con cifras los siguientes números?<br>How would you write with digits the following numbers?";
		strRespuestas = "18|80|800|500|5.000|400|4.000.000|4.000|19|900|1|100|1.000.000|1.000|17";
		strPreguntas = "Eighteen|Eighty|Eight hundred|Five hundred|Five thousand|Four hundred|Four million|Four thousand|Nineteen|Nine hundred|One|One hundred|One million|One thousand|Seventeen";
		break;
	case 'W6':
		strTituloPagina = "(7) ¿Cómo escribirías con cifras los siguientes números?<br>How would you write with digits the following numbers?";
		strRespuestas = "70|700|6|600|60|10|3|300|3.000.000|3.000|20|2|200|2.000.000|2.000";
		strPreguntas = "Seventy|Seven hundred|Six|Six hundred|Sixty|Ten|Three|Three hundred|Three million|Three thousand|Twenty|Two|Two hundred|Two million|Two thousand";
		break;	
	case 'Ic1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés los siguientes colores?<br>How would you write in English the following colours?";
		strPreguntas = "Negro|Azul|Marrón|Fucsia|Gris|Verde|Granate|Naranja|Rosa|Morado|Rojo|Plata|Violeta|Blanco|Amarillo";
		strRespuestas = "Black|Blue|Brown|Fuchsia|Gray|Green|Maroon|Orange|Pink|Purple|Red|Silver|Violet|White|Yellow";
		break;
	case 'Ic2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés los siguientes colores?<br>How would you write in English the following colours?";
		strPreguntas = "Oscuro|Claro|Pálido|Brillante|Dorado|Celeste|Turquesa|Verde oscuro|Gris claro|Verde azulado|Lila|Carmesí|Azul marino|Castaño";
		strRespuestas = "Dark|Light|Pale|Shiny|Golden|Sky blue|Turquoise|Dark green|Light gray|Teal|Mauve|Crimson|Navy blue|Chestnut";
		break;
	case 'Ic3':
		strTituloPagina = "(3) ¿Cómo escribirías en Español los siguientes colores?<br>How would you write in Spanish the following colours?";
		strRespuestas = "Negro|Azul|Marrón|Fucsia|Gris|Verde|Granate|Naranja|Rosa|Morado|Rojo|Plata|Violeta|Blanco|Amarillo";
		strPreguntas = "Black|Blue|Brown|Fuchsia|Gray|Green|Maroon|Orange|Pink|Purple|Red|Silver|Violet|White|Yellow";
		break;
	case 'Ic4':
		strTituloPagina = "(4) ¿Cómo escribirías en Español los siguientes colores?<br>How would you write in Spanish the following colours?";
		strRespuestas = "Oscuro|Claro|Pálido|Brillante|Dorado|Celeste|Turquesa|Verde oscuro|Gris claro|Verde azulado|Lila|Carmesí|Azul marino|Castaño";
		strPreguntas = "Dark|Light|Pale|Shiny|Golden|Sky blue|Turquoise|Dark green|Light gray|Teal|Mauve|Crimson|Navy blue|Chestnut";
		break;
	case 'Ib1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés las siguientes partes del cuerpo?<br>How would you write in English the following parts of the body?";
		strPreguntas = "Tobillo|Brazo|Ojos|Cara|Dedos|Mano|Cabeza|Pierna|Boca|Frente|Nariz|Cabello|Cuello|Dedos del pie|Rodilla|Codo";
		strRespuestas = "Ankle|Arm|Eyes|Face|Fingers|Hand|Head|Leg|Mouth|Forehead|Nose|Hair|Neck|Toes|Knee|Elbow";
		break;
	case 'Ib2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés las siguientes partes del cuerpo?<br>How would you write in English the following parts of the body?";
		strPreguntas = "Puño|Labios|Uñas|Hombro|Cintura|Muñeca|Lengua|Pies|Espalda|Cejas|Pestañas|Párpados|Pecho|Mentón|Mejillas|Diente";
		strRespuestas = "Fist|Lips|Nails|Shoulder|Waist|Wris|Tongue|Feet|Back|Eyebrows|Eyelashes|Eyelids|Chest|Chin|Cheeks|Tooth";
		break;
	case 'Ib3':
		strTituloPagina = "(3) ¿Cómo escribirías en Inglés las siguientes partes del cuerpo?<br>How would you write in English the following parts of the body?";
		strPreguntas = "Sangre|Huesos|Riñones|Hígado|Pulmones|Costilla|Piel|Tronco|Cerebro|Garganta|Corazón|Caderas|Esqueleto|Cráneo|Tórax|Vena";
		strRespuestas = "Blood|Bones|kidneys|Liver|Lungs|Rib|Skin|Trunk|Brain|Throat|Heart|Hips|Skeleton|Skull|Thorax|Vein";
		break;
	case 'Ib4':
		strTituloPagina = "(4) ¿Cómo escribirías en Español las siguientes partes del cuerpo?<br>How would you write in Spanish the following parts of the body?";
		strRespuestas = "Tobillo|Brazo|Espalda|Sangre|Huesos|Mejillas|Pecho|Mentón|Orejas|Codo|Cejas|Párpados|Ojos|Cara|Pies|Dedos";
		strPreguntas = "Ankle|Arm|Back|Blood|Bones|Cheeks|Chest|Chin|Ears|Elbow|Eyebrows|Eyelashes|Eyes|Face|Feet|Fingers";
		break;
	case 'Ib5':
		strTituloPagina = "(5) ¿Cómo escribirías en Español las siguientes partes del cuerpo?<br>How would you write in Spanish the following parts of the body?";
		strRespuestas = "Puño|Pie|Frente|Cabello|Mano|Cabeza|Corazón|Caderas|Riñones|Rodilla|Pierna|Labios|Pulmones|Boca|Uñas|Nuca";
		strPreguntas = "Fist|Foot|Forehead|Hair|Hand|Head|Heart|Hips|kidneys|Knee|Leg|Lips|Lungs|Mouth|Nails|Nape";
		break;
	case 'Ib6':
		strTituloPagina = "(6) ¿Cómo escribirías en Español las siguientes partes del cuerpo?<br>How would you write in Spanish the following parts of the body?";
		strRespuestas = "Cuello|Costilla|Hombro|Piel|Estómago|Dientes|Tórax|Garganta|Dedos del pie|Lengua|Diente|Tronco|Cintura|Muñeca|Cerebro|Pestañas";
		strPreguntas = "Neck|Rib|Shoulder|Skin|Stomach|Teeth|Thorax|Throat|Toes|Tongue|Tooth|Trunk|Waist|Wrist|Brain|Eyelids";
		break;
	case 'Im1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Abril|Agosto|Año|Día|Diciembre|Domingo|Enero|Febrero|Hora|Invierno|Jueves|Julio|Junio|Lunes|Mañana|Martes";
		strRespuestas = "April|August|Year|Day|December|Sunday|January|February|Hour|Winter|Thursday|July|June|Monday|Morning|Tuesday";
		break;
	case 'Im2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Marzo|Mayo|Mes|Miércoles|Noche|Noviembre|Octubre|Otoño|Primavera|Sábado|Semana|Septiembre|Siglo|Tarde|Verano|Viernes";
		strRespuestas = "March|May|Month|Wednesday|Night|November|October|Autumn|Spring|Saturday|Week|September|Century|Afternoon|Summer|Friday";
		break;
	case 'Im3':
		strTituloPagina = "(3) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Abril|Agosto|Año|Día|Diciembre|Domingo|Enero|Febrero|Hora|Invierno|Jueves|Julio|Junio|Lunes|Mañana|Martes";
		strPreguntas = "April|August|Year|Day|December|Sunday|January|February|Hour|Winter|Thursday|July|June|Monday|Morning|Tuesday";
		break;
	case 'Im4':
		strTituloPagina = "(4) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Marzo|Mayo|Mes|Miércoles|Noche|Noviembre|Octubre|Otoño|Primavera|Sábado|Semana|Septiembre|Siglo|Tarde|Verano|Viernes";
		strPreguntas = "March|May|Month|Wednesday|Night|November|October|Autumn|Spring|Saturday|Week|September|Century|Afternoon|Summer|Friday";
		break;
	case 'If1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Abuelos|Esposa|Esposo|Hermana|Hermano|Hija|Hijo|Hijos|Madre|Nietos|Padre|Primo|Sobrina|Sobrino|Tía|Tío";
		strRespuestas = "Grandparents|Wife|Husband|Sister|Brother|Daughter|Son|Children|Mother|Grandchildren|Father|Cousin|Niece|Nephew|Aunt|Uncle";
		break;
	case 'If2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Abuela|Abuelo|Nieta|Nieto|Padres|Mamá|Papá|Cuñado|Cuñada|Suegra|Suegro|Ahijada|Ahijado|Hijastra|Hijastro|Mascota";
		strRespuestas = "Grandmother|Grandfather|Granddaughter|Grandson|Parents|Mom|Dad|Brother in law|Sister in law|Mother in law|Father in law|Goddaughter|Godson|Stepdaughter|Stepson|Pet";
		break;
	case 'If3':
		strTituloPagina = "(3) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Abuelos|Esposa|Esposo|Hermana|Hermano|Hija|Hijo|Hijos|Madre|Nietos|Padre|Primo|Sobrina|Sobrino|Tía|Tío";
		strPreguntas = "Grandparents|Wife|Husband|Sister|Brother|Daughter|Son|Children|Mother|Grandchildren|Father|Cousin|Niece|Nephew|Aunt|Uncle";
		break;
	case 'If4':
		strTituloPagina = "(4) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Abuela|Abuelo|Nieta|Nieto|Padres|Mamá|Papá|Cuñado|Cuñada|Suegra|Suegro|Ahijada|Ahijado|Hijastra|Hijastro|Mascota";
		strPreguntas = "Grandmother|Grandfather|Granddaughter|Grandson|Parents|Mom|Dad|Brother in law|Sister in law|Mother in law|Father in law|Goddaughter|Godson|Stepdaughter|Stepson|Pet";
		break;
	case 'Ih1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Baño|Dormitorio|Puerta|Timbre|Piso|Jardín|Llave|Cocina|Habitación|Pared|Ventana|Comedor|Vestíbulo|Salón|Piscina|Pórtico";
		strRespuestas = "Bathroom|Bedroom|Door|Doorbell|Floor|Garden|Key|Kitchen|Room|Wall|Window|Dining room|Hall|Living room|Pool|Porch";
		break;
	case 'Ih2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Desván|Balcón|Terraza|Escaleras|Parte de arriba|Parte de abajo|Escalones|Felpudo|Tejado|Buzón|Cerradura|Pasillo|Picaporte|Planta baja|Sótano|Césped";
		strRespuestas = "Attic|Balcony|Terrace|Stairs|Upstairs|Downstairs|Steps|Doormat|Roof|Mailbox|Lock|Corridor|Door handle|Ground floor|Basement|Grass";
		break;
	case 'Ih3':
		strTituloPagina = "(3) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Botella|Alfombra|Caja|Cama|Carta|Cortina|Cuero|Flor|Jabón|Lavar(se)|Luz|Mesa|Ordenador|Portátil|Seda|Silla";
		strRespuestas = "Bottle|Carpet|Box|Bed|Letter|Curtain|Leather|Flower|Soap|Wash|Light|Table|Computer|Laptop|Silk|Chair";
		break;
	case 'Ih4':
		strTituloPagina = "(4) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Baño|Dormitorio|Puerta|Timbre|Piso|Jardín|Llave|Cocina|Habitación|Pared|Ventana|Comedor|Vestíbulo|Salón|Piscina|Pórtico";
		strPreguntas = "Bathroom|Bedroom|Door|Doorbell|Floor|Garden|Key|Kitchen|Room|Wall|Window|Dining room|Hall|Living room|Pool|Porch";
		break;
	case 'Ih5':
		strTituloPagina = "(5) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Desván|Balcón|Terraza|Escaleras|Parte de arriba|Parte de abajo|Escalones|Felpudo|Tejado|Buzón|Cerradura|Pasillo|Picaporte|Planta baja|Sótano|Césped";
		strPreguntas = "Attic|Balcony|Terrace|Stairs|Upstairs|Downstairs|Steps|Doormat|Roof|Mailbox|Lock|Corridor|Door handle|Ground floor|Basement|Grass";
		break;
	case 'Ih6':
		strTituloPagina = "(6) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Botella|Alfombra|Caja|Cama|Carta|Cortina|Cuero|Flor|Jabón|Lavar(se)|Luz|Mesa|Ordenador|Portátil|Seda|Silla";
		strPreguntas = "Bottle|Carpet|Box|Bed|Letter|Curtain|Leather|Flower|Soap|Wash|Light|Table|Computer|Laptop|Silk|Chair";
		break;
	case 'Ia1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Zorro|León|Vaca|Toro|Tiburón|Serpiente|Ratón|Rata|Jirafa|Aguila|Hurón|Hormiga|Hamster|Gorilla|Gato|Gallo";
		strRespuestas = "Fox|Lion|Cow|Bull|Shark|Snake|Mouse|Rat|Giraffe|Eagle|Ferret|Ant|Hamster|Gorilla|Cat|Cock";
		break;
	case 'Ia2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Pollito|Pez|Perro|Pavo|Pato|Pájaro|Oveja|Oso panda|Gallina|Foca|Erizo|Elefante|Delfín|Conejo|Cobaya|Ciervo";
		strRespuestas = "Chicken|Fish|Dog|Turkey|Duck|Bird|Sheep|Panda bear|Hen|Seal|Hedgehog|Elephant|Dolphin|Rabbit|Guinea pig|Deer";
		break;
	case 'Ia3':
		strTituloPagina = "(3) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Oso|Murciélago|Lobo|Mosca|Medusa|Mariquita|Mariposa|Loro|Cerdo|Cebra|Cangrejo|Cabra|Caballo|Burro|Araña|Ballena";
		strRespuestas = "Bear|Bat|Wolf|Fly|Jellyfish|Ladybird|Butterfly|Parrot|Pig|Zebra|Crab|Goat|Horse|Donkey|Spider|Whale";
		break;
	case 'Ia4':
		strTituloPagina = "(4) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Zorro|León|Vaca|Toro|Tiburón|Serpiente|Ratón|Rata|Jirafa|Águila|Hurón|Hormiga|Hamster|Gorila|Gato|Gallo";
		strPreguntas = "Fox|Lion|Cow|Bull|Shark|Snake|Mouse|Rat|Giraffe|Eagle|Ferret|Ant|Hamster|Gorilla|Cat|Cock";
		break;
	case 'Ia5':
		strTituloPagina = "(5) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Pollito|Pez|Perro|Pavo|Pato|Pájaro|Oveja|Oso panda|Gallina|Foca|Erizo|Elefante|Delfín|Conejo|Cobaya|Ciervo";
		strPreguntas = "Chicken|Fish|Dog|Turkey|Duck|Bird|Sheep|Panda bear|Hen|Seal|Hedgehog |Elephant|Dolphin|Rabbit|Guinea pig|Deer";
		break;
	case 'Ia6':
		strTituloPagina = "(6) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Oso|Murciélago|Lobo|Mosca|Medusa|Mariquita|Mariposa|Loro|Cerdo|Cebra|Cangrejo|Cabra|Caballo|Burro|Araña|Ballena";
		strPreguntas = "Bear|Bat|Wolf|Fly|Jellyfish|Ladybird|Butterfly|Parrot|Pig|Zebra|Crab|Goat|Horse|Donkey|Spider|Whale";
		break;
	case 'Is1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Alegría|Aprendizaje|Ayuda|Bondad|Compartir|Creencia|Dar-regalar|Descubrir|Duda|Esperanza|Gusto|Imaginar|Llorar|Maldad|Mente|Mirada";
		strRespuestas = "Joy|Learning|Help|Goodness|Share|Belief|Give|Discover|Doubt|Hope|Taste|Imagine|Cry|Evilness|Mind|Look";
		break;
	case 'Is2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Sonrisa|Sorpresa|Sueño|Susurrar|Tacto|Vista|Mirar|Observar|Oido|Olfato|Peligro|Pena|Perdonar|Reir|Sentimiento|Sentir";
		strRespuestas = "Smile|Surprise|Dream|Whisper|Touch|Sight|Look at|Watch|Ear|Smell|Danger|Sorrow|Forgive|Laugh|Feeling|Feel";
		break;
	case 'Is3':
		strTituloPagina = "(3) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Alegría|Aprendizaje|Ayuda|Bondad|Compartir|Creencia|Dar-regalar|Descubrir|Duda|Esperanza|Gusto|Imaginar|Llorar|Maldad|Mente|Mirada";
		strPreguntas = "Joy|Learning|Help|Goodness|Share|Belief|Give|Discover|Doubt|Hope|Taste|Imagine|Cry|Evilness|Mind|Look";
		break;
	case 'Is4':
		strTituloPagina = "(4) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Sonrisa|Sorpresa|Sueño|Susurrar|Tacto|Vista|Mirar|Observar|Oido|Olfato|Peligro|Pena|Perdonar|Reir|Sentimiento|Sentir";
		strPreguntas = "Smile|Surprise|Dream|Whisper|Touch|Sight|Look at|Watch|Ear|Smell|Danger|Sorrow|Forgive|Laugh|Feeling|Feel";
		break;
	case 'In1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Viento|Lago|Nublado|Lluvioso|Soleado|Niebla|Anticiclón|Borrasca|Árbol|Rama|Hoja|Colina|Montaña|Cabaña|Volcán|Agua";
		strRespuestas = "Wind|Lake|Cloudy|Rainy|Sunny|Fog|Anticyclone|Low pressure|Tree|Branch|Leaf|Hill|Mountain|Shed|Volcano|Water";
		break;
	case 'In2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Muñeco de nieve|Camino|Carretera|Cielo|Edificio|Fuego|Humo|Lluvia|Mar|Nieve|Olor|País|Aire|Puente|Rio|Tiempo atmosférico";
		strRespuestas = "Snowman|Way|Road|Sky|Building|Fire|Smoke|Rain|Sea|Snow|Smell|Country|Air|Bridge|River|Weather";
		break;
	case 'In3':
		strTituloPagina = "(3) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Viento|Lago|Nublado|Lluvioso|Soleado|Niebla|Anticiclón|Borrasca|Árbol|Rama|Hoja|Colina|Montaña|Cabaña|Volcán|Agua";
		strPreguntas = "Wind|Lake|Cloudy|Rainy|Sunny|Fog|Anticyclone|Low pressure|Tree|Branch|Leaf|Hill|Mountain|Shed|Volcano|Water";
		break;
	case 'In4':
		strTituloPagina = "(4) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Muñeco de nieve|Camino|Carretera|Cielo|Edificio|Fuego|Humo|Lluvia|Mar|Nieve|Olor|País|Aire|Puente|Rio|Tiempo atmosférico";
		strPreguntas = "Snowman|Way|Road|Sky|Building|Fire|Smoke|Rain|Sea|Snow|Smell|Country|Air|Bridge|River|Weather";
		break;
	case 'It1':
		strTituloPagina = "(1) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Aguacate|Albaricoque|Arándano|Cacahuetes|Cereza|Ciruela|Frambuesa|Grosella|Higo|Lima|Mandarina|Manzana|Melocotón|Naranja|Nectarina|Pera";
		strRespuestas = "Avocado|Apricot|Blueberry|Peanuts|Cherry|Plum|Raspberry|Redcurrant|Fig|Lime|Tangerine|Apple|Peach|Orange|Nectarine|Pear";
		break;
	case 'It2':
		strTituloPagina = "(2) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Dátiles|Arándano Agrio|Fresa|Granada|Mango|Melón|Membrillo|Níspero|Nueces|Papaya|Pasa|Piña|Castañas|Avellanas|Almendras|Anacardo";
		strRespuestas = "Dates|Cranberry|Strawberry|Pomegranate|Mango|Melon|Quince|Medlar|Walnuts|Pawpaw|Raisin|Pineapple|Chestnuts|Hazelnuts|Almonds|Cashew";
		break;
	case 'It3':
		strTituloPagina = "(3) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Plátano|Pomelo|Sandía|Uvas|Tomates|Berros|Brócoli|Coco|Espárragos|Espinaca|Limón|Seta|Zanahoria|Habas|Alcachofa|Berenjena";
		strRespuestas = "Banana|Grapefruit|Watermelon|Grapes|Tomatoes|Watercress|Broccoli|Coconut|Asparagus|Spinach|Lemon|Mushroom|Carrot|Beans|Artichoke|Eggplant";
		break;
	case 'It4':
		strTituloPagina = "(4) ¿Cómo escribirías en Inglés las siguientes palabras?<br>How would you write in English the following words?";
		strPreguntas = "Zarzamora|Sidra|Ajo|Rábanos|Remolacha|Pimiento|Patatas|Pepino|Nabo|Maíz|Lechuga|Col/Repollo|Coliflor|Cebollas|Calabaza|Apio";
		strRespuestas = "Blackberry|Cider|Garlic|Radishes|Beet|Pepper|Potatoes|Cucumber|Turnip|Corn|Lettuce|Cabbage|Cauliflower|Onions|Pumpkin|Celery";
		break;
	case 'It5':
		strTituloPagina = "(5) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Aguacate|Albaricoque|Arándano|Cacahuetes|Cereza|Ciruela|Frambuesa|Grosella|Higo|Lima|Mandarina|Manzana|Melocotón|Naranja|Nectarina|Pera";
		strPreguntas = "Avocado|Apricot|Blueberry|Peanuts|Cherry|Plum|Raspberry|Redcurrant|Fig|Lime|Tangerine|Apple|Peach|Orange|Nectarine|Pear";
		break;
	case 'It6':
		strTituloPagina = "(6) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Dátiles|Arándano Agrio|Fresa|Granada|Mango|Melón|Membrillo|Níspero|Nueces|Papaya|Pasa|Piña|Castañas|Avellanas|Almendras|Anacardo";
		strPreguntas = "Dates|Cranberry|Strawberry|Pomegranate|Mango|Melon|Quince|Medlar|Walnuts|Pawpaw|Raisin|Pineapple|Chestnuts|Hazelnuts|Almonds|Cashew";
		break;
	case 'It7':
		strTituloPagina = "(7) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Plátano|Pomelo|Sandía|Uvas|Tomates|Berros|Brócoli|Coco|Espárragos|Espinaca|Limón|Seta|Zanahoria|Habas|Alcachofa|Berenjena";
		strPreguntas = "Banana|Grapefruit|Watermelon|Grapes|Tomatoes|Watercress|Broccoli|Coconut|Asparagus|Spinach|Lemon|Mushroom|Carrot|Beans|Artichoke|Eggplant";
		break;
	case 'It8':
		strTituloPagina = "(8) ¿Cómo escribirías en Español las siguientes palabras?<br>How would you write in Spanish the following words?";
		strRespuestas = "Zarzamora|Sidra|Ajo|Rábanos|Remolacha|Pimiento|Patatas|Pepino|Nabo|Maíz|Lechuga|Col/Repollo|Coliflor|Cebollas|Calabaza|Apio";
		strPreguntas = "Blackberry|Cider|Garlic|Radishes|Beet|Pepper|Potatoes|Cucumber|Turnip|Corn|Lettuce|Cabbage|Cauliflower|Onions|Pumpkin|Celery";
		break;
	case 'Za1':
		strTituloPagina = "(1) Completa, sin contaer, con el verbo TO BE en presente afirmativa.";
		strPreguntas = "I ___ a boy|I ___ a girl|You ___ a boy|You ___ a girl|He ___ a boy|She ___ a girl|It ___ a car|It ___ a dog|We ___ boys|We ___ girls|You ___ boys|You ___ girls|They ___ boys|They ___ girls|She ___ at home|I ___ at home";
		strRespuestas = "I am a boy|I am a girl|You are a boy|You are a girl|He is a boy|She is a girl|It is a car|It is a dog|We are boys|We are girls|You are boys|You are girls|They are boys|They are girls|She is at home|I am at home";
		break;
	case 'Za2':
		strTituloPagina = "(2) Completa, sin contaer, con el verbo TO BE en presente  negativa.";
		strPreguntas = "I ___ a boy|I ___ a girl|You ___ a boy|You ___ a girl|He ___ a boy|She ___ a girl|It ___ a car|It ___ a dog|We ___ boys|We ___ girls|You ___ boys|You ___ girls|They ___ boys|They ___ girls|She ___ at home|I ___ at home";
		strRespuestas = "I am not a boy|I am not a girl|You are not a boy|You are not a girl|He is not a boy|She is not a girl|It is not a car|It is not a dog|We are not boys|We are not girls|You are not boys|You are not girls|They are not boys|They are not girls|She is not at home|I am not at home";
		break;
	case 'Za3':
		strTituloPagina = "(3) Completa, sin contaer, con el verbo TO BE en presente  interrogativa.";
		strPreguntas = "___ I a boy?|___ I a girl?|___ you a boy?|___ you a girl?|___ he a boy?|___ she a girl?|___ it a car?|___ it a dog?|___ we boys?|___ we girls?|___ you boys?|___ you girls?|___ they boys?|___ they girls?|___ she at home?|___ I at home?";
		strRespuestas =  "Am I a boy?|Am I a girl?|Are you a boy?|Are you a girl?|Is he a boy?|Is she a girl?|Is it a car?|Is it a dog?|Are we boys?|Are we girls?|Are you boys?|Are you girls?|Are they boys?|Are they girls?|Is she at home?|Am I at home?";
		break;
	case 'Za4':
		strTituloPagina = "(4) ¿Cómo escribirías en Inglés las siguientes frases?<br>How would you write in English the following phrases?";
		strPreguntas = "Él está en el colegio|Él es muy alto|Soy un chico|Soy una chica|Soy intelegente|Es un coche|Es un perro|Ella está en casa|Ella es muy guapa|Son chicas|Son ricos|Estamos cansados|Somos jóvenes|Sois chicos|Sois estudiantes|Son muy divertidos";
		strRespuestas =  "He is in the school|He is very tall|I am a boy|I am a girl|I am intelligent|It is a car|It is a dog|She is at home|She is very pretty|They are girls|They are rich|We are tired|We are young|You are boys|You are students|They are very funny";
		break;
	case 'Zb1':
		strTituloPagina = "(1) Completa, sin contaer, con el verbo TO HAVE en presente afirmativa.";
		strPreguntas = "I ___ a boat|I ___ a car|You ___ a pencil|You ___ a ball|He ___ many books|She ___ many toys|It ___ two wheels|It ___ three branches|We ___ two computers|We ___ a horse|You ___ a yacht|He ___ a plane|They ___ three cars|They ___ many books|She ___ a ring|He ___ a clock";
		strRespuestas = "I have a boat|I have a car|You have a pencil|You have a ball|He has many books|She has many toys|It has two wheels|It has three branches|We have two computers|We have a horse|You have a yacht|He has a plane|They have three cars|They have many books|She has a ring|He has a clock";
		break;
	case 'Zb2':
		strTituloPagina = "(2) Completa, sin contaer, con el verbo TO HAVE en presente  negativa.";
		strPreguntas = "I ___ a boat|I ___ a car|You ___ a pencil|You ___ a ball|He ___ many books|She ___ many toys|It ___ two wheels|It ___ three branches|We ___ two computers|We ___ a horse|You ___ a yacht|He ___ a plane|They ___ three cars|They ___ many books|She ___ a ring|He ___ a clock";
		strRespuestas = "I have not a boat|I have not a car|You have not a pencil|You have not a ball|He has not many books|She has not many toys|It has not two wheels|It has not three branches|We have not two computers|We have not a horse|You have not a yacht|He has not a plane|They have not three cars|They have not many books|She has not a ring|He has not a clock";
		break;
	case 'Zb3':
		strTituloPagina = "(3) Completa, sin contaer, con el verbo TO HAVE en presente  interrogativa.";
		strPreguntas = "___ I a boat?|___ I a car?|___ you a pencil?|___ you a ball?|___ he many books?|___ she many toys?|___ it two wheels?|___ it three branches?|___ we two computers?|___ we a horse?|___ you a yacht?|___ he a plane?|___ they three cars?|___ they many books?|___ she a ring?|___ he a clock?";
		strRespuestas =  "Have I a boat?|Have I a car?|Have you a pencil?|Have you a ball?|Has he many books?|Has she many toys?|Has it two wheels?|Has it three branches?|Have we two computers?|Have we a horse?|Have you a yacht?|Has he a plane?|Have they three cars?|Have they many books?|Has she a ring?|Has he a clock?";
		break;
	case 'Zb4':
		strTituloPagina = "(4) ¿Cómo escribirías en Inglés las siguientes frases?<br>How would you write in English the following phrases?";
		strPreguntas = "Tengo un barco|Tengo un coche|Tienes un lápiz|Tienes un balón|Él tiene muchos libros|Ella tiene muchos juguetes|La bici tiene ruedas|El árbol tiene  ramas|Tenemos ordenadores|Tenemos un caballo|Teneis un yate|Él tiene una avioneta|Tienen tres coches|Tienen muchos libros|Ella tiene una sortija|Él tiene un reloj";
		strRespuestas =  "I have a boat|I have a car|You have a pencil|You have a ball|He has many books|She has many toys|The bike has wheels|The tree has  branches|We have computers|We have a horse|You have a yacht|He has a small plane|They have three cars|They have many books|She has a ring|He has a clock";
		break;
	default:
		break;		
	}

	//Iniciar la aplicación en función de las preguntas y respuestas
	if (strTituloPagina!="") {
		var panel = document.getElementById("panelInfo");
		if (panel!=null) {
			panel.style.display = 'none';
		}
		
		desordenar();
		
		iniciar(strPreguntas,strRespuestas,strTituloPagina);
		document.getElementById("panelAyuda").style.display = 'block';
		var primeraLetra=opcion.charAt(0);
		switch (primeraLetra) {
			//case 'B','G','Y','H':
			case 'B':
			case 'G':
			case 'Y':

			case 'I':
				textoAyuda="Piensa la respuesta y escribe el nombre correcto.";
				juego="INGLES";
				break;
			case 'W':
				textoAyuda="Piensa la respuesta y escribe el nombre o el número correcto.";
				juego="INGLES";
				break;
			case 'Z':
				textoAyuda="Piensa la respuesta y escribe la frase correcta.";
				juego="INGLES";
				break;		

			default:
				textoAyuda="Piensa la respuesta y escribe los valores correctos.";
				break;
		}

		textoAyuda+="<br><br>Después pulsa la flechita para comprobar si has acertado." +
		"<br><br>¡¡ MUCHA SUERTE !!";
		pintarAyuda(textoAyuda);
	} else {
		document.getElementById("panelAyuda").style.display = 'none';
		document.getElementById("panelInfo").style.display = 'block';
		document.getElementById("panelMostrar").style.display = 'none';
	}
}
function pintarAyuda(texto) {
	if (juego=="AUTONOMIAS") {
		texto+="<br><br>Si no lo sabes puede ayudarte ver estos mapas:<br><br><label class='tEjemplo cursor' onclick=\"javascript:breveAyuda('comunidades_trans.png')\"> Mapa Comunidades </label>" +
				"<br><br><label class='tEjemplo cursor' onclick=\"javascript:breveAyuda('provincias_trans.png')\"> Mapa Provincias </label>";
	}
	texto="<div class='center'><img src='../../../elabueloeduca_img/ayuda.png'/ alt='Ayuda'></div>"+
	"<p>" + texto + "</p>";

	//obj = document.getElementById("textoComprobar");
	obj = document.getElementById("panelAyuda");
	if (obj!=null) {
		obj.style.display='block';
		obj.style.visibility='visible';
		obj.innerHTML=texto;
	}
	obj = document.getElementById("imgDuda");
	if (obj!=null) {
		obj.style.display='block';
		obj.style.visibility='visible';
	}
}
function finalizado() {
	var contAciertos=0;
	var contFallos=0;
	completado=true;
	for (i=0;i<lenArrayRespuestas;i++) {
		nombreCampo = "txt_palabra" + i;
		obj = document.getElementById(nombreCampo);
		if (obj!=null) {
			if (obj.value == arrayRespuestas[i]) {
				contAciertos++;
			} else {
				contFallos++;
			}
			if (obj.value=="") {
				completado=false;
			}
		}
	}
	if (completado) {
		return true;
	} else {
		return false;
	}
}
var focoActual="";

function juegoCompletado() {
completado=true;
for (i=0;i<lenArrayRespuestas;i++) {
	nombreCampo = "txt_palabra" + i;
	obj = document.getElementById(nombreCampo);
	if (obj!=null) {
		if (obj.value!="") {
			completado=false;
			break;
		}
	}
}
return completado;
}
function nosVamos(strUrl) {
	if (!juegoCompletado()) {
		if (eval(confirm(strMensajeAbandonar))) {
			window.location = strUrl;
		} else {
			//return false;
		}
	} else {
			window.location = strUrl;
	}
}
function pintarPanelAciertos() {
var tabla = "<div id='panelAciertos' class='columna'>" +
//"<table border='0' width='100%'><tr class='bold'><td rowspan='2'><img src='../../../elabueloeduca_img/enci.jpg'></td>" +
"<table border='0' cellspacing='5' cellpadding='5' width='100%' id='tablaAciertos'><tr class='bold'><td>&nbsp;</td><td>Intentos: <label id='intentos'>0</label></td><td>&nbsp;</td>" +
"<td class='classAci'>Aciertos: <label id='aciertos'>0</label></td><td>&nbsp;</td>" +
"<td class='classFa'>Fallos: <label id='fallos' >0</label></td></tr><tr><td colspan=10><b><div id='tituloPagina'></div></b></td></tr></table></div>";
return tabla;
}
var nuevoOrden ="";
var blnOpcRnd=true;
function num_random(precision) {
maximo = Math.pow(10,precision)-1;
rdo = parseInt((Math.random() * (maximo - 1) + 1).toPrecision(precision));
return rdo;
}
function existeEnArray(mArray,valor) {
	var rdo=false;
	valor=valor.toString();
	//salimos al encontrarlo
	len =mArray.length;
	for (var i=len;i>=0;i--) {
		if (mArray[i]==valor) {
			rdo=true;
			break;
		};
	}
	return rdo;
}
/* AJAX =====================================*/
var enProceso = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest
function getHTTPObject() {
  var xmlhttp;
  /*navegador = navigator.appName;
  if (navegador.lastIndexOf("Explorer")!=-1) {
  	navegador="IE";
	}=================*/
	try {
		if (window.XMLHttpRequest) {
			xmlhttp = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			//IE
			xmlhttp =new ActiveXObject("Microsoft.XMLHTTP");
		}
	}catch (e) {
		alert("ERROR AJAX " + e.description);
		xmlhttp = false;
	}
    return xmlhttp;
}
function handleHttpResponse() {
	//nuevoOrden = "";
  if (http.readyState == 4) {
		if (http.status == 200) {
		  rdo = http.responseText;
		  enProceso = false;
			window.status="";
			//return rdo;
			if (rdo!="") {
				nuevoOrden = rdo;
			} else {
				//alert("QUE PASO");
			}
		} else {
			msg="";
			if (http.status==12029) {
				msg="Se están experimentando errores en su conexión";
				estado.innerHTML="Error en la conexión";
			}
			alert("Error: " + http.status + " " + msg);
		}
  }
}
function enviar(numHasta) {
	url="http://elabueloeduca.calabriasoft.com/php/funciones.php?valor=" + numHasta
  if (!enProceso && http) {
		//http.open("GET", url, true); //asincrona
		try {
			//http.open("GET", url, false); //sincrona
			if (navegador.lastIndexOf("Explorer")!=-1) {
				http.open("GET", url, false);
			} else {
				http.open("GET", url, false); //asincrona parece q sÃ³lo asÃ­ la admite firefox
			}
		} catch (err) {
			alert("La consulta no se puede realizar en local");
			alert("ERR: " + err.description + http + " url: " +url);
		}
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); //iso-8859-1
		http.onreadystatechange = handleHttpResponse;
		enProceso = true;
		http.send(null);
	} else {
		//window.status  = "error";
		if (http.readyState == 4) {
			enProceso = false;
		}
		}
}
function desordenar() {
	_arrayPreguntas = strPreguntas.split("|");
	_arrayRespuestas = strRespuestas.split("|");
	_lenArrayPreguntas = _arrayPreguntas.length;
	_strPreguntas=strPreguntas;
	_strRespuestas=strRespuestas;
	strPreguntas="";
	strRespuestas="";
	//enviar(_lenArrayPreguntas);
	deso(_lenArrayPreguntas);
	//alert("nuevoOrden " + nuevoOrden);
	if (nuevoOrden!="") {
		//alert("nuevoOrden " +nuevoOrden);
		arrayOrden = nuevoOrden.split("|");
		lenOrden = arrayOrden.length;
		separador="";
		for (i=0;i<lenOrden;i++) {
			if (_arrayPreguntas[arrayOrden[i]]!=null) {
				//alert("El valor "+ arrayOrden[i] + " ha petaó chacho!! de " + _strPreguntas);
				strPreguntas+=separador+_arrayPreguntas[arrayOrden[i]];
				strRespuestas+=separador+_arrayRespuestas[arrayOrden[i]];
				separador="|";	
			}
		}
	} else {
		//Algún problema lo dejamos tal cual
		strPreguntas=_strPreguntas;
		strRespuestas=_strRespuestas;
	}
	//alert("strPreguntas " + strPreguntas);
}
function deso(maxValor) {
	lenarr = maxValor;
	var nuevoArray= new Array();
	var contador=0;
	var lenNuevo=nuevoArray.length;
	var cadenaNumeros=",";
	//while (lenNuevo<lenarr) {
	while (lenNuevo<=lenarr) {
		//num = parseInt((Math.random() * (lenarr - 1) + 1).toPrecision(2));
		num = parseInt((Math.random() * (lenarr)).toPrecision(2));
		buscar="," + num.toString() + ",";
		//if (!existeEnArray(nuevoArray,num)) {
		if (cadenaNumeros.lastIndexOf(buscar)==-1) {
			nuevoArray.push(num);
			lenNuevo=nuevoArray.length;
			cadenaNumeros+=num.toString() +",";
		}
		if (contador>300) {
			alert("Ha habido un problema al cargar el juego, por favor, recarga la página (Pulsa F5)!!")
			break;
		}
		contador++;
	}
	var cadena="";
	var separador="";
	for (i=0;i<lenNuevo;i++) {
		cadena+=separador+nuevoArray[i];
		separador="|";
	}
	//alert("En " + contador + " intentos deso " +cadena);
	nuevoOrden = cadena;	
}
function comprobarFoco(nobj){
	focoActual=nobj;
	//alert("focando: " + nobj);
}
//window.onfocus = function() {comprobarFoco()};
function devolverFoco() {
var obj = document.getElementById(focoActual);
if (obj!=null) {
obj.focus();
}
}
function toPDF() {
	if(strPreguntas.indexOf("&#8211;")!=-1){
		while(strPreguntas.indexOf("&#8211;")!=-1)
		//cambiamos -- por -
		{strPreguntas=strPreguntas.replace("&#8211;","&#45;");}
	}
	if(strPreguntas.indexOf(" + ")!=-1){
	while(strPreguntas.indexOf(" + ")!=-1)
		{strPreguntas=strPreguntas.replace("+"," &#43; ");}
	}
	if(strPreguntas.indexOf("  ")!=-1){
	while(strPreguntas.indexOf("  ")!=-1)
		{strPreguntas=strPreguntas.replace("  "," ");}
	}
	window.open("../../../generadorNPDF.php?html=" + escape(strPreguntas)+"&titulo="+escape(strTituloPagina)+"&juego="+juego,"","");
}
function ocultarAR() {
	obj=document.getElementById("divRespuestas");
	if (obj!=null) {
		obj.style.visibility='hidden';
	}
}
function posicionarDivRespuestas(obj) {
	if (obj!=null) {
		ancho_foto=obj.style.width;
		//alto_foto=obj.style.height;
		alto_foto=400;
		ancho_pantalla=screen.availWidth;
		alto_pantalla=screen.availHeight;
		//pos_left=parseInt(ancho_pantalla/2) - parseInt(ancho_foto/2);
		pos_top=parseInt(alto_pantalla/2) - parseInt(alto_foto/2) + (document.body.scrollTop/2);
		
		/* poner los px es necesario para firefox===========================*/
		//obj.style.left=pos_left+"px";
		obj.style.top=pos_top+"px";
	}
} 	     
function reproducir(opcion,palabra) {
//en local no va	
var directorio="../../../elabueloeduca_snd/";


var directorio="../../elabueloeduca_snd/";
var objBg="";
if (navegador == "Microsoft Internet Explorer") {
	objBg=document.getElementById("bg");
} else {
	objBg=document.getElementById("mbg");
}
	//palabra=palabra.toLowerCase();
 	var extension="";
	switch (opcion) {
	case 1:
		extension="mp3";
		break;
	case 2:
		extension="wma";
		break;
	case 3:
		extension="wav";
		break;		
	default:
		break;
	}	
	try {
		var sonido=directorio + palabra + "." + extension;
		objBg.src=sonido;
		objBg.autostart=true;
	} catch(exception) {
		alert(exception.toString());
	}
}                                                                                                                                                                                                                                                                                                                                                                                                                                                                           