
//alert("Este mensaje aparece a causa de maniobras de mantenimiento, no lo tengas en cuenta");

function montrela(inputobj1,linkname) {
//    ver si hay algo que hacer con inputoj1
             this.show(linkname);

}

function fenetre() {
  var windowMode = false;
  // Create a new PopupWindow object
  if (arguments.length==0) {
    var divname = "FenetreDiv";
    }
  else if (arguments[0] == "window") {
    var divname = '';
    windowMode = true;
    }
  else {
    var divname = arguments[0];
    }

  if (divname != "") {
    var cp = new PopupWindow(divname);
    }
  else {
    var cp = new PopupWindow();
    cp.setSize(225,250);
    }

  // Object variables
  cp.currentValue = "Times new Roman";

  // Method Mappings
  cp.writeDiv = Fenetre_writeDiv;
//  cp.highlightFont = FontPicker_highlightFont;
  cp.show = CosaPicker_show;
  cp.select = CosaPicker_select;
//  cp.cambia = Picker_cambiafont;



    cp.montrerfenetre=montrela;

    contenido="<TABLE BORDER=3 CELLSPACING=0 CELLPADDING=0 bgcolor=#00FFFF><tr><td> Hola hola </tr></td></table>";

    cp.populate(contenido);
    cp.setSize(225,250);
  cp.autoHide();

  return cp;
}

var yaavisado=false;


// BORRARR RR NO SIRVE
function lineasparatitu(inputtext){
function cuentalineas(text){
    if (text.indexOf('\n')==-1)
    {
    return Math.round(      (text.length+((text.length/col)*10))/col   +.5);
    }
    else{
    if (text.indexOf('\n')==0) { return 1+cuentalineas(text.slice(1));}
    else {return cuentalineas(text.slice(text.indexOf('\n')+1))+Math.round(      (text.indexOf('\n')+((text.indexOf('\n')/col)*10))/col   +.5);}
    }
}

var col=inputtext.cols;
var lineas=cuentalineas(inputtext.value);
//alert(lineas);
if ((lineas==10)&!yaavisado){
    alert('Tu mensaje es un poquillo largo,\n\nAproximadamente se te permiten 3 lineas mas, pero si deseas escribir un mensaje mas largo, incluir fotos etc, utiliza la opción MENSAJE ESPECIAL, tu mensaje podrá ser todo lo largo que quieras.\n\n\nERROR CORREGIDO: DESDE EL 22 febrero ya no se cuelga el sistema cuando se supera el límite permitido. Perdón a quienes les haya perjudicado...');
    yaavisado=true;
    }
if (lineas>13) {
while (cuentalineas(inputtext.value)>13)
   {
        inputtext.value=inputtext.value.substring(0,inputtext.value.length-5);
   }
}

}
// BORRARR RR NO SIRVE




function lineas(inputtextdescrip,minlin){
	function cuentalineas(text){
		if (text.indexOf('\n')==-1) {

return Math.round(      (text.length+((text.length/col)*10))/col   +.5);
		}
		else{
			if (text.indexOf('\n')==0) { return 1+cuentalineas(text.slice(1));}
			else {return cuentalineas(text.slice(text.indexOf('\n')+1))+Math.round(      (text.indexOf('\n')+((text.indexOf('\n')/col)*10))/col   +.5);}
		}
	}
	var col=inputtextdescrip.cols;
	var lineas=cuentalineas(inputtextdescrip.value);
	inputtextdescrip.rows=Math.max(lineas,minlin);
}

function lineasparadescrip(inputtext,num){
	
	var inputtextdescrip=inputtext['descrip'+num.toString()];
	if (num==numimagen+1) {
		lineas(inputtextdescrip,minlin1);
	}
	else {
		lineas(inputtextdescrip,1);
}

}



function recuadra(inputtext){
	enforo=inputtext.enforo.value;
	contitu=inputtext.contitu.value;
	
	if (enforo=='s') {
		var ancho=725;
		var lin=2;
		do {lin++; inputtext['descrip1'].rows=lin; } while (inputtext['descrip1'].clientHeight<336)
		minlin1=lin-1;
	}
	else {
		var ancho=1000;
		var lin=2;
		do {lin++; inputtext['descrip1'].rows=lin; } while (inputtext['descrip1'].clientHeight<210)
		minlin1=lin-1;
	}
	
	for (var num=1; num<numimagen+2; num++) {
		var col=2;
		do {col++; inputtext['descrip'+num.toString()].cols=col; } while (inputtext['descrip'+num.toString()].clientWidth<ancho)
		inputtext['descrip'+num.toString()].cols=col-2;
		if (num==numimagen+1) { lineas(inputtext['descrip'+num.toString()],minlin1); }
		else {lineas(inputtext['descrip'+num.toString()],1);}
	}
}


function unenlace(nim){
//    alert(444);
    var numimagenp=numimagen+1;
    if (nim!=0) {numimagenp=nim;}
//    if (browser==Netscape) {var ayuen='';} else {var ayuen='<tr><td>Nota: si deseas modificar el enlace que has creado, haz Clic en el manteniendo la tecla "Ctrl presionada.</td></tr>';}
    var ayuen='<tr><td colspan=2><center>Nota: si deseas modificar el enlace una vez creado, haz Clic en él manteniendo la tecla "Ctrl" presionada.</center></td></tr>';
    if (browser=='Netscape') {ayuen='';}
    if (nim==0) {var crmd='Con esta herramienta puedes crear un boton que permita a quién te lee abrir una página de internet que vas a definir.';}
                else {var crmd='Esta ventana te permite modificar el enlace que has creado.';}
    var contenido= ' '
+'  <form method="post" id="enla" enctype="multipart/form-data" >'
+'      <TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3 bgcolor="#cfcf9a">'
+'          <tr>'
+'              <td valign="middle" colspan=2>'
+'                  <center>'+crmd+'</center>'
+'              </td>'
+'          </tr>'
+'          <tr>'
+'              <td valign="middle" align="center">'
+'                  Escribe aquí el texto que aparecerá en el boton'
+'              </td>'
+'              <td valign="middle" align="center">'
+'                  Escribe aquí la dirección internet de la página que se abrirá al hacer clic en el boton'
+'              </td>'
+'          </tr>'
+'          <tr>'
+'              <td valign="middle" align="center">'
+'       <INPUT TYPE="text" STYLE=" color: #000000; background: #D0BA8A; font-family:Arial;  font-size: 18px"  NAME="titenla" id="titenla"  size="9" maxlength="13">'
+'        <!-- <textarea  type="text" STYLE=" color: #000000; background: #D0BA8A; font-family:Arial;  font-size: 18px"  name="titenla"  id="titenla" rows="1" cols="15" maxlength="15"></textarea> !--> '
+'              </td>'
+'              <td valign="middle" align="center">'
+'                  <textarea  type="text" STYLE=" color: #000000; background: #D0BA8A; font-family:Arial;  font-size: 18px"  name="urlenla"  id="urlenla" rows="3" cols="50" maxlength="150"></textarea>'
+'              </td>'
+'          </tr>'
+'          <tr>'
+'              <td valign="middle" align="center" colspan=2>'
+'                <table>'
+'                  <tr>'
+'                      <td>'
+'                      <A HREF="javascript:var iii=0;" class="gauibv" onClick="im.enviaenla('+nim.toString()+');">Validar</A>'
+'                      </td>'
+'                      <td>'
+'                      <A HREF="javascript:var iii=0;" class="gauibv" onClick="im.cierra();">Cancelar</A>'
+'                      </td>'
+'                  </tr>'
+'                </table>'
+'              </td>'
+'          </tr>'
+ayuen
+'       </TABLE>'
+'  </form>';
  im.populate(contenido);

    // ojo: depende de nim==0
    if(nim==0){this.show('dale60');} else {this.show('enlace'+nim.toString());}

//    document.getElementById("formmen")['1dato'+numimagenp.toString()].value='http://enlace';
    if (nim!=0){
      //alert('nim es distinto de cero:'+nim.toString());
      document.getElementById('titenla').innerHTML=document.getElementById("formmen")['1dato'+numimagenp.toString()].value;
      document.getElementById('urlenla').innerHTML=document.getElementById("formmen")['2dato'+numimagenp.toString()].value;
      }
    else {document.getElementById('urlenla').innerHTML='http://';}
}



function unaimagen(nim){
    var numimagenp=numimagen+1;
    if (nim!=0) {numimagenp=nim;}
    var contenido= ' '
+'  <form method="post" id="im" enctype="multipart/form-data" >'
+'      <TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3 bgcolor="#cfcf9a">'
+'          <tr>'
+'              <td valign="middle">'
+'                  <center>Si la imagen se encuentra en internet, <br>introduce su dirección aquí</center>'
+'              </td>'
+'              <td valign="middle" align="center">'
+'                  <textarea  type="text" STYLE=" color: #000000; background: #D0BA8A; font-family:Arial;  font-size: 18px"  name="urlim"  id="urlim" rows="3" cols="50" maxlength="150"></textarea>'
+'                <A HREF="javascript:var iii=0;" class="gauibv" onClick="im.envia('+nim.toString()+');">Validar</A>'
+'              </td>'
+'          </tr>'
+'          <tr>'
+'              <td valign="middle">'
+'                  <center>Si se encuentra en tu ordenador, <br>cargala con esta herramienta:</center>'
+'              </td>'
+'              <td align="center" >'
+'                  <A HREF="javascript:var iii=0;" class="gauibv" onClick="im.cargaenvia('+nim.toString()+');">Cargar imagen</A>'
+'              </td>'
+'          </tr>'
+'          <tr>'
+'              <td align="center"  colspan=2>'
+'                  <A HREF="javascript:var iii=0;" class="gauibv" onClick="im.cierra();">Cancelar</A>'
+'              </td>'
+'          </tr>'
+'       </TABLE>'
+'  </form>';

  im.populate(contenido);
    // ojo: depende de nim==0
    if(nim==0){this.show('dale59');} else {this.show('image'+nim.toString());}


    if (nim!=0){document.getElementById('urlim').innerHTML=document.getElementById("formmen")['1dato'+numimagenp.toString()].value;}
    else {document.getElementById('urlim').innerHTML='http://';}
}

