 	function textoinfor(texto) {
	
	if (texto.value == "youtube"){
	texto_infor="Insertar video de youtube"
	}
		
	if (texto.value == "n") {
	texto_infor="Pone texto en negrita"
	} 
	if (texto.name == "botoni") {
	texto_infor="Inserta una imagen"
	} 
		if (texto.value == "c") {
	texto_infor="Pone texto en cursiva"
	} 
	
		if (texto.value == "s") {
	texto_infor="Pone texto subrayado"

	} 	
		if (texto.value == "negro") {
	texto_infor="Elige color de texto"
	} 
	
  		if (texto.value == "normal") {
	texto_infor="Elige tamaño de texto"

	} 
	
			if (texto.value == "sonrisa") {
	texto_infor="Icono Sonrisa"
	} 
	
		if (texto.value == "pensativo") {
	texto_infor="Icono Pensativo"
	} 
	
	
		if (texto.value == "triste") {
	texto_infor="Icono Triste"
	} 
		if (texto.value == "guinio") {
	texto_infor="Icono guiño"
	} 
		if (texto.value == "gafas") {
	texto_infor="Icono Gafas de Sol"
	} 
		if (texto.value == "risa") {
	texto_infor="Icono Alegre"
	} 
		if (texto.value == "serio") {
	texto_infor="Icono Serio"
	} 
	
		if (texto.value == "email") {
	texto_infor="Introduce dirección e-mail"
	} 
		
			if (texto.value == "web") {
	texto_infor="Introduce dirección web"
	} 
	
		if (texto.value == "lengua") {
	texto_infor="Icono Sacar la lengua"
	} 
		if (texto.value == "diente") {
	texto_infor="Icono Cuñaaooo"
	} 
		if (texto.value == "herido") {
	texto_infor="Icono Herido"
	} 
		if (texto.value == "enfermo") {
	texto_infor="Icono Enfermo"
	} 
		if (texto.value == "timido") {
	texto_infor="Icono Tímido"
	} 
	
		if (texto.value == "miron") {
	texto_infor="Icono Cotilla"
	} 
		if (texto.value == "fantasma") {
	texto_infor="Icono Fantasma"
	} 
		if (texto.value == "rodando") {
	texto_infor="Icono Rodandooo"
	} 
		if (texto.value == "vampiro") {
	texto_infor="Icono Vampiro"
	} 
		if (texto.value == "sorpresa") {
	texto_infor="Icono Sorprendido"
	} 
		if (texto.value == "beso") {
	texto_infor="Icono Besote"
	} 
		if (texto.value == "enfadado") {
	texto_infor="Icono Enfurruñadoo"
	} 
   	if (texto.value == "llorar") {
	texto_infor="Icono Llorón"
	} 
	
		if (texto.value == "---") {
	texto_infor="Centrar Texto"
	} 
 		
	 document.miFormulario.resultado.value = texto_infor 
	 	}
	
	function limpiar () {
	document.miFormulario.resultado.value = '' }

