<!--

function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
	// Firefox, Opera 8.0+, Safari
	xmlHttp=new XMLHttpRequest();
	}catch (e){
		// Internet Explorer
		try{
		  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function traerRespuesta(idmensaje){
	//llamar al objeto
	var ajax = GetXmlHttpObject();	

	// verificar
	if(ajax == null){
		alert("Ajax no soportado");
		return;
	}
	
	// determino la url
	var url = "traermensajerespuesta.php?id="+idmensaje;
	url += "&sid=" + Math.random();
	

	ajax.onreadystatechange=function(){
		if(ajax.readyState == 4){
			// que tiene que hacer
			document.getElementById("Respuesta").innerHTML = ajax.responseText;
		}	
	};
	
	// abro y envio datos
	ajax.open("GET", url, true);
	ajax.send(null);
}

function traerMensaje(idmensaje, sent){
	//llamar al objeto
	var ajax = GetXmlHttpObject();	

	// verificar
	if(ajax == null){
		alert("Ajax no soportado");
		return;
	}
	
	// determino la url
	var url = "traermensaje.php?id="+idmensaje+"&sent="+sent;
	url += "&sid=" + Math.random();
	
	document.getElementById("pmRecibido").innerHTML = "Cargando mensaje...";
	ajax.onreadystatechange=function(){
		if(ajax.readyState == 4){
			// que tiene que hacer
			document.getElementById("pmRecibido").style.visibility="visible";
			document.getElementById("Respuesta").innerHTML="";
			document.getElementById("pmRecibido").innerHTML = ajax.responseText;
		}	
	};
	
	// abro y envio datos
	ajax.open("GET", url, true);
	ajax.send(null);
}

function mostrarSolicitud(idsolicitud){
	//llamar al objeto
	var ajax = GetXmlHttpObject();	

	// verificar
	if(ajax == null){
		alert("Ajax no soportado");
		return;
	}
	
	// determino la url
	var url = "mostrarSolicitud.php?id="+idsolicitud;
	url += "&sid=" + Math.random();
	
	document.getElementById("solicitud").innerHTML = "Cargando solicitud...";
	ajax.onreadystatechange=function(){
		if(ajax.readyState == 4){
			// que tiene que hacer
			document.getElementById("solicitud").innerHTML = ajax.responseText;
		}	
	};
	
	// abro y envio datos
	ajax.open("GET", url, true);
	ajax.send(null);
}

function avatarPredeterminado(sel) {
	sel.style.background=sel.options[0].style.background;
}

function checkText(area) {
	if(navigator.appName=="Microsoft Internet Explorer") {
		area.cols=61;
	}
}
function cambiarFondo() {
	sel=document.getElementById('avatar');
	sel.style.background=sel.options[sel.selectedIndex].style.background;
}

function ampliar(selObj) {
if(selObj.options[selObj.selectedIndex].value!="alumno" && selObj.options[selObj.selectedIndex].value!="profesor" && selObj.options[selObj.selectedIndex].value!="otro" && selObj.options[selObj.selectedIndex].value!="otro") document.getElementById("amp").innerHTML="";
if(selObj.options[selObj.selectedIndex].value=="alumno" || selObj.options[selObj.selectedIndex].value=="capitan"){ var inner="<p class=\"Estilo1\">Casa: "+
      "<select name=\"casa\" id=\"casa\">"+
        "<option></option>"+
        "<option value=\"Gryffindor\">Gryffindor</option>"+
        "<option value=\"Hufflepuff\">Hufflepuff</option>"+
        "<option value=\"Ravenclaw\">Ravenclaw</option>"+
        "<option value=\"Slytherin\">Slytherin</option>";
	  if(selObj.id!="tipo") inner+="</select> *</p>";
	  else inner+="</select></p>";
   inner+=
    "<p class=\"Estilo1\">A&ntilde;o: "+
     " <select name=\"anio\" id=\"anio\">"+
	    "<option></option>"+
      "  <option value=\"1\">1ro</option>"+
        "<option value=\"2\">2do</option>"+
       " <option value=\"3\">3ro</option>"+
        "<option value=\"4\">4to</option>"+
       " <option value=\"5\">5to</option>"+
       " <option value=\"6\">6to</option>"+
     	" <option value=\"7\">7mo</option>";
		if(selObj.id!="tipo") inner+="</select> *</p>";
	 	else inner+="</select></p>";
		document.getElementById("amp").innerHTML=inner;
	}


if(selObj.options[selObj.selectedIndex].value=="prefecto") {
	
	var inner="<p class=\"Estilo1\">Casa: "+
      "<select name=\"casa\" id=\"casa\">"+
        "<option></option>"+
        "<option value=\"Gryffindor\">Gryffindor</option>"+
        "<option value=\"Hufflepuff\">Hufflepuff</option>"+
        "<option value=\"Ravenclaw\">Ravenclaw</option>"+
        "<option value=\"Slytherin\">Slytherin</option>"+
      "</select>";
	   if(selObj.id!="tipo") inner+=" *";
   inner+="</p>"+
    "<p class=\"Estilo1\">A&ntilde;o: "+
     " <select name=\"anio\" id=\"anio\">"+
	    "<option></option>"+
       " <option value=\"5\">5to</option>"+
       " <option value=\"6\">6to</option>"+
       " <option value=\"7\">7mo</option>"+
      "</select>";
	   if(selObj.id!="tipo") inner+=" *";
   inner+="</p>";
   document.getElementById("amp").innerHTML=inner;
}
	
if(selObj.options[selObj.selectedIndex].value=="premioanual") {
	var inner="<p class=\"Estilo1\">Casa: "+
      "<select name=\"casa\" id=\"casa\">"+
        "<option></option>"+
        "<option value=\"Gryffindor\">Gryffindor</option>"+
        "<option value=\"Hufflepuff\">Hufflepuff</option>"+
        "<option value=\"Ravenclaw\">Ravenclaw</option>"+
        "<option value=\"Slytherin\">Slytherin</option>"+
      "</select>";
	  if(selObj.id!="tipo") inner+=" *";
   inner+="</p>";
   document.getElementById("amp").innerHTML=inner;
	
}
if(selObj.options[selObj.selectedIndex].value=="profesor") {
	var inner="<p class=\"Estilo1\">Materia: <input type=\"textfield\" name=\"materia\" id=\"materia\" />";
	if(selObj.id!="tipo") inner+=" *";
   	inner+="</p>";
	 document.getElementById("amp").innerHTML=inner;
}

if(selObj.options[selObj.selectedIndex].value!="Muggle" && selObj.options[selObj.selectedIndex].value!="Mago" && selObj.options[selObj.selectedIndex].value!="Bruja" && selObj.options[selObj.selectedIndex].value!="Squib") {
	document.getElementById("ocupacion").disabled="disabled";
	document.getElementById("ocupacion").style.backgroundColor="#BBBBBB";
} else {
	document.getElementById("ocupacion").disabled=false;
	document.getElementById("ocupacion").style.backgroundColor="#FFFFFF";
}
if(selObj.options[selObj.selectedIndex].value=="Squib") {
	document.getElementById("varita").disabled="disabled";
	document.getElementById("varita").style.backgroundColor="#BBBBBB";
}

else if(selObj.options[selObj.selectedIndex].value=="Muggle" || selObj.options[selObj.selectedIndex].value=="Criatura Mágica") {
document.getElementById("varita").disabled="disabled";
document.getElementById("varita").style.backgroundColor="#BBBBBB";
document.getElementById("sangre").disabled="disabled";
document.getElementById("sangre").style.backgroundColor="#BBBBBB";

document.getElementById("fnac").disabled=false;
document.getElementById("fnac").style.backgroundColor="#FFFFFF";
document.getElementById("lnac").disabled=false;
document.getElementById("lnac").style.backgroundColor="#FFFFFF";
document.getElementById("lres").disabled=false;
document.getElementById("lres").style.backgroundColor="#FFFFFF";
document.getElementById("altura").disabled=false;
document.getElementById("altura").style.backgroundColor="#FFFFFF";
document.getElementById("ojos").disabled=false;
document.getElementById("ojos").style.backgroundColor="#FFFFFF";
document.getElementById("tez").disabled=false;
document.getElementById("tez").style.backgroundColor="#FFFFFF";
document.getElementById("pelo").disabled=false;
document.getElementById("pelo").style.backgroundColor="#FFFFFF";
document.getElementById("mascota").disabled=false;
document.getElementById("mascota").style.backgroundColor="#FFFFFF";
} else {
	if (selObj.options[selObj.selectedIndex].value=="Retrato Parlante"){
		document.getElementById("fnac").disabled="disabled";
		document.getElementById("fnac").style.backgroundColor="#BBBBBB";
		document.getElementById("lnac").disabled="disabled";
		document.getElementById("lnac").style.backgroundColor="#BBBBBB";
		document.getElementById("lres").disabled="disabled";
		document.getElementById("lres").style.backgroundColor="#BBBBBB";
		document.getElementById("altura").disabled="disabled";
		document.getElementById("altura").style.backgroundColor="#BBBBBB";
		document.getElementById("ojos").disabled="disabled";
		document.getElementById("ojos").style.backgroundColor="#BBBBBB";
		document.getElementById("tez").disabled="disabled";
		document.getElementById("tez").style.backgroundColor="#BBBBBB";
		document.getElementById("pelo").disabled="disabled";
		document.getElementById("pelo").style.backgroundColor="#BBBBBB";
		document.getElementById("varita").disabled="disabled";
		document.getElementById("varita").style.backgroundColor="#BBBBBB";
		document.getElementById("mascota").disabled="disabled";
		document.getElementById("mascota").style.backgroundColor="#BBBBBB";
		document.getElementById("sangre").disabled="disabled";
		document.getElementById("sangre").style.backgroundColor="#BBBBBB";
	}
	else {
	if (selObj.options[selObj.selectedIndex].value=="Mago" || selObj.options[selObj.selectedIndex].value=="Bruja" || selObj.options[selObj.selectedIndex].value=="Ministerio de Magia") {
		document.getElementById("fnac").disabled=false;
		document.getElementById("fnac").style.backgroundColor="#FFFFFF";
		document.getElementById("lnac").disabled=false;
		document.getElementById("lnac").style.backgroundColor="#FFFFFF";
		document.getElementById("lres").disabled=false;
		document.getElementById("lres").style.backgroundColor="#FFFFFF";
		document.getElementById("altura").disabled=false;
		document.getElementById("altura").style.backgroundColor="#FFFFFF";
		document.getElementById("ojos").disabled=false;
		document.getElementById("ojos").style.backgroundColor="#FFFFFF";
		document.getElementById("tez").disabled=false;
		document.getElementById("tez").style.backgroundColor="#FFFFFF";
		document.getElementById("pelo").disabled=false;
		document.getElementById("pelo").style.backgroundColor="#FFFFFF";
		document.getElementById("varita").disabled=false;
		document.getElementById("varita").style.backgroundColor="#FFFFFF";
		document.getElementById("mascota").disabled=false;
		document.getElementById("mascota").style.backgroundColor="#FFFFFF";
		document.getElementById("sangre").disabled=false;
		document.getElementById("sangre").style.backgroundColor="#FFFFFF";
	}
	else {
	document.getElementById("fnac").disabled=false;
	document.getElementById("fnac").style.backgroundColor="#FFFFFF";
	document.getElementById("lnac").disabled=false;
	document.getElementById("lnac").style.backgroundColor="#FFFFFF";
	document.getElementById("lres").disabled=false;
	document.getElementById("lres").style.backgroundColor="#FFFFFF";
	document.getElementById("altura").disabled=false;
	document.getElementById("altura").style.backgroundColor="#FFFFFF";
	document.getElementById("ojos").disabled=false;
	document.getElementById("ojos").style.backgroundColor="#FFFFFF";
	document.getElementById("tez").disabled=false;
	document.getElementById("tez").style.backgroundColor="#FFFFFF";
	document.getElementById("pelo").disabled=false;
	document.getElementById("pelo").style.backgroundColor="#FFFFFF";
	document.getElementById("varita").disabled=false;
	document.getElementById("varita").style.backgroundColor="#FFFFFF";
	document.getElementById("mascota").disabled=false;
	document.getElementById("mascota").style.backgroundColor="#FFFFFF";
	document.getElementById("sangre").disabled=false;
	document.getElementById("sangre").style.backgroundColor="#FFFFFF";
}
}
}


if(selObj.options[selObj.selectedIndex].value=="otro") {
	document.getElementById("amp").innerHTML="<p class=\"Estilo1\">Otro Tipo: <input type=\"textfield\" name=\"otrotipo\" id=\"otrotipo\" />";
	if(selObj.id!="tipo") document.getElementById("amp").innerHTML+="*";
   	document.getElementById("amp").innerHTML+="</p>";
}

}


function previsualizar () {
document.getElementById("creapers").action="previsualizar_pers.php";
document.getElementById("creapers").target="_blank";
document.getElementById("creapers").submit();
document.getElementById("creapers").action="creadorpers.php";
document.getElementById("creapers").target="_self";
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function ValidarAp() {
	var ok=true;
	if (document.getElementById("nombre").value=="") ok=false;	
	if (document.getElementById("casa").options[document.getElementById("casa").selectedIndex].value=="") ok=false;
	if (document.getElementById("anio").options[document.getElementById("anio").selectedIndex].value=="") ok=false;
	if (document.getElementById("apariencia").value=="") ok=false;
	if (document.getElementById("personalidad").value=="") ok=false;
	if (document.getElementById("historia").value=="") ok=false;
	if (document.getElementById("user").value=="") ok=false;
	if (document.getElementById("pass").value=="") ok=false;
	if (document.getElementById("mail").value=="") ok=false;
	if(!ok) alert("Todos los campos son obligatorios.\nRevisa que estén todos completos");
	else document.getElementById("formAp").submit();
}

function Validar(admin) {
var ok=true;

var dale=true;
if(document.getElementById("editando").value!="editando") {
	var tipo=document.getElementById("seltipo").options[document.getElementById("seltipo").selectedIndex].value;
	if(admin!="Admin" && admin!="Co-Admin") {
			if (document.getElementById("nombre").value=="") ok=false;
		if (document.getElementById("nombre").value!="" && !testnombre(document.getElementById("nombre").value)) {
			alert("Ya existe un personaje con el nombre '"+document.getElementById("nombre").value+"'.");
			ok=false;
		}
		if (tipo=="") ok=false;
		
		if (tipo=="alumno" || tipo=="prefecto" || tipo=="capitan") {
			if(document.getElementById("casa").value=="") ok=false;
			if(document.getElementById("anio").value=="") ok=false;
		}
		if (tipo=="premioanual" ) {
			if(document.getElementById("casa").value=="") ok=false;
		}
		
		if (tipo=="profesor") {
			if(document.getElementById("materia").value=="") ok=false;
		}
		if (tipo=="otro") {
			if(document.getElementById("otrotipo").value=="") ok=false;
		}
		if(tipo=="Muggle" || tipo=="Mago" || tipo=="Bruja" || tipo=="Squib") if (document.getElementById("ocupacion").value=="") ok=false;
		if (tipo!="Retrato Parlante"){
		
		if (document.getElementById("fnac").value=="") ok=false;
		if (document.getElementById("lnac").value=="") ok=false;
		if (document.getElementById("lres").value=="") ok=false;
		if (isNaN(document.getElementById("altura").value)) ok=false;
		if (document.getElementById("ojos").value=="") ok=false;
		if (document.getElementById("tez").value=="") ok=false;
		if (document.getElementById("pelo").value=="") ok=false;
		if(tipo!="Muggle" && tipo!="Criatura Mágica" && tipo!="Squib") if (document.getElementById("varita").value=="") ok=false;
		/*if (document.getElementById("mascota").value=="") ok=false;*/
		
		if (document.getElementById("sangre").options[document.getElementById("sangre").selectedIndex].value=="" && tipo!="Muggle" && tipo!="Criatura Mágica") ok=false;
		if (document.getElementById("apariencia").value=="") ok=false;
		if (document.getElementById("personalidad").value=="") ok=false;
		if (document.getElementById("gustos").value=="") ok=false;
		if (document.getElementById("familia").value=="") ok=false;
		if (document.getElementById("historia").value=="") ok=false;
		
		/*if (document.getElementById("extra").value=="") ok=false;*/
		}
		/*if (tipo!="Mago" && (tipo!="Muggle") && tipo!="Bruja" && tipo!="Ministerio de Magia") if(document.getElementById("antig").value=="") ok=false;*/
		}
		if(ok) document.getElementById("creapers").submit();
		else alert("Revisa que no te falte completar ningún campo \nobligatorio y que hayas ingresado valores coherentes");
}

else if(document.getElementById("editando").value=="editando") {
	/*if (tipo!="Mago" && (tipo!="Muggle") && tipo!="Bruja" && tipo!="Ministerio de Magia") {
			if(document.getElementById("antig").value=="") ok=false;
		}
		*/
	if(admin!="Admin" && admin!="Co-Admin") {
		
		
		if (document.getElementById("estado").value!="Rechazado" && document.getElementById("estado").value!="Borrador") {
			if (document.getElementById("selestado").options[document.getElementById("selestado").selectedIndex].value=="") ok=false;
			
			var tipo=document.getElementById("seltipo").value;
			
		} else {
			
			if (document.getElementById("nombre").value=="") ok=false;
			if (document.getElementById("nombre").value!="" && !testnombre(document.getElementById("nombre").value)) {
					alert("Ya existe un personaje con el nombre '"+document.getElementById("nombre").value+"'.");
					ok=false;
				}
			if (document.getElementById("sangre").options[document.getElementById("sangre").selectedIndex].value=="" && tipo!="Muggle" && tipo!="Criatura Mágica") ok=false;
			
			
			var tipo=document.getElementById("seltipo").options[document.getElementById("seltipo").selectedIndex].value;
		}
			if (tipo=="") ok=false;
			
			if (tipo=="alumno" || tipo=="prefecto" || tipo=="capitan") {
				if(document.getElementById("casa").value=="") ok=false;
				if(document.getElementById("anio").value=="") ok=false;
			}
			if (tipo=="premioanual" ) {
				if(document.getElementById("casa").value=="") ok=false;
			}
			if (tipo=="profesor") {
				if(document.getElementById("materia").value=="") ok=false;
			}
			if (tipo=="otro") {
				if(document.getElementById("otrotipo").value=="") ok=false;
			}
			if(tipo=="Muggle" || tipo=="Mago" || tipo=="Bruja" || tipo=="Squib") if (document.getElementById("ocupacion").value=="") ok=false;
			if (tipo!="Retrato Parlante"){
			
				if (document.getElementById("fnac").value=="") ok=false;
				if (document.getElementById("lnac").value=="") ok=false;
				if (document.getElementById("lres").value=="") ok=false;
				if (isNaN(document.getElementById("altura").value)) ok=false;
				if (document.getElementById("ojos").value=="") ok=false;
				if (document.getElementById("tez").value=="") ok=false;
				if (document.getElementById("pelo").value=="") ok=false;
				if(tipo!="Muggle" && tipo!="Criatura Mágica" && tipo!="Squib") if (document.getElementById("varita").value=="") ok=false;
				/*if (document.getElementById("mascota").value=="") ok=false;
				alert(document.getElementById("sangre").options[document.getElementById("sangre").selectedIndex].value);*/
			}
			if (document.getElementById("apariencia").value=="") ok=false;
			if (document.getElementById("personalidad").value=="") ok=false;
			if (document.getElementById("gustos").value=="") ok=false;
			if (document.getElementById("familia").value=="") ok=false;
			if (document.getElementById("historia").value=="") ok=false;
			
		} 
	if(ok) document.getElementById("edicionpers").submit();
	else alert("Revisa que no te falte completar ningún campo \nobligatorio y que hayas ingresado valores coherentes");
}
}

function ReSolicitar(id){
	document.getElementById("edicionpers").action="resolicitar.php?id="+id;
	document.getElementById("edicionpers").submit();
}

function ValRegUser(formu) {
	var ok=true;
	if(document.getElementById('username').value =="") ok=false;
	if(document.getElementById('pass').value =="") ok=false;
	if(document.getElementById('mail').value =="") ok=false;
	if(ok) formu.submit();
	else alert("Faltan completar campos");
}

function Post(formu) {
	var ok=true;
	if(document.getElementById('personaje').value =="") ok=false;
	if(document.getElementById('desc').value =="") ok=false;
	if(ok) {
		formu.submit();
		
	}
	else alert("Faltan completar campos");
}

function Thread(formu) {
	var ok=true;
	if(document.getElementById('personaje').value =="") ok=false;
	if(document.getElementById('desc').value =="") ok=false;
	if(document.getElementById('titulo').value =="") ok=false;
	if(ok) formu.submit();
	else alert("Faltan completar campos");
}

function editar(division, postid, threadid) {
if (division!="div0") {
reemp="<iframe src=\"edit.php?post="+postid+"&thread="+threadid+"\" scrolling=\"no\" width=\"100%\" frameborder=\"0\" height=\"140\"/>";
} else {
reemp="<iframe src=\"editT.php?post="+postid+"&thread="+threadid+"\" scrolling=\"no\" width=\"100%\" frameborder=\"0\" height=\"162\"/>";
}
document.getElementById(division).innerHTML=reemp;
}


function BorrarPosts(tope) {
var i;
var j=0;
for (i=1; i<=tope; i++) {
//alert(document.getElementById("borrarpost"+i).value);
if(document.getElementById("borrapost"+i).checked) j++;
}
if(j!=0) document.getElementById("posts").submit();
}
//-->

function ValidarPM(formu) {
	ok=true;
	if(document.getElementById("de").selectedIndex==-1) ok=false;
	if(document.getElementById("para").selectedIndex==-1 ) ok=false;
	if(document.getElementById("mensaje").value=="" ) ok=false;
	if(!ok) alert("Faltan completar campos");
	else formu.submit();
}



function Responder(char, charrec, play, playrec, subject, de, para) {
document.getElementById("Respuesta").innerHTML="<form id=\"respuestaPM\" method=\"post\" action=\"resppm.php\"><p><table width=\"620\" border=\"1\" align=\"right\" cellpadding=\"5\" cellspacing=\"0\" style=\"border:solid;border-color:#999999\"><tr><td><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"0\" style=\"border:none\"><tr><td><b>Tema:<input type=\"text\" id=\"subject\" name=\"subject\" value=\"Re:"+subject+"\" size=\"40\"/></b></td></tr><tr><td>De: "+para+"</td></tr><tr><td>Para: "+de+"</td></tr><tr><td><textarea name=\"desc\" id=\"descResp\"cols=\"60\" rows=\"10\"></textarea><input type=\"hidden\" name=\"char\" id=\"char\" value=\""+char+"\" /><input type=\"hidden\" name=\"charrec\" value=\""+charrec+"\" /><input type=\"hidden\" name=\"play\" value=\""+play+"\" /><input type=\"hidden\" name=\"playrec\" value=\""+playrec+"\" /><input type=\"hidden\" name=\"playrec\" value=\""+playrec+"\" /><br><br><input type=\"submit\" name=\"enviar\" value=\"Enviar\" /></td></tr></table></td></tr></table></p></form>";
}

function Cancelar() {
parent.location.reload();
}

function Ordenar(orden) {
location.href="members.php?orden="+orden;
}

//var cantAvatars = 1; Va impreso en el html
function agregarAvatar(celdaEmail) {
	cantAvatars++
	fila = document.createElement("tr");
	fila.className="celdas";
	fila2 = document.createElement("tr");
	fila2.className="celdas";
	
	strNuevoAvatar = '<td>Avatar 1 URL:</td>'
	+'<td><input name="avatarurl1" type="text" id="avatarurl1" size="50" /></td>';
	
	strNuevoAvatarDesc ='<td>Avatar 1 Descripci&oacute;n:</td>'
    +'<td><input name="avatardesc1" type="text" id="avatardesc1" size="50" maxlength="70" /></td>';
	//fila.innerHTML = strNuevoAvatar;
	//fila2.innerHTML = strNuevoAvatarDesc;
	
	fila.appendChild(document.createElement("td").appendChild(document.createTextNode("Avatar "+cantAvatars+" URL:")));
	td =document.createElement("td")
	td.innerHTML = '<input name="avatarurl'+cantAvatars+'" type="text" id="avatarurl'+cantAvatars+'" size="50" />'
	fila.appendChild(td);
	
	fila2.appendChild(document.createElement("td").appendChild(document.createTextNode("Avatar "+cantAvatars+" Descripción:")));
	td =document.createElement("td")
	td.innerHTML = '<input name="avatardesc'+cantAvatars+'" type="text" id="avatardesc'+cantAvatars+'" size="50" maxlength="70" />'
	fila2.appendChild(td);
	
	celdaEmail.parentNode.insertBefore(fila,celdaEmail);
	celdaEmail.parentNode.insertBefore(fila2,celdaEmail);
	if(cantAvatars==10) celdaEmail.parentNode.removeChild(celdaEmail);
}