function imagen_show(anchorname) {
  this.showPopup(anchorname);
  }

function terminadecargar(nim,repite){
      if (browser=='Netscape'){var titulo=cargawin.content.document.title;}else{var titulo=cargawin.document.title;}
      if (!(titulo=='Terminado.')){repite=repite+1; setTimeout("im.terminadecargar("+nim.toString()+","+repite.toString()+")",1000);}
      else {
       if (browser=='Netscape'){var elfichero=cargawin.content.document.forms[0].fichero.value;}
            else{ var elfichero=cargawin.document.forms[0].fichero.value;}

	cargawin.close();
      if (elfichero!='NO'){
      img= new Image();
      img.src='paraupload/foroycalen/'+elfichero;
      rowmin=1;
      this.hidePopup();
      im.ens(nim,1,img.src);
    }
    else {alert('Error');}

      }
}


function terminadecargarcf(repite){
	if (browser=='Netscape'){var titulo=cargawin.content.document.title;}else{var titulo=cargawin.document.title;}
	if (!(titulo=='Terminado.')){repite=repite+1; setTimeout("im.terminadecargarcf("+repite.toString()+")",1000);}
	else {
		cargawin.close();
		location.reload();
		//this.hidePopup();
	}
}



function cargaenvia(nim){
        cargawin=window.open('index.php?g=preuploader&padonde=foroycalen','wincarga','width=600,height=400,left=200,top=200,toolbar=No,location=No,scrollbars=Yes,status=no,resizable=Yes,fullscreen=No');
        im.terminadecargar(nim,1);
        this.hidePopup();
    }





function enviaenla(nim){
      var enviado=document.getElementById('enla').urlenla.value;
      var etitulo=document.getElementById('enla').titenla.value;
      if (etitulo!=''){
      if (enviado.slice(0,7)=='http://'){
      if (nim==0) {
      numimagen=numimagen+1;
      nim=numimagen;
      var sigue=numimagen+1;

      //Si estamos con Netscape, guardamos los valores de los forms
      if (browser=='Netscape')
      { var losnombres=new Array();var losvalores=new Array();var gg=document.getElementById("formmen").elements;var lengthfm=gg.length;
        for (var indc=0; indc<lengthfm; indc++){losnombres[indc]=gg[indc].name;losvalores[indc]=gg[indc].value;}}

      //Se añade un enlace y un texto
      var ht=document.body.innerHTML;
      var unomas=ht.substring(ht.indexOf('<!--AkQRREEPPDEB!-->')+20,ht.indexOf('<!--AkQRREEPPFIN!-->'));
     unomas=unomas.replace(/descrip1/g,'descrip'+sigue.toString());
     unomas=unomas.replace("lineasparadescrip(document.getElementById('formmen'),1",'lineasparadescrip(document.getElementById("formmen"),'+sigue.toString());
     unomas=unomas.replace("elfocus=1",'elfocus='+sigue.toString());
    
      if (browser=='Netscape'){
//      unomas='<A HREF="'+enviado+'" target="_blank" class="gauibv" NAME="enlace'+nim.toString()+'" ID="enlace'+nim.toString()+'">'+etitulo+'</A>'+unomas;  }
        unomas='<A HREF="javascript:modim.ledioen('+numimagen.toString()+');"   class="gauibv" NAME="enlace'+nim.toString()+'" ID="enlace'+nim.toString()+'">'+etitulo+'</A>'+unomas;  }
      else {
      unomas='<A  style="cursor:hand" onmousedown="modim.ledioen('+numimagen.toString()+');" class="gauibv" NAME="enlace'+nim.toString()+'" ID="enlace'+nim.toString()+'">'+etitulo+'</A>'+unomas;  }
      document.body.innerHTML=ht.substring(0, ht.indexOf('<!--AkQGGAAUU!-->'))+unomas+ht.substring(ht.indexOf('<!--AkQGGAAUU!-->'));
      unomas='<INPUT TYPE="hidden" NAME="0dato'+numimagen.toString()+'" SIZE="1" VALUE="" ><INPUT TYPE="hidden" NAME="1dato'+numimagen.toString()+'" SIZE="50" VALUE="http://" ><INPUT TYPE="hidden" NAME="2dato'+numimagen.toString()+'" SIZE="50" VALUE="http://" ><INPUT TYPE="hidden" NAME="3dato'+numimagen.toString()+'" SIZE="4" VALUE="E" ><INPUT TYPE="hidden" NAME="4dato'+numimagen.toString()+'" SIZE="4" VALUE="E" >';
      ht=document.body.innerHTML;
      document.body.innerHTML=ht.substring(0, ht.indexOf('<!--AANNADIR AKI EL RESTO!-->'))+unomas+ht.substring(ht.indexOf('<!--AANNADIR AKI EL RESTO!-->'));

      if (browser=='Netscape')
      { //alert(indc);
        for (var indc=0; indc<lengthfm; indc++){document.getElementById("formmen")[losnombres[indc]].value=losvalores[indc];}
       }

      document.getElementById("formmen")['descrip'+sigue.toString()].value='';
//              alert(document.anchors);

      }
      else {
            this.hidePopup();
            var ht=document.body.innerHTML;
            var titanterior=document.getElementById("formmen")['1dato'+nim.toString()].value;
            var enviadoanterior=document.getElementById("formmen")['2dato'+nim.toString()].value;
            if (browser=='Netscape')
            {
            var acambiar='id=\"enlace'+nim.toString()+'\">'+titanterior+'<';
            var cambiado='id="enlace'+nim.toString()+'">'+etitulo+'<';
            ht=ht.replace(RegExp(acambiar),cambiado);
            var losnombres=new Array();var losvalores=new Array();var gg=document.getElementById("formmen").elements;var lengthfm=gg.length;
            for (var indc=0; indc<lengthfm; indc++){losnombres[indc]=gg[indc].name;losvalores[indc]=gg[indc].value; }
            document.body.innerHTML=ht;
            for (var indc=0; indc<lengthfm; indc++){document.getElementById("formmen")[losnombres[indc]].value=losvalores[indc]; }
            }

            else {
            var acambiar='name=enlace'+nim.toString()+'>'+titanterior+'</A><';
            var cambiado='name=enlace'+nim.toString()+'>'+etitulo+'</A><';
            ht=ht.replace(RegExp(acambiar),cambiado);
            document.body.innerHTML=ht;
            }

      }

     document.getElementById("formmen")['1dato'+nim.toString()].value=etitulo;
      document.getElementById("formmen")['2dato'+nim.toString()].value=enviado;
      document.getElementById("formmen")['numcosas'].value=numimagen;
      document.getElementById("formmen")['0dato'+nim.toString()].value='e';

      this.hidePopup();
      recuadra(document.getElementById("formmen"));
        }


      else {alert(urlnogood);}
      }
      else {alert(botvacio);}


}








function enviadatosim(nim){
      var enviado=document.getElementById('im').urlim.value;
      if (enviado.slice(0,7)=='http://'){
      img= new Image();
      img.src=enviado;
      rowmin=1;
      this.hidePopup();
      im.ens(nim,1,enviado);
      }
      else {alert(urlnogood);}
    }

function cierrala(){
      this.hidePopup();
    }