function FormatoTexto(boton) {
		
	
	// val_boton=boton.name
	 //window.alert (val_boton)
	 
	//Joseba youtube 
	if (boton.value == "youtube") {
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[youtube]"+texton+"[/youtube]");
	 $obj.value=texto.replace(texton,texton2);
		
	 if (document.selection.createRange().text.length >0 ) {		

    document.miFormulario.Mensaje.focus()
	textoseln=document.selection.createRange().text;
	texton=textoseln.replace(textoseln,"[youtube]"+textoseln+"[/youtube]");
	document.selection.createRange().text = texton;

	//return true;
	}
	else
	window.alert ("Selecciona el texto a poner en negrita")	
	 } 
	 
	 
	if (boton.value == "n") {
		
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[b]"+texton+"[/b]");
	 $obj.value=texto.replace(texton,texton2);
		
   if (document.selection.createRange().text.length >0 ) {		

    document.miFormulario.Mensaje.focus()
	textoseln=document.selection.createRange().text;
	texton=textoseln.replace(textoseln,"[b]"+textoseln+"[/b]");
	document.selection.createRange().text = texton;

	//return true;
	}
	else
	window.alert ("Selecciona el texto a poner en negrita")	
	 } 
	
	  if (boton.value == "c") {
		  
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[k]"+texton+"[/k]");
	 $obj.value=texto.replace(texton,texton2);
		  
		  
		  
	if (document.selection.createRange().text.length >0 ) {
    document.miFormulario.Mensaje.focus()
	textoselc=document.selection.createRange().text  ;
	textoc=textoselc.replace(textoselc,"[k]"+textoselc+"[/k]");
	document.selection.createRange().text = textoc;
	//  return true;
	}
	else
	window.alert ("Selecciona el texto a poner en cursiva")	
	}
	
	  if (boton.value == "s") {
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[u]"+texton+"[/u]");
	 $obj.value=texto.replace(texton,texton2);
		  
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[u]"+textosels+"[/u]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto a subrayar") }	
	
	  if (boton.value == "---") {
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[center]"+texton+"[/center]");
	 $obj.value=texto.replace(texton,texton2);
		  
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[center]"+textosels+"[/center]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto que quieres centrar") }
	
	
	  if (boton.value == "rojo") {
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[red]"+texton+"[/red]");
	 $obj.value=texto.replace(texton,texton2);
		  
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[red]"+textosels+"[/red]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto poner en rojo") }
	
	
	  if (boton.value == "azul") {
		  
	var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[blue]"+texton+"[/blue]");
	 $obj.value=texto.replace(texton,texton2);
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[blue]"+textosels+"[/blue]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto poner en azul") }
	
	  if (boton.value == "verde") {
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[green]"+texton+"[/green]");
	 $obj.value=texto.replace(texton,texton2);
		  
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[green]"+textosels+"[/green]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto poner en verde") }
	
	
		  if (boton.value == "naranja") {
			  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[orange]"+texton+"[/orange]");
	 $obj.value=texto.replace(texton,texton2);
			  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[orange]"+textosels+"[/orange]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto poner en blanco") }
	
	  if (boton.value == "pequenio") {
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[small]"+texton+"[/small]");
	 $obj.value=texto.replace(texton,texton2);
		  
		  
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[small]"+textosels+"[/small]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto poner en pequeño") }
	
	  if (boton.value == "purpura") {
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[purple]"+texton+"[/purple]");
	 $obj.value=texto.replace(texton,texton2);
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[purple]"+textosels+"[/purple]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto poner en púrpura") }
	
	
	  if (boton.value == "grande") {
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[big]"+texton+"[/big]");
	 $obj.value=texto.replace(texton,texton2);
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[big]"+textosels+"[/big]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto poner en grande") }
	
	  if (boton.value == "gigante") {
		  
	 var $obj = document.getElementById("textareaJ");
	 texto=$obj.value
	 texton=$obj.value.substring($obj.selectionStart, $obj.selectionEnd);
	 texton2=("[giant]"+texton+"[/giant]");
	 $obj.value=texto.replace(texton,texton2);
		  
	 if (document.selection.createRange().text.length >0 ) {
	document.miFormulario.Mensaje.focus()
	textosels=document.selection.createRange().text  ;
	textos=textosels.replace(textosels,"[giant]"+textosels+"[/giant]");
	document.selection.createRange().text = textos;
	 // return true;
	}	
	else
	window.alert ("Selecciona el texto poner en gigante") }
	
		 } // ** Cierre Función	

	function validar_form () {

 if (document.miFormulario.Titulo.value=="") {
    alert ("Debes rellenar el título. Gracias")
	document.miFormulario.Titulo.focus(); 
	}
	else {
	  if (document.miFormulario.Mensaje.value=="") {
	 alert ("Debes rellenar el Mensaje. Gracias")
	 	document.miFormulario.Mensaje.focus();
	 }
	 else {
	 document.miFormulario.submit()
	 }
	 }
     }


var pasos;
function x (){
return;
} 
function CONCATENA(dibu){
		document.miFormulario.Mensaje.focus();
		if (pasos == 0){ 
					document.miFormulario.Mensaje.value="";
					}
		document.miFormulario.Mensaje.value=document.miFormulario.Mensaje.value+dibu;
		pasos=pasos+1;
		document.miFormulario.Mensaje.focus();
}
function MODIFICA(tipo){
		var revisar;
		var prohibido=1;
		var letra;
		var mensaje=document.miFormulario.Mensaje.value;
		var texmod
		
		if (tipo=="youtube"){
			texmod=prompt("Escriba la direccion del video de youtube. Puedes escribir la direccion por ejemplo asi: http://www.youtube.com/watch?v=XKoeol2IMXk (No debe aparecer nada detras del codigo del video) o el codigo del video: XKoeol2IMXk","");
		}
		
		if (tipo=="youtube"){
var texto="[youtube]" + texmod + "[/youtube]";
		}
		
		if (tipo=="email") {
			texmod= prompt("Escriba su Email","");
			}
			
		if (tipo=="email"){ 
			var texto=" ##"+ tipo +"##"+ texmod +"##/" + tipo+"## ";
		}	
			
			
		if (tipo=="web") {
			texmod= prompt("Escriba la direccion web","http://");
			}

		if (tipo=="web"){ 
var texto=" ##"+ tipo +"##"+ texmod +"##webseparador##"+ "Click Aquí" +"##/" + tipo+"##";
		}
		
		




	

		revisar=mensaje+texto;
		for(i=0;i < revisar.length;i++){
			letra=revisar.charAt(i);
			if ((letra=="<") || (letra==">")){
							prohibido=0;
							break;
							}
			}
			if (prohibido!==0){
							document.miFormulario.Mensaje.value=revisar;
							document.miFormulario.Mensaje.focus();
			}
			if (prohibido!==1){
							alert("No se puede insertar el caracter "+ letra +" gracias");
							MODIFICA(tipo);
							}
		return;
}
function inicializar(){
		pasos=0;
		return;
		}

 
 function mOvr(src,clrOver) {
 if (navigator.appName=="Netscape")
 {
   src.style.cursor = 'pointer';
   src.bgcolor  = '#000000';
	 //src.bgColor=color_entrada;src.style.cursor="hand"; 
 }
 else
 {
 if (!src.contains(event.fromElement)) {
	 src.style.cursor = 'hand';
	 src.bgColor = clrOver;
   }
  }	
 }
 
 function mOut(src,clrIn) {
   if (navigator.appName=="Netscape")
   {}
   else
   {	
	if (!src.contains(event.toElement)) {
	 src.style.cursor = 'default';
	 src.bgColor = clrIn;
	}
   }	
 }
 
 function mClk(src) {
 if (navigator.appName=="Netscape")
 {}
 else
 {
 if(event.srcElement.tagName=='TD')
	 src.children.tags('A')[0].click();
 }	 
 }


function AbrirVentana(Web, Nombre, Ancho, Alto) {
var wint = ((screen.height - Alto) / 2)-20;
var winl = (screen.width - Ancho) / 2;
Propiedades = 'height='+Alto+',width='+Ancho+',top='+wint+',left='+winl+',scrollbars=yes,noresizable'
win = window.open(Web, Nombre, Propiedades)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}




<!--
function hideLoadingPage() {
	if (document.getElementById) {  // DOM3 = IE5, NS6
		document.getElementById('hidepage').style.visibility = 'hidden';
	}
	else {
		if (document.layers) {  // Netscape 4
			document.hidepage.visibility = 'hidden';
		}
		else {  // IE 4
			document.all.hidepage.style.visibility = 'hidden';
		}
	}
}
//  End -->
//******** FUNCIONES QUE UTILIZA EL MENU **********
//FUNCION QUE MUESTRA LAS CAPAS
function makeLayer(id, position, left, top, width, height, visibility,nivel) {
  this.clearTimeout();
  ns4 = (document.layers)? true:false
  ie4 = (document.all)? true:false
  winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20
  winH = (ns4)? window.innerHeight : document.body.offsetHeight
 //CALCULAMOS LA IZQUIERDA DEPENDIENDO DEL EXPLORADOR
 if (navigator.appName=="Netscape")
   {    
	 if (nivel=="NIVELB"){top=top}
     if (winW>726){calcularW=((winW-750)/2)+170}
     else{calcularW=160}    
	 restar=806
	}
  else
   {
     restar=800
     height=0
     if (winW>750){calcularW=((winW-750)/2)+150}
     else{calcularW=160}
   }
 // 150 ES EL WIDTH DEL MENU DE NIVEL A 
 if (nivel=="NIVELB"){calcularW=calcularW+150} 
  //AL CREAR LAS CAPAS LE PONEMOS UN TOP MUY ALTO PARA QUE SE CREEN AL FINAL DE LA PAGINA Y NO SE VEAN
  //RESTAR COMPENSA ESE TOP ALTO PARA QUE CUANDO LLAMEMOS A LA FUNCION PARA QUE SE VEAN APAREZCAN EN SU LUGAR	
  top=top-restar 
  this.obj = document.getElementById(id).style;
  this.obj.position = position;
  this.obj.left = calcularW;
  this.obj.top = top;
  this.obj.width = width;
  this.obj.height = height;
  this.obj.visibility = visibility;
  //AL PASAR 200000 MILISEGUNDO DESAPAREZCA LA CAPA
  setTimeout (" this.obj.visibility ='hidden';", 200000); 
  return this.obj;
}

//ESTA ES LA FUNCION QUE UTILIZAMOS PARA CREAR LAS CAPAS
function newmakeLayer(id, position, left, top, width, height, visibility,nivel) {
  ns4 = (document.layers)? true:false
  ie4 = (document.all)? true:false
  winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20
  winH = (ns4)? window.innerHeight : document.body.offsetHeight
  this.obj = document.getElementById(id).style;
  this.obj.position = position;
  this.obj.left = left;
  this.obj.top = 850;
  this.obj.width = width;
  this.obj.height = height;
  this.obj.visibility = "hidden";
  return this.obj;
}

function hiddenLayer(id)
{
  ns4 = (document.layers)? true:false
  ie4 = (document.all)? true:false
  winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20
  winH = (ns4)? window.innerHeight : document.body.offsetHeight
 // this.obj.visibility = "hidden";
  setTimeout (" this.obj.visibility ='hidden';", 1000); 
 return this.obj;
}

//******** FUNCIONES QUE UTILIZA EL MENU **********

function replaceChars(entry,reemplazar,nuevo) {
out = reemplazar; // reemplazar esto
add = nuevo; // por esto
temp = "" + entry;

while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out.length), temp.length));
}
return temp;
}



//FUNCION QUE MUESTRA LAS CAPAS
function vercapa(id, position, left, top, width, height, visibility,nivel) {
  top=parseInt(top)+988
  this.clearTimeout();
  ns4 = (document.layers)? true:false
  ie4 = (document.all)? true:false
  winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20
  winH = (ns4)? window.innerHeight : document.body.offsetHeight
 //CALCULAMOS LA IZQUIERDA DEPENDIENDO DEL EXPLORADOR
 if (navigator.appName=="Netscape")
   {    
	 if (nivel=="NIVELB"){top=top}
     if (winW>726){calcularW=((winW-750)/2)+170}
     else{calcularW=160}    
	 restar=806
	 //banner SMS
	 sumar=40
	}
  else
   {
     restar=800
     height=0
	 //baner SMS
	 sumar=55
     if (winW>750){calcularW=((winW-750)/2)+150}
     else{calcularW=160}
   }
 // 150 ES EL WIDTH DEL MENU DE NIVEL A 
 if (nivel=="NIVELB"){calcularW=calcularW+150} 
  //AL CREAR LAS CAPAS LE PONEMOS UN TOP MUY ALTO PARA QUE SE CREEN AL FINAL DE LA PAGINA Y NO SE VEAN
  //RESTAR COMPENSA ESE TOP ALTO PARA QUE CUANDO LLAMEMOS A LA FUNCION PARA QUE SE VEAN APAREZCAN EN SU LUGAR	
  top=top-restar 
  top=top+sumar
  this.obj = document.getElementById("layer1").style;
  this.obj.position = position;
  this.obj.left = calcularW;
  this.obj.top = top;
  this.obj.width = width;
  this.obj.height = height;
  this.obj.visibility = visibility;
  
 // this.obj2 = document.getElementById(id).getAttribute("value") ;
  
  contenido=document.getElementById(id).getAttribute("value") ;
 //contenido="adfgadfgadfg"

nueva=replaceChars(contenido,"$","<")
nueva=replaceChars(nueva,"@",">")
nueva=replaceChars(nueva,"º","'")
nueva=replaceChars(nueva,"ª",String.fromCharCode(34))

  this.obj3 = document.getElementById("layer1");
  //if (ie4) document.all['layer1'].innerHtml=nueva;
//  if(ns4) document.getElementById['layer1'].innerHTML= nueva;


  this.obj3.innerHTML=nueva;
  
  
 
  
  //AL PASAR 200000 MILISEGUNDO DESAPAREZCA LA CAPA
  setTimeout ("this.obj.visibility ='hidden';", 200000); 
  return this.obj;
}


function openScript(url, width, height) {
        var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no,status=no' );
}


  function mostraropcion(id,estado,pos)
  {
     document.getElementById(id).style.visibility=estado;
	 if(navigator.appName=="Netscape")
	 {
		if(window.innerWidth>773)
		{ 
		
		Ancho=(window.innerWidth-773)/2;
		document.getElementById(id).style.left=Ancho;}
	 }
  }