function ens(nim,repite,enviado){
      if (repite==10){alert(imnocargada);}
      else
      {
      if (img.height==''){
        repite=repite+1; setTimeout("im.ens("+nim.toString()+","+repite.toString()+",'"+enviado+"')",500);}
      else {
      if (repite!=0){
        var arepetir="im.ens("+nim.toString()+",0,'"+enviado+"')";
        repite=0;setTimeout(arepetir,500);
        }
      else {
      if (nim==0) {
      numimagen=numimagen+1;
      nim=numimagen;
      var sigue=numimagen+1;
      if (browser=='Netscape')
      { var losnombres=new Array();
        var losvalores=new Array();
        var gg=document.getElementById("formmen").elements;
        var lengthfm=gg.length;
        for (var indc=0; indc<lengthfm; indc++){losnombres[indc]=gg[indc].name;losvalores[indc]=gg[indc].value;}
       }

	var ht=document.body.innerHTML;
      var unomas=ht.substring(ht.indexOf('<!--AkQRREEPPDEB!-->')+20,ht.indexOf('<!--AkQRREEPPFIN!-->'));
      unomas=unomas.replace(/descrip1/g,'descrip'+sigue.toString());
     unomas=unomas.replace('lineasparadescrip(document.getElementById("formmen"),1','lineasparadescrip(document.getElementById("formmen"),'+sigue.toString());
     unomas=unomas.replace("elfocus=1",'elfocus='+sigue.toString());

      if (browser=='Netscape'){
      unomas=' <a HREF="javascript:var iii=0;" onClick="modim.ledioim('+numimagen.toString()+');"  NAME="aimage'+numimagen.toString()+'" id="aimage'+numimagen.toString()+'"><img src=""  heigth=0 width=0 border=0 NAME="image'+numimagen.toString()+'" id="image'+numimagen.toString()+'"></a><br>'+unomas;}
      else {

      unomas=' <a style="cursor:hand" onmousedown="modim.ledioim('+numimagen.toString()+');"  NAME="aimage'+numimagen.toString()+'" id="aimage'+numimagen.toString()+'"><img src=""  heigth=0 width=0 border=0 NAME="image'+numimagen.toString()+'" id="image'+numimagen.toString()+'"></a><br>'+unomas;}
      document.body.innerHTML=ht.substring(0, ht.indexOf('<!--AkQGGAAUU!-->'))+unomas+ht.substring(ht.indexOf('<!--AkQGGAAUU!-->'));
      unomas='<INPUT TYPE="hidden" NAME="0dato'+numimagen.toString()+'" SIZE="1" VALUE="" ><INPUT TYPE="hidden" NAME="1dato'+numimagen.toString()+'" SIZE="50" VALUE="http://" ><INPUT TYPE="hidden" NAME="2dato'+numimagen.toString()+'" SIZE="50" VALUE="http://" ><INPUT TYPE="hidden" NAME="3dato'+numimagen.toString()+'" SIZE="4" VALUE="'+img.height.toString()+'" ><INPUT TYPE="hidden" NAME="4dato'+numimagen.toString()+'" SIZE="4" VALUE="'+img.width.toString()+'" >';

	ht=document.body.innerHTML;
	
      document.body.innerHTML=ht.substring(0, ht.indexOf('<!--AANNADIR AKI EL RESTO!-->'))+unomas+ht.substring(ht.indexOf('<!--AANNADIR AKI EL RESTO!-->'));

      if (browser=='Netscape')
      { //alert(indc);
        for (var indc=0; indc<lengthfm; indc++){document.getElementById("formmen")[losnombres[indc]].value=losvalores[indc];}
       }

      document.getElementById("formmen")['descrip'+sigue.toString()].value='';
      }
     document.getElementById("formmen")['1dato'+nim.toString()].value=enviado;

      document.getElementById("formmen")['numcosas'].value=numimagen;
      document.getElementById("formmen")['0dato'+nim.toString()].value='i';
      document.getElementById('image'+nim.toString()).height=img.height;
      document.getElementById('image'+nim.toString()).width=img.width;
      document.getElementById('image'+nim.toString()).src=enviado;
      document.getElementById('image'+nim.toString()).style.visibility='visible';
      document.getElementById('aimage'+nim.toString()).style.visibility='visible';
      recuadra(document.getElementById("formmen"));
 
        }

      }

      }

}



function imagen() {

  var windowMode = false;
  if (arguments.length==0) {var divname = "imagenDiv";}
  else if (arguments[0] == "window") {var divname = '';windowMode = true;}
  else {var divname = arguments[0];}
  if (divname != "") {var cp = new PopupWindow(divname);}
  else {var cp = new PopupWindow();cp.setSize(225,250);}

  cp.currentValue = "../\'.$imconf[\'ayuda\'].\'";
  cp.writeDiv = imagen_writeDiv;
  cp.show = imagen_show;
    cp.unaimagen=unaimagen;
    cp.unenlace=unenlace;
    cp.envia=enviadatosim;
    cp.cargaenvia=cargaenvia;
    cp.cierra=cierrala;
    cp.ens=ens;
    cp.terminadecargar=terminadecargar;
    cp.terminadecargarcf=terminadecargarcf;
    cp.enviaenla=enviaenla;
// un pelin chapuzilla:
    cp.anaderegistrado=anaderegistrado;
    cp.identifica=identifica;
    cp.numcosas=numcosas;
  cp.offsetX = 10;
  cp.offsetY = -200;
//  cp.autoHide();
    return cp;
  }

function aumenta(nim){
    inputimagen.height=Math.round(inputimagen.height*1.1+.5);
    inputimagen.width=Math.round(inputimagen.width*1.1+.5);
    document.getElementById("formmen")['3dato'+nim.toString()].value=inputimagen.height;
    document.getElementById("formmen")['4dato'+nim.toString()].value=inputimagen.width;

    }
function reducir(nim){
    inputimagen.height=Math.round(inputimagen.height*.9+.5);
    inputimagen.width=Math.round(inputimagen.width*.9+.5);
    document.getElementById("formmen")['3dato'+nim.toString()].value=inputimagen.height;
    document.getElementById("formmen")['4dato'+nim.toString()].value=inputimagen.width;

    }

function montremodim(nimag){
	if (enforo=='s') {
		var ancla='ccrree';
	}
	else  {
		var ancla='image'+nimag.toString();
	}
	ancla='image'+nimag.toString();
	var ni=nimag.toString();
	var contenido= '<TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3 bgcolor="#cfcf9a"><tr><td ><A HREF="javascript:var iii=0;" class="gauibv" onClick="modim.cierra();im.offsetX=200;im.unaimagen('+ni+');">Cambiar</A><A HREF="javascript:var iii=0;" class="gauibv" onClick="modim.aumenta('+ni+');">Aumentar</A><A HREF="javascript:var iii=0;" class="gauibv" onClick="modim.reducir('+ni+');">Reducir</A><A HREF="javascript:var iii=0;"  name="botonenlace1" id="botonenlace1" class="gauibv" onClick="enlaceim.princenlaceimagen('+ni+');">Crear enlace</A><A HREF="javascript:var iii=0;" class="gauibv" onClick="modim.cierra();">Cierra</A></td></tr></TABLE>';
	modim.populate(contenido);
	window.inputimagen =document.getElementById('image'+nimag.toString());
	this.show(ancla);
	if (document.getElementById("formmen")['2dato'+nimag.toString()].value!='http://'){
		document.getElementById("botonenlace1").innerHTML="Modif. enlace";
	}
}


function ledioim(ni){
	
	if (enforo=='s') {
		var ancla='ccrree';
	}
	else  {
		var ancla='image'+ni;
	}
	if (browser=='Netscape') {
		modim.montremodim(ni);
	}
	else {
		if (event.ctrlKey==1) {
			modim.montremodim(ni);
		}
		else {
				if (document.getElementById("formmen")['2dato'+ni].value=='http://'){
				var contenido= '<TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3 bgcolor="#cfcf9a"><tr><td >Si deseas modificar esta imagen, haz clic en ella <b>manteniendo la tecla "Ctrl" presionada</b>.<br><br><center><A HREF="javascript:var iii=0;" class="gauibv" onClick="modim.cierra();">Cierra</A></center></td></tr></TABLE>';
				modim.populate(contenido);
				window.inputimagen =document.getElementById('image'+ni);
				this.show(ancla);
				}
			else { 
				window.open(document.getElementById("formmen")['2dato'+ni].value); 
			}
		}
	}
}



function ledioen(nimag){
//alert('en ledioim');

    if (browser=='Netscape'){im.unenlace(nimag);}
    else {
    if (event.ctrlKey==1) {im.unenlace(nimag);}
    else { window.open(document.getElementById("formmen")['2dato'+nimag].value); }
  }

}



function modifimagen_show(anchorname) {
  this.showPopup(anchorname);
  }


function modifimagen() {

  var windowMode = false;
  if (arguments.length==0) {
    var divname = "modifimagenDiv";
    }
  else if (arguments[0] == "window") {
    var divname = '';
    windowMode = true;
    }
  else {
    var divname = arguments[0];
    }

  if (divname != "") {
    var cp = new PopupWindow(divname);
    }
  else {
    var cp = new PopupWindow();
    cp.setSize(225,250);
    }
  cp.writeDiv = modifimagen_writeDiv;
  cp.show = modifimagen_show;
    cp.montremodim=montremodim;
    cp.aumenta=aumenta;
    cp.reducir=reducir;
    cp.cierra=cierrala;
    cp.ledioim=ledioim;
    cp.ledioen=ledioen;
  cp.offsetX = 30;
    var browser=navigator.appName;
    if (browser=='Netscape'){cp.offsetY = -78;}
    return cp;
  }

function princenlaceimagen(ni){

/// SEGUIR CAMBIANDO AKI DESPUES DE ARREGLAR LO DE MS

    var contenido= '<form method="post" id="im"><TABLE BORDER=3 CELLSPACING=3 CELLPADDING=3 bgcolor="#cfcf9a"><tr><td valign="middle" rowspan=2><center>Por favor escribe la dirección que deseas<br>que se abra al pinchar en la imagen:</center></td><td valign="middle" rowspan=2><textarea  type="text" STYLE=" color: #000000; background: #D0BA8A; font-family:Arial;  font-size: 18px"  name="enlaceima"  id="enlaceima" rows="3" cols="50" maxlength="150"></textarea></td><td align="right"><A HREF="javascript:var iii=0;" class="gauibv" onClick="enlaceim.envia('+ni+');">Enviar</A></td></tr><tr><td align="right"><A HREF="javascript:var iii=0;" class="gauibv" onClick="enlaceim.cierra();">Cancelar</A></td></tr>  </TABLE></form>';
  enlaceim.populate(contenido);



    this.show('botonenlace1');
    document.getElementById('enlaceima').innerHTML=document.getElementById("formmen")['2dato'+ni].value;
}

function enlaceimagen_show(anchorname) {
  this.showPopup(anchorname);
  }


function enviadatosenlaceimagen(ni){
      var enviado=document.getElementById('enlaceima').value;
      if (enviado.slice(0,7)=='http://'){
      document.getElementById("formmen")['2dato'+ni].value=enviado;
    document.getElementById("botonenlace1").innerHTML="Modif. enlace";
      this.hidePopup();
      }
      else {alert(urlnogood);}
    }

function enlaceimagen() {

  var windowMode = false;
  if (arguments.length==0) {var divname = "enlaceimagenDiv";}
  else if (arguments[0] == "window") {var divname = '';windowMode = true;}
  else {var divname = arguments[0];}
  if (divname != "") {var cp = new PopupWindow(divname);}
  else {var cp = new PopupWindow();cp.setSize(225,250);}
  cp.currentValue = "../\'.$imconf[\'ayuda\'].\'";
  cp.writeDiv = enlaceimagen_writeDiv;
  cp.show = enlaceimagen_show;
    cp.princenlaceimagen=princenlaceimagen;
    cp.envia=enviadatosenlaceimagen;
    cp.cierra=cierrala;

  cp.offsetX = -500;
//  cp.autoHide();
    return cp;

  }



function anaderegistrado(nombre) {
//alert('añadimos '+nombre);

registrados.push(nombre);
}
function identifica() {
identificado=true;}

function numcosas(txtnumcosas) {numimagen=parseInt(txtnumcosas);}



function isset(  ) {
    var a=arguments; var l=a.length; var i=0;
    while ( i!=l ) {
        if (typeof(a[i])=='undefined') { 
            return false; 
        } else { 
            i++; 
        }
    }
    return true;
}



function enviamos() {




var ook=true;
var categ=0;



if (contitu=='s') {
	if (document.getElementById('titu').value==''){ook=false; alert(nohaytit);}
	for (i=0;i<numcateg;i++) {
//		alert ("Mensaje "+i+"/7 para mantenimiento de la página (no hacer caso) \n\n numcateg="+numcateg+"->"+document.forms['categoria'+i].checked);

//		alert ("Mensaje "+i+"/7 para mantenimiento de la página (no hacer caso) \n\n numcateg="+numcateg+"->");

		
//		if (document.forms["categoria"+i].checked==true) {categ++;}
		if (isset(document.getElementById("categoria"+i).checked)) {
			if (document.getElementById("categoria"+i).checked==true) {categ++;}
		}
	}
//	alert(categ);
	if (categ==0){ook=false; alert(nohaycateg);}
	
}
if (!identificado)
    {  var nombredado=quitaespacios(document.getElementById("formmen")['autor'].value).toLowerCase();
      for (var i=0; i<registrados.length;i++)
         {
           if (quitaespacios(registrados[i]).toLowerCase()==nombredado) {ook=false; alert(nmbutilexist1+registrados[i]+nmbutilexist2);}
         }
    }

if (ook) {document.getElementById("formmen").submit();}

}

function quitaespacios(texto) {
while (texto.indexOf(' ')!=-1){texto=texto.slice(0,texto.indexOf(' '))+texto.slice(texto.indexOf(' ')+1)}
return texto;
}



function varios() {

  var windowMode = false;
  if (arguments.length==0) {var divname = "variosDiv";}
  else if (arguments[0] == "window") {var divname = '';windowMode = true;}
  else {var divname = arguments[0];}
  if (divname != "") {var cp = new PopupWindow(divname);}
  else {var cp = new PopupWindow();cp.setSize(225,250);}
    cp.gestiondeestilos=gestiondeestilos;
    cp.cargaesti=cargaesti;
    return cp;
  }





function gestiondeestilos(){
if (contitu=='s') {
        estiwin=window.open('index.php?g=gestioesti&enforo='+document.getElementById("formmen").enforo.value+'&a='+document.getElementById("formmen").colortit.value.slice(1,7)+'&b='+document.getElementById("formmen").fondotit.value.slice(1,7)+'&c='+document.getElementById("formmen").colordescrip.value.slice(1,7)+'&d='+document.getElementById("formmen").fondodescrip.value.slice(1,7)+'&e='+document.getElementById("formmen").estidescrip.value+'&f='+document.getElementById("formmen").tamaestinormaldescrip.value+'&gg='+document.getElementById("formmen").tamaestidescrip.value+'&h='+document.getElementById("formmen").subrayadescrip.value+'&i='+document.getElementById("formmen").gruesodescrip.value+'&j='+document.getElementById("formmen").cursivadescrip.value,'winesti','width=900,height=670,left=200,top=30,toolbar=No,location=No,scrollbars=Yes,status=no,resizable=Yes,fullscreen=No');
}
else {
        estiwin=window.open('index.php?g=gestioesti&enforo='+document.getElementById("formmen").enforo.value+'&c='+document.getElementById("formmen").colordescrip.value.slice(1,7)+'&d='+document.getElementById("formmen").fondodescrip.value.slice(1,7)+'&e='+document.getElementById("formmen").estidescrip.value+'&f='+document.getElementById("formmen").tamaestinormaldescrip.value+'&gg='+document.getElementById("formmen").tamaestidescrip.value+'&h='+document.getElementById("formmen").subrayadescrip.value+'&i='+document.getElementById("formmen").gruesodescrip.value+'&j='+document.getElementById("formmen").cursivadescrip.value,'winesti','width=900,height=670,left=200,top=30,toolbar=No,location=No,scrollbars=Yes,status=no,resizable=Yes,fullscreen=No');
}
}

function cargaesti(repite){
      if (browser=='Netscape'){
         try {var titulo=estiwin.content.document.title;}
         catch (err) {titulo='Terminado';}
         }
      else {
         try {var titulo=estiwin.document.title;}
         catch (err) {titulo='Terminado';}
         }
      if (!(titulo=='Terminado.')&&!(titulo=='No identif.')){
        repite=repite+1;
      setTimeout("varios.cargaesti("+repite.toString()+")",1000);
      }
      else {//alert('salimos bucle');

      var ycerramos=1;

      if (titulo!='No identif.') {

      if (browser=='Netscape'){
         var quehizo=estiwin.content.document.getElementById("formmen").quehizo.value;
         var estidefact=estiwin.content.document.estidefact;
         var estidefprop=estiwin.content.document.estidefprop;
         }
      else{
         var quehizo=estiwin.document.getElementById("formmen").quehizo.value;
         var estidefact=estiwin.document.estidefact;
         var estidefprop=estiwin.document.estidefprop;

         }
      if (quehizo=='S') {
        ycerramos=0;
        estiwin.location='index.php?g=grabaestilo&cadenaesti='+estiwin.document.cadenaestiact+'&hacia='+estiwin.document.hacia;
      }
      if (quehizo=='C') {
              
	if (browser=='Netscape'){
		if (contitu=='s') {
			colortit=estiwin.content.document.getElementById("formmen").colortit.value;
			fondotit=estiwin.content.document.getElementById("formmen").fondotit.value;
		}
		colordescrip=estiwin.content.document.getElementById("formmen").colordescrip.value;
		fondodescrip=estiwin.content.document.getElementById("formmen").fondodescrip.value;
		estidescrip=estiwin.content.document.getElementById("formmen").estidescrip.value;
		tamaestinormaldescrip=estiwin.content.document.getElementById("formmen").tamaestinormaldescrip.value;
		tamaestidescrip=estiwin.content.document.getElementById("formmen").tamaestidescrip.value;
		subrayadescrip=estiwin.content.document.getElementById("formmen").subrayadescrip.value;
		gruesodescrip=estiwin.content.document.getElementById("formmen").gruesodescrip.value;
		cursivadescrip=estiwin.content.document.getElementById("formmen").cursivadescrip.value;
	}
       else{
		if (contitu=='s') {
			colortit=estiwin.document.getElementById("formmen").colortit.value;
			fondotit=estiwin.document.getElementById("formmen").fondotit.value;
		}
		colordescrip=estiwin.document.getElementById("formmen").colordescrip.value;
		fondodescrip=estiwin.document.getElementById("formmen").fondodescrip.value;
		estidescrip=estiwin.document.getElementById("formmen").estidescrip.value;
		tamaestinormaldescrip=estiwin.document.getElementById("formmen").tamaestinormaldescrip.value;
		tamaestidescrip=estiwin.document.getElementById("formmen").tamaestidescrip.value;
		subrayadescrip=estiwin.document.getElementById("formmen").subrayadescrip.value;
		gruesodescrip=estiwin.document.getElementById("formmen").gruesodescrip.value;
		cursivadescrip=estiwin.document.getElementById("formmen").cursivadescrip.value;
	}

     if (contitu=='s') {
		document.getElementById("formmen")['titu'].style['color']=colortit;
		document.getElementById("formmen")['titu'].style['background']=fondotit;
		document.getElementById("formmen").colortit.value=colortit;
		document.getElementById("formmen").fondotit.value=fondotit;
	}

		for (var i=1; i<=numimagen+1; i++) {
			document.getElementById("formmen")['descrip'+i.toString()].style.fontFamily=estidescrip;
			document.getElementById("formmen")['descrip'+i.toString()].style.fontSize=tamaestidescrip+'px';
			document.getElementById("formmen")['descrip'+i.toString()].style['color']=colordescrip;
			document.getElementById("formmen")['descrip'+i.toString()].style['background']=fondodescrip;
		}
		if (browser=='Netscape'){
			if ((document.getElementById("formmen").descrip1.style.textDecoration=='underline')&&(subrayadescrip=='0')){
				for (var j=1; j<=numimagen+1; j++) {document.getElementById("formmen")['descrip'+j.toString()].style.textDecoration='';}
			}
			if ((document.getElementById("formmen").descrip1.style.textDecoration!='underline')&&(subrayadescrip=='1')){
				for (var j=1; j<=numimagen+1; j++) {document.getElementById("formmen")['descrip'+j.toString()].style.textDecoration='underline';}
			}
			if (cursivadescrip=='1'){
				for (var i=1; i<=numimagen+1; i++) {document.getElementById("formmen")['descrip'+i.toString()].style.fontStyle='italic';}
			}
			else {
				for (var i=1; i<=numimagen+1; i++) {document.getElementById("formmen")['descrip'+i.toString()].style.fontStyle='';}
			}
		}
		else {
			if (subrayadescrip=='0'){
				for (var j=1; j<=numimagen+1; j++) {document.getElementById("formmen")['descrip'+j.toString()].style.textDecorationUnderline=false;}
			}
			else {
				for (var j=1; j<=numimagen+1; j++) {document.getElementById("formmen")['descrip'+j.toString()].style.textDecorationUnderline=true;}
			}
			var f=document.getElementById("formmen").descrip1.style.cssText;
			var i= f.indexOf('FONT-STYLE: italic;');
			if (i==-1){
				if (cursivadescrip=='1') {for (var j=1; j<=numimagen+1; j++) {  document.getElementById("formmen")['descrip'+j.toString()].style.cssText='FONT-STYLE: italic; '+f;}}
			}
			else {
				if (cursivadescrip=='0') {for (var j=1; j<=numimagen+1; j++) {  document.getElementById("formmen")['descrip'+j.toString()].style.cssText=f.slice(0,i)+f.slice(i+20);}}
			}
		}
		if ((document.getElementById("formmen").descrip1.style.fontWeight=="bold")&&(gruesodescrip=='0')) {
			for (var j=1; j<=numimagen+1; j++) {document.getElementById("formmen")['descrip'+j.toString()].style.fontWeight="";}
		}
		if ((document.getElementById("formmen").descrip1.style.fontWeight!="bold")&&(gruesodescrip=='1')) {
			for (var j=1; j<=numimagen+1; j++) {document.getElementById("formmen")['descrip'+j.toString()].style.fontWeight="bold";}
		}
		ht=document.body.innerHTML;
		if (browser=='Netscape'){
			var coldonde=ht.indexOf('<td triluli="" align="center" bgcolor="')+39;
			//Estamos con Netscape, guardamos los valores de los forms
			var losnombres=new Array();
			var losvalores=new Array();
			var gg=document.getElementById("formmen").elements;
			var lengthfm=gg.length;
			for (var indc=0; indc<lengthfm; indc++){losnombres[indc]=gg[indc].name;losvalores[indc]=gg[indc].value;}
			//Se añade modifica el color
			document.body.innerHTML=ht.substring(0,coldonde)+fondodescrip+ht.substring(coldonde+7);
			//Se recupera los forms
			for (var indc=0; indc<lengthfm; indc++){document.getElementById("formmen")[losnombres[indc]].value=losvalores[indc];}
		}
		else {
			var coldonde=ht.indexOf(' triluli="">')-7;
			document.body.innerHTML=ht.substring(0,coldonde)+fondodescrip+ht.substring(coldonde+7);
		}
		document.getElementById("formmen").estidescrip.value=estidescrip;
		document.getElementById("formmen").tamaestinormaldescrip.value=tamaestinormaldescrip;
		document.getElementById("formmen").tamaestidescrip.value=tamaestidescrip;
		document.getElementById("formmen").colordescrip.value=colordescrip;
		document.getElementById("formmen").fondodescrip.value=fondodescrip;
		document.getElementById("formmen").subrayadescrip.value=subrayadescrip;
		document.getElementById("formmen").gruesodescrip.value=gruesodescrip;
		document.getElementById("formmen").cursivadescrip.value=cursivadescrip;
		if (browser=='Netscape'){var doclinks=document.links;}else{var doclinks=document.documentElement.all;}
		//Boton Subrayado
		var elboton=doclinks.dale29;
		if (subrayadescrip=='0'){elboton.className='gauibv';}else{elboton.className='gauibvdado';}
		//Boton Grueso
		var elboton=doclinks.dale27;
		if (gruesodescrip=='0'){elboton.className='gauibv';}else{elboton.className='gauibvdado';}
		//Boton Cursiva
		var elboton=doclinks.dale31;
		if (cursivadescrip=='0'){elboton.className='gauibv';}else{elboton.className='gauibvdado';}
		recuadra(document.getElementById("formmen"));
//	}

 }


   }


   if (estidefprop!=estidefact){
      ycerramos=0;
      estiwin.location='index.php?g=cambiaestilodef&estidefprop='+estidefprop.toString();
   }//(estidefprop!=estidefact)
   if (ycerramos==1){
      estiwin.close();
   }

   }


}




var win = null;
function gauwin(url,nombre,parcial,param) {
  //alert('ola');
  var pw = screen.width*parcial;
  var ph = screen.height*parcial;
  var xoffset= (screen.width-pw)/2;
  var yoffset= (screen.height-ph)/2;
  var settings = 'height=' + ph + ',';
  settings += 'width=' + pw + ',';
  settings += 'top=' + yoffset + ',';
  settings += 'left=' + xoffset + ',';
  settings += param;
  window.open(url,nombre,settings);
}



function herram1() {

///////////////////////// HERRAM ////////////////////////
//     var gg=document.anchors[13];
       var gg=document.links.namedItem("enlace1");
         var todo='LISTA \n';
         var i=0;
//         for (var prop in gg){ todo+=prop + " > " + gg[prop]+'\n'; i=i+1; if (i==10)  {alert(todo); todo='LISTA \n'; i=0;}}
         for (var prop in gg){todo+=prop + " -> " + gg[prop]+'\n'; }

      document.getElementById('descrip1').value=todo;
///////////////////////// HERRAM ////////////////////////

}




function herram2() {

var mens='document.body.scrollLeft='+document.body.scrollLeft+'\n';
mens+='document.body.scrollTop='+document.body.scrollTop+'\n';
mens+='window.screenX='+window.screenX+'\n';
mens+='window.screenY'+window.screenY+'\n';
mens+='window.outerWidth'+window.outerWidth+'\n';
mens+='window.innerWidth'+window.innerWidth+'\n';
mens+='window.outerHeight'+window.outerHeight+'\n';
mens+='window.innerHeight'+window.innerHeight+'\n';


alert(mens);


}



function getAnchorPosition(anchorname) {
  var useWindow=false;
  var coordinates=new Object();
  var x=0,y=0;
  var use_gebi=false, use_css=false, use_layers=false;
  if (document.getElementById) { use_gebi=true; }
  else if (document.all) { use_css=true; }
  else if (document.layers) { use_layers=true; }
   if (use_gebi && document.all) {
    x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
    y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
    }
  else if (use_gebi) {
    var o=document.getElementById(anchorname);
    x=AnchorPosition_getPageOffsetLeft(o);
    y=AnchorPosition_getPageOffsetTop(o);
    }
   else if (use_css) {
    x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
    y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
    }
  else if (use_layers) {
    var found=0;
    for (var i=0; i<document.anchors.length; i++) {
      if (document.anchors[i].name==anchorname) { found=1; break; }
      }
    if (found==0) {
      coordinates.x=0; coordinates.y=0; return coordinates;
      }
    x=document.anchors[i].x;
    y=document.anchors[i].y;
    }
  else {
    coordinates.x=0; coordinates.y=0; return coordinates;
    }
  coordinates.x=x;
  coordinates.y=y;
  return coordinates;
  }


function getAnchorWindowPosition(anchorname) {
  var coordinates=getAnchorPosition(anchorname);
  var x=0;
  var y=0;
  if (document.getElementById) {
    if (isNaN(window.screenX)) {
      x=coordinates.x-document.body.scrollLeft+window.screenLeft;
      y=coordinates.y-document.body.scrollTop+window.screenTop;
      }
    else {
      x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
      y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
      }
    }
  else if (document.all) {
    x=coordinates.x-document.body.scrollLeft+window.screenLeft;
    y=coordinates.y-document.body.scrollTop+window.screenTop;
    }
  else if (document.layers) {
    x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
    y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
    }
  coordinates.x=x;
  coordinates.y=y;
  return coordinates;
  }
function AnchorPosition_getPageOffsetLeft (el) {
  var ol=el.offsetLeft;
  while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
  return ol;
  }
function AnchorPosition_getWindowOffsetLeft (el) {
  return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
  }
function AnchorPosition_getPageOffsetTop (el) {
  var ot=el.offsetTop;
  while((el=el.offsetParent) != null) { ot += el.offsetTop; }
  return ot;
  }
function AnchorPosition_getWindowOffsetTop (el) {
  return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
  }
function PopupWindow_getXYPosition(anchorname) {
  var coordinates;
  if (this.type == "WINDOW") {
    coordinates = getAnchorWindowPosition(anchorname);
    }
  else {
    coordinates = getAnchorPosition(anchorname);
    }
  this.x = coordinates.x;
  this.y = coordinates.y;
  }
function PopupWindow_setSize(width,height) {
  this.width = width;
  this.height = height;
  }
function PopupWindow_populate(contents) {
  this.contents = contents;
  this.populated = false;
  }
function PopupWindow_setUrl(url) {
  this.url = url;
  }
function PopupWindow_setWindowProperties(props) {
  this.windowProperties = props;
  }
function PopupWindow_refresh() {
  if (this.divName != null) {
    if (this.use_gebi) {
      document.getElementById(this.divName).innerHTML = this.contents;
      }
    else if (this.use_css) {
      document.all[this.divName].innerHTML = this.contents;
      }
    else if (this.use_layers) {
      var d = document.layers[this.divName];
      d.document.open();
      d.document.writeln(this.contents);
      d.document.close();
      }
    }
  else {
    if (this.popupWindow != null && !this.popupWindow.closed) {
      if (this.url!="") {
        this.popupWindow.location.href=this.url;
        }
      else {
        this.popupWindow.document.open();
        this.popupWindow.document.writeln(this.contents);
        this.popupWindow.document.close();
      }
      this.popupWindow.focus();
      }
    }
  }
function PopupWindow_showPopup(anchorname) {
  this.getXYPosition(anchorname);
  this.x += this.offsetX;
  this.y += this.offsetY;
  if (!this.populated && (this.contents != "")) {
    this.populated = true;
    this.refresh();
    }
  if (this.divName != null) {
    if (this.use_gebi) {
      document.getElementById(this.divName).style.left = this.x + "px";
      document.getElementById(this.divName).style.top = this.y;
      document.getElementById(this.divName).style.visibility = "visible";
      }
    else if (this.use_css) {
      document.all[this.divName].style.left = this.x;
      document.all[this.divName].style.top = this.y;
      document.all[this.divName].style.visibility = "visible";
      }
    else if (this.use_layers) {
      document.layers[this.divName].left = this.x;
      document.layers[this.divName].top = this.y;
      document.layers[this.divName].visibility = "visible";
      }
    }
  else {
    if (this.popupWindow == null || this.popupWindow.closed) {
      if (this.x<0) { this.x=0; }
      if (this.y<0) { this.y=0; }
      if (screen && screen.availHeight) {
        if ((this.y + this.height) > screen.availHeight) {
          this.y = screen.availHeight - this.height;
          }
        }
      if (screen && screen.availWidth) {
        if ((this.x + this.width) > screen.availWidth) {
          this.x = screen.availWidth - this.width;
          }
        }
      var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
      this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
      }
    this.refresh();
    }
  }
function PopupWindow_hidePopup() {
  if (this.divName != null) {
    if (this.use_gebi) {

 document.getElementById(this.divName).style.visibility = "hidden";
      }
    else if (this.use_css) {
      document.all[this.divName].style.visibility = "hidden";
      }
    else if (this.use_layers) {
      document.layers[this.divName].visibility = "hidden";
      }
    }
  else {
    if (this.popupWindow && !this.popupWindow.closed) {
      this.popupWindow.close();
      this.popupWindow = null;
      }
    }
  }
function PopupWindow_isClicked(e) {
  if (this.divName != null) {
    if (this.use_layers) {
      var clickX = e.pageX;
      var clickY = e.pageY;
      var t = document.layers[this.divName];
      if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {
        return true;
        }
      else { return false; }
      }
    else if (document.all) {
      var t = window.event.srcElement;
      while (t.parentElement != null) {
        if (t.id==this.divName) {
          return true;
          }
        t = t.parentElement;
        }
      return false;
      }
    else if (this.use_gebi && e) {
      var t = e.originalTarget;
      while (t.parentNode != null) {
        if (t.id==this.divName) {
          return true;
          }
        t = t.parentNode;
        }
      return false;
      }
    return false;
    }
  return false;
  }
function PopupWindow_hideIfNotClicked(e) {
  if (this.autoHideEnabled && !this.isClicked(e)) {
    this.hidePopup();
    }
  }
function PopupWindow_autoHide() {
  this.autoHideEnabled = true;
  }
function PopupWindow_hidePopupWindows(e) {
  for (var i=0; i<popupWindowObjects.length; i++) {
    if (popupWindowObjects[i] != null) {
      var p = popupWindowObjects[i];
      p.hideIfNotClicked(e);
      }
    }
  }
function PopupWindow_attachListener() {
  if (document.layers) {
    document.captureEvents(Event.MOUSEUP);
    }
  window.popupWindowOldEventListener = document.onmouseup;
  if (window.popupWindowOldEventListener != null) {
    document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");
    }
  else {
    document.onmouseup = PopupWindow_hidePopupWindows;
    }
  }
function PopupWindow() {
  if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
  if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
  if (!window.listenerAttached) {
    window.listenerAttached = true;
    PopupWindow_attachListener();
    }
  this.index = popupWindowIndex++;
  popupWindowObjects[this.index] = this;
  this.divName = null;
  this.popupWindow = null;
  this.width=0;
  this.height=0;
  this.populated = false;
  this.visible = false;
  this.autoHideEnabled = false;

  this.contents = "";
  this.url="";
  this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
  if (arguments.length>0) {
    this.type="DIV";
    this.divName = arguments[0];
    }
  else {
    this.type="WINDOW";
    }
  this.use_gebi = false;
  this.use_css = false;
  this.use_layers = false;
  if (document.getElementById) { this.use_gebi = true; }
  else if (document.all) { this.use_css = true; }
  else if (document.layers) { this.use_layers = true; }
  else { this.type = "WINDOW"; }
  this.offsetX = 0;
  this.offsetY = 0;
  this.getXYPosition = PopupWindow_getXYPosition;
  this.populate = PopupWindow_populate;
  this.setUrl = PopupWindow_setUrl;
  this.setWindowProperties = PopupWindow_setWindowProperties;
  this.refresh = PopupWindow_refresh;
  this.showPopup = PopupWindow_showPopup;
  this.hidePopup = PopupWindow_hidePopup;
  this.setSize = PopupWindow_setSize;
  this.isClicked = PopupWindow_isClicked;
  this.autoHide = PopupWindow_autoHide;
  this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
  }
CosaPicker_targetInput1 = null;
CosaPicker_targetInput2 = null;
CosaPicker_targetInput3 = null;

queque=null;
parametro= null;
rowmin=null;
var numimagen=0;
var img=new Image();
var cargawin=null;
var estiwin=null;
var enforo;
var contitu;
var minlin1;
var elfocus=1;

var borrame=null;

var registrados=new Array();
var identificado=false;

function ColorPicker_writeDiv() {
  document.writeln("<DIV ID=\"colorPickerDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
  }
function FontPicker_writeDiv() {
  document.writeln("<DIV ID=\"fontPickerDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
  }
function emotPicker_writeDiv() {
  document.writeln("<DIV ID=\"emotPickerDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
  }  
function varios_writeDiv() {
  document.writeln("<DIV ID=\"variosDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
  }
function imagen_writeDiv() {
  document.writeln("<DIV ID=\"imagenDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
  }
function modifimagen_writeDiv() {
  document.writeln("<DIV ID=\"modifimagenDiv\" NAME=\"modifimagenDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
  }
function enlaceimagen_writeDiv() {
  document.writeln("<DIV ID=\"enlaceimagenDiv\" NAME=\"enlaceimagenDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
  }
function Fenetre_writeDiv() {
  document.writeln("<DIV ID=\"FenetreDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
  }

function CosaPicker_show(anchorname) {
  this.showPopup(anchorname);
  }
function CosaPicker_pickCosa(cosa,obj) {
  obj.hidePopup();
  pickCosa(cosa);
  }
function CosaPicker_pickCosafont(font,size,obj) {
  obj.hidePopup();
  pickCosafont(font,size);
  }
function CosaPicker_pickCosaemot(emoticono,obj) {
  obj.hidePopup();
  pickCosaemot(emoticono);
  }
function pickCosa(cosa) {
  if (CosaPicker_targetInput1==null) {alert("Error.");return;}
    if (queque=='titu') {
        if (parametro=='fondo') {CosaPicker_targetInput1.titu.style['background']=cosa;
                                 CosaPicker_targetInput1.fondotit.value=cosa;
                                 }
        if (parametro=='color') {CosaPicker_targetInput1.titu.style['color']=cosa;
                                 CosaPicker_targetInput1.colortit.value=cosa;
                                 }
    }
        if (parametro=='fondo') {
            for (var i=1; i<=numimagen+1; i++) { CosaPicker_targetInput1['descrip'+i.toString()].style['background']=cosa;}
            ht=document.body.innerHTML;
            if (browser=='Netscape'){
                   var coldonde=ht.indexOf('<td triluli="" align="center" bgcolor="')+39;
                   var losnombres=new Array();
                   var losvalores=new Array();
                   var gg=document.getElementById("formmen").elements;
                   var lengthfm=gg.length;
                   for (var indc=0; indc<lengthfm; indc++){losnombres[indc]=gg[indc].name;losvalores[indc]=gg[indc].value;}
                   document.body.innerHTML=ht.substring(0,coldonde)+cosa+ht.substring(coldonde+7);
                   for (var indc=0; indc<lengthfm; indc++){document.getElementById("formmen")[losnombres[indc]].value=losvalores[indc];}
                   }
              else {
              var coldonde=ht.indexOf(' triluli="">')-7;
              document.body.innerHTML=ht.substring(0,coldonde)+cosa+ht.substring(coldonde+7);
              }
              document.getElementById("formmen").fondodescrip.value=cosa;
            }
        if (parametro=='color') {
            for (var i=1; i<=numimagen+1; i++) {CosaPicker_targetInput1['descrip'+i.toString()].style['color']=cosa; }
            CosaPicker_targetInput1.colordescrip.value=cosa;
            }
}

function pickCosafont(font,size) {
    for (var i=1; i<=numimagen+1; i++) {
        CosaPicker_targetInput1['descrip'+i.toString()].style.fontFamily=font;
        CosaPicker_targetInput1['descrip'+i.toString()].gautamanormal=size;
        }
    CosaPicker_targetInput2.value=font;
    CosaPicker_targetInput3.value=size;
    recuadra(CosaPicker_targetInput1);
  }

function pickCosaemot(emoticono) {
   
/*
///////////////////////// HERRAM ////////////////////////
//     var gg=document.anchors[13];
       var gg=document.getElementById("formmen").descrip2.onkeyup;
         var todo='LISTA \n';
         var i=0;
         for (var prop in gg){ todo+=prop + " > " + gg[prop]+'\n'; i=i+1; if (i==10)  {alert(todo); todo='LISTA \n'; i=0;}}
//         for (var prop in gg){todo+=prop + " -> " + gg[prop]+'\n'; }

      document.getElementById('descrip1').value=todo;
///////////////////////// HERRAM ////////////////////////
*/

	var anade='[emot'+emoticono+']';
	var textfoc=document.getElementById("formmen")['descrip'+elfocus.toString()];
	if (browser=='Microsoft Internet Explorer') {	
		textfoc.focus();
		document.selection.createRange().text = anade+document.selection.createRange().text;
	}
	else {
		textfoc.value+=anade;
	}
  }


function CosaPicker_select(inputobj,linkname) {
  window.CosaPicker_targetInput1 = inputobj;
  this.show(linkname);
  }


function Picker_cambia(que,param,inputobj1,linkname) {
  window.CosaPicker_targetInput1 = inputobj1;
  window.parametro = param;
  window.queque=que;
  this.show(linkname);
  }


  function Picker_cambiafont(param,inputobj1,inputobj2,inputobj3,inputobj4,linkname) {
  window.CosaPicker_targetInput1 = inputobj1;
  window.CosaPicker_targetInput2 = inputobj2;
  window.CosaPicker_targetInput3 = inputobj3;
  window.CosaPicker_targetInput4 = inputobj4;
  window.parametro = param;
  this.show(linkname);
  }
  
  

  function Picker_ponemot(inputobj1,linkname) {
  window.CosaPicker_targetInput1 = inputobj1;
  this.show(linkname);
  }
  


function ColorPicker_highlightColor(c) {
  var thedoc = (arguments.length>1)?arguments[1]:window.document;
  var d = thedoc.getElementById("colorPickerSelectedColor");
  d.style.backgroundColor = c;
  }
function FontPicker_highlightFont(f,s) {
  var thedoc = (arguments.length>2)?arguments[2]:window.document;
  var d = thedoc.getElementById("fontPickerSelectedFont");
    var ints=Number (s);
    ints=ints+7;
    d.style['font']='bold '+ints+'px '+f;
  }

function ColorPicker() {
  var windowMode = false;
  if (arguments.length==0) {
    var divname = "colorPickerDiv";
    }
  else if (arguments[0] == "window") {
    var divname = '';
    windowMode = true;
    }
  else {
    var divname = arguments[0];
    }

  if (divname != "") {
    var cp = new PopupWindow(divname);
    }
  else {
    var cp = new PopupWindow();
    cp.setSize(225,250);
    }
  cp.currentValue = "#FFFFFF";
  cp.writeDiv = ColorPicker_writeDiv;
  cp.highlightColor = ColorPicker_highlightColor;
  cp.show = CosaPicker_show;
  cp.select = CosaPicker_select;
  cp.cambia = Picker_cambia;
  var colors = new Array(


 "#000000","#003300","#006600","#009900","#00CC00","#00FF00","#00FF33","#00FF66","#00FF99","#00CC99","#009999","#006699","#003399","#00197F","#001999","#0019B2","#0019B2","#0033CC","#0066CC","#0099CC","#00CCCC","#00FFCC",
 "#000033","#003333","#006633","#009933","#00CC33","#00D519","#00D533","#00D54C","#00D566","#00CC66","#009966","#006666","#003333","#000066","#000099","#0000CC","#0000FF","#0033FF","#0066FF","#0099FF","#00CCFF","#00FFFF",
 "#330033","#333333","#336633","#339933","#33CC33","#33D519","#33D533","#33D54C","#33D566","#33CC66","#339966","#336666","#333333","#330066","#330099","#3300CC","#3300FF","#3333FF","#3366FF","#3399FF","#33CCFF","#33FFFF",
 "#330000","#333300","#336600","#339900","#33CC00","#33FF00","#33FF33","#33FF66","#33FF99","#33CC99","#339999","#336699","#333399","#33197F","#331999","#3319B2","#3319B2","#3333CC","#3366CC","#3399CC","#33CCCC","#33FFCC",
 "#660000","#663300","#666600","#669900","#66CC00","#66FF00","#66FF33","#66FF66","#66FF99","#66CC99","#669999","#666699","#663399","#66197F","#661999","#6619B2","#6619B2","#6633CC","#6666CC","#6699CC","#66CCCC","#66FFCC",
 "#660033","#663333","#666633","#669933","#66CC33","#66D519","#66D533","#66D54C","#66D566","#66CC66","#669966","#666666","#663333","#660066","#660099","#6600CC","#6600FF","#6633FF","#6666FF","#6699FF","#66CCFF","#66FFFF",
 "#990033","#993333","#996633","#999933","#99CC33","#99D519","#99D533","#99D54C","#99D566","#99CC66","#999966","#996666","#993333","#990066","#990099","#9900CC","#9900FF","#9933FF","#9966FF","#9999FF","#99CCFF","#99FFFF",
 "#990000","#993300","#996600","#999900","#99CC00","#99FF00","#99FF33","#99FF66","#99FF99","#99CC99","#999999","#996699","#993399","#99197F","#991999","#9919B2","#9919B2","#9933CC","#9966CC","#9999CC","#99CCCC","#99FFCC",
 "#CC0000","#CC3300","#CC6600","#CC9900","#CCCC00","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCCC99","#CC9999","#CC6699","#CC3399","#CC197F","#CC1999","#CC19B2","#CC19B2","#CC33CC","#CC66CC","#CC99CC","#CCCCCC","#CCFFCC",
 "#CC0033","#CC3333","#CC6633","#CC9933","#CCCC33","#CCD519","#CCD533","#CCD54C","#CCD566","#CCCC66","#CC9966","#CC6666","#CC3333","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC33FF","#CC66FF","#CC99FF","#CCCCFF","#CCFFFF",
 "#FF0033","#FF3333","#FF6633","#FF9933","#FFCC33","#FFD519","#FFD533","#FFD54C","#FFD566","#FFCC66","#FF9966","#FF6666","#FF3333","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF33FF","#FF66FF","#FF99FF","#FFCCFF","#FFFFFF",
 "#FF0000","#FF3300","#FF6600","#FF9900","#FFCC00","#FFFF00","#FFFF33","#FFFF66","#FFFF99","#FFCC99","#FF9999","#FF6699","#FF3399","#FF197F","#FF1999","#FF19B2","#FF19B2","#FF33CC","#FF66CC","#FF99CC","#FFCCCC","#FFFFCC"

);
  var total = colors.length;
  var width = 22;
  var cp_contents = "";
  var windowRef = (windowMode)?"window.opener.":"";
  if (windowMode) {
    cp_contents += "<HTML><HEAD><TITLE>Select Color</TITLE></HEAD>";
    cp_contents += "<BODY MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0><CENTER>";
    }
  cp_contents += "<TABLE BORDER=3 CELLSPACING=0 CELLPADDING=0 bgcolor=#FFFFFF>";
  var use_highlight = (document.getElementById || document.all)?true:false;
  for (var i=0; i<total; i++) {
    if ((i % width) == 0) { cp_contents += "<TR>"; }
    if (use_highlight) { var mo = 'onMouseOver="'+windowRef+'ColorPicker_highlightColor(\''+colors[i]+'\',window.document)"'; }
    else { mo = ""; }
    cp_contents += '<TD BGCOLOR="'+colors[i]+'"><FONT SIZE="6"><A HREF="javascript:var iii=0;" onClick="'+windowRef+'CosaPicker_pickCosa(\''+colors[i]+'\','+windowRef+'window.popupWindowObjects['+cp.index+']);return false;" '+mo+' STYLE="text-decoration:none;">&nbsp;&nbsp;&nbsp;&nbsp;</A></FONT></TD>';
    if ( ((i+1)>=total) || (((i+1) % width) == 0)) {
      cp_contents += "</TR>";
      }
    }
  if (document.getElementById) {
    var width1 = Math.floor(width);
    var width2 = width = width1;
    cp_contents += "<TR height=50><TD COLSPAN='"+width1+"' BGCOLOR='#ffffff' ID='colorPickerSelectedColor'>&nbsp;</TD></TR>";


        }
  cp_contents += "</TABLE>";
  if (windowMode) {
    cp_contents += "</CENTER></BODY></HTML>";
    }
  cp.populate(cp_contents+"\n");
  cp.offsetY = 25;
  cp.autoHide();
  return cp;
  }




function FontPicker() {
  var windowMode = false;
  if (arguments.length==0) {
    var divname = "fontPickerDiv";
    }
  else if (arguments[0] == "window") {
    var divname = '';
    windowMode = true;
    }
  else {
    var divname = arguments[0];
    }

  if (divname != "") {
    var cp = new PopupWindow(divname);
    }
  else {
    var cp = new PopupWindow();
    cp.setSize(225,250);
    }
  cp.currentValue = "Times new Roman";
  cp.writeDiv = FontPicker_writeDiv;
  cp.highlightFont = FontPicker_highlightFont;
  cp.show = CosaPicker_show;
  cp.select = CosaPicker_select;
  cp.cambiafont = Picker_cambiafont;
  var fonts = new Array(

"Agency FB","Algerian","Arial","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Baskerville Old Face","Bauhaus 93","Berlin Sans FB","Bernard MT Condensed","Blackadder ITC","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Book Antiqua","Bookman Old Style","Bradley Hand ITC","Britannic Bold","Broadway","Calisto MT","Castellar","Centaur","Century Gothic","Chiller","Colonna MT","Comic Sans MS","Cooper Black","Copperplate Gothic Bold","Copperplate Gothic Light","Courrier","Curlz MT","Edwardian Script ITC","Elephant","Engravers MT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","Felix Titling","Footlight MT Light","Forte","Franklin Gothic Book","Franklin Gothic Demi","Franklin Gothic Demi Cond","Franklin Gothic Heavy","Franklin Gothic Medium","Franklin Gothic Medium Cond","Freestyle Script","French Script MT","Garamond","Gigi","Georgia","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gloucester MT Extra Condensed","Goudy Old Style","Goudy Stout","Haettenschweiler","Harlow Solid Italic","Harrington","Helvetica","High Tower Text","Impact","Imprint MT Shadow","Informal Roman","Jokerman","Juice ITC","Kristen ITC","Kunstler Script","Lucida Bright","Lucida Bright Italic","Lucida Calligraphy Italic","Maiandra GD","Matura MT Script Capitals","Mistral","Modern No. 20","Monotype Corsiva","Niagara Solid","OCR A Extended","Old English Text MT","Onyx","Palace Script MT","Palatino Linotype","Papyrus","Parchment","Playbill","Poor Richard","Pristina","Rage Italic","Ravie","Rockwell Condensed","Rockwell Extra Bold","Script MT Bold","Showcard Gothic","Snap ITC","Stencil","Tempus Sans ITC","Times new roman","Trebuchet MS","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","Verdana","Viner Hand ITC","Vladimir Script","Wide Latin"


    );

 var sizenormal = new Array(
16,10,11,13,10,11,13,10,12,12,
16,12,10,18,18,11,10,12,11,10,
12,09,13,10,18,12,11,10,10,11,
13,14,20,11,09,11,11,11,11,09,
12,12,11,11,11,10,12,13,18,18,
13,14,11,12,16,16,09,11,16,12,
07,16,14,12,12,12,12,12,14,10,
18,11,20,11,12,10,12,12,16,12,
14,18,11,13,18,24,11,12,24,20,
14,17,14,09,16,09,12,09,10,10,
11,12,11,12,16,13,11,11,16,08);
  var total = fonts.length;
  var width = 10;
  var cp_contents = "";
  var windowRef = (windowMode)?"window.opener.":"";
  if (windowMode) {
    cp_contents += "<HTML><HEAD><TITLE>Select Font</TITLE></HEAD>";
    cp_contents += "<BODY MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0><CENTER>";
    }
  cp_contents += "<TABLE BORDER=3 CELLSPACING=0 CELLPADDING=0 bgcolor=#ddddaa>";
  var use_highlight = (document.getElementById || document.all)?true:false;
  for (var i=0; i<total; i++) {
    if ((i % width) == 0) { cp_contents += "<TR>"; }
    if (use_highlight) { var mo = 'onMouseOver="'+windowRef+'FontPicker_highlightFont(\''+fonts[i]+'\',\''+sizenormal[i]+'\',window.document)"'; }
    else { mo = ""; }
    cp_contents += '<TD  width="10%" style=" font-family:'+fonts[i]+'; font-size:'+sizenormal[i]+'px;"><A HREF="javascript:var iii=0;" onClick="'+windowRef+'CosaPicker_pickCosafont(\''+fonts[i]+'\',\''+sizenormal[i]+'\','+windowRef+'window.popupWindowObjects['+cp.index+']);return false;" '+mo+' STYLE="color:#000000;text-decoration:none;"><Center>'+lascoles+'</Center></A></FONT></TD>';
    if ( ((i+1)>=total) || (((i+1) % width) == 0)) {
      cp_contents += "</TR>";
      }
    }
  if (document.getElementById) {
    var width1 = Math.floor(width);
    var width2 = width = width1;
    cp_contents += '<TR><TD COLSPAN="'+width1+'" height=70 style=" font-family Arial; font-size: 5px;" ID="fontPickerSelectedFont"  ><Center> &nbsp; '+lascolesraul+'</Center></TD></TR>';
        }
  cp_contents += "</TABLE>";
  if (windowMode) {
    cp_contents += "</CENTER></BODY></HTML>";
    }
  cp.populate(cp_contents+"\n");
  cp.offsetY = 25;
  cp.autoHide();
  return cp;
  }


function emotPicker() {
  var windowMode = false;
  if (arguments.length==0) {
    var divname = "fontPickerDiv";
    }
  else if (arguments[0] == "window") {
    var divname = '';
    windowMode = true;
    }
  else {
    var divname = arguments[0];
    }

  if (divname != "") {
    var cp = new PopupWindow(divname);
    }
  else {
    var cp = new PopupWindow();
    cp.setSize(225,250);
    }
  cp.currentValue = "Times new Roman";
  cp.writeDiv = emotPicker_writeDiv;
  cp.show = CosaPicker_show;
  cp.select = CosaPicker_select;
  cp.ponemot = Picker_ponemot;
  var width = 10;
  var cp_contents = "";
  var windowRef = (windowMode)?"window.opener.":"";
  if (windowMode) {
    cp_contents += "<HTML><HEAD><TITLE>Seleccionar emoticono</TITLE></HEAD>";
    cp_contents += "<BODY MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0><CENTER>";
    }
  cp_contents += "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 bgcolor=#ddddaa>";
  mo = 'onMouseOver="'+'"';
	var emotic=0;
	for (var lin=1; lin<12; lin++) {
		cp_contents += "<TR>"; 
		for (var col=1; col<10; col++) {
			emotic++;
			cp_contents += '<TD  width="10%"><A HREF="javascript: void(0);" onClick="'+windowRef+'CosaPicker_pickCosaemot(\''+emotic+'\','+windowRef+'window.popupWindowObjects['+cp.index+']);return false;" '+mo+' STYLE="color:#000000;text-decoration:none;"><Center><img src="imagau/emoticonos/'+emotic+'.gif" border=0></Center></A></FONT></TD>';
		}
		cp_contents += "</TR>"; 
	}
  cp_contents += "</TABLE>";
  if (windowMode) {
    cp_contents += "</CENTER></BODY></HTML>";
    }
    
  cp.populate(cp_contents+"\n");
  cp.offsetY = 25;
  cp.autoHide();
  return cp;
  }

function picktama(que,inputobj1,inputobj2) {
     var iint=parseInt(inputobj1.descrip1.style.fontSize.slice(0,inputobj1.descrip1.style.fontSize.indexOf('px')));
     if (que=='mas'){iint=iint+2;}
     if ((que=='menos'&&(iint>2))){iint=iint-2; }
     for (var i=1; i<=numimagen+1; i++) {
         inputobj1['descrip'+i.toString()].style.fontSize=iint+'px';
         }
     inputobj2.value=iint;
     recuadra(inputobj1);
  }

function pickotro(que,inputobj1,inputobj2,elboton,browser) {

     if (que=='cursiva'){
        if (browser=='Netscape'){
            if (inputobj1.descrip1.style.fontStyle=='italic'){
                for (var i=1; i<=numimagen+1; i++) {inputobj1['descrip'+i.toString()].style.fontStyle='';}
              }
            else {
                for (var i=1; i<=numimagen+1; i++) {inputobj1['descrip'+i.toString()].style.fontStyle='italic';}
                }
          }

        else {
            var f=inputobj1.descrip1.style.cssText;
            var i= f.indexOf('FONT-STYLE: italic;');
            if (i==-1){
                for (var j=1; j<=numimagen+1; j++) {  inputobj1['descrip'+j.toString()].style.cssText='FONT-STYLE: italic; '+f;}
                }
            else {
                for (var j=1; j<=numimagen+1; j++) {  inputobj1['descrip'+j.toString()].style.cssText=f.slice(0,i)+f.slice(i+20);}
                }
            }
        if (inputobj2.value=="0"){inputobj2.value="1";} else {inputobj2.value="0"};
      }

     if (que=='grueso'){
       if(inputobj1.descrip1.style.fontWeight=="bold") {
            for (var j=1; j<=numimagen+1; j++) {inputobj1['descrip'+j.toString()].style.fontWeight="";}
            }
        else {
            for (var j=1; j<=numimagen+1; j++) {inputobj1['descrip'+j.toString()].style.fontWeight="bold";}
            }
        if (inputobj2.value=="0"){inputobj2.value="1";} else {inputobj2.value="0"};
       }
     if (que=='subrayado'){
        if (browser=='Netscape')
            {if (inputobj1.descrip1.style.textDecoration=='underline'){
                for (var j=1; j<=numimagen+1; j++) {inputobj1['descrip'+j.toString()].style.textDecoration='';}
                }
             else{
                for (var j=1; j<=numimagen+1; j++) {inputobj1['descrip'+j.toString()].style.textDecoration='underline';}
                }
            }
        else {
            for (var j=1; j<=numimagen+1; j++) {inputobj1['descrip'+j.toString()].style.textDecorationUnderline= !(inputobj1['descrip'+j.toString()].style.textDecorationUnderline);}
            }
        if (inputobj2.value=="0"){inputobj2.value="1";} else {inputobj2.value="0"};
        }

     if (que=='herram'){//alert(elboton);
         var gg=inputobj1;
         var todo='LISTA \n'
         for (var prop in gg){
            todo+=prop + " > " + gg[prop]+'\n';}
      inputobj2.value=todo; }

      if (elboton.className=='gauibvdado'){elboton.className='gauibv';}else{elboton.className='gauibvdado';}
      recuadra(inputobj1);
//      elboton.opacity='"20%"';
      }


function TamaPicker() {
//    var cp = new PopupWindow();
    this.cambiatama=picktama;
    this.cambiaotro=pickotro;
//    return cp;
  }